From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wque6-0003Bz-4g; Sun, 01 Jun 2014 01:33:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wque5-0003Bq-0V
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:09 +0000
Received: from [193.109.254.147:50337] by server-2.bemta-14.messagelabs.com id
	56/76-21684-4D28A835; Sun, 01 Jun 2014 01:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1401586386!8334768!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11110 invoked from network); 1 Jun 2014 01:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqudz-0001KC-Rt
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqudz-0001NA-NE
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:03 +0000
Date: Sun, 01 Jun 2014 01:33:03 +0000
Message-Id: <E1Wqudz-0001NA-NE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix memory leak in
	libxl_cpuid_dispose
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e620f2dfa5ef288efcae0995cbf197bd79c364b6
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:48 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 10:59:41 2014 +0100

    libxl: fix memory leak in libxl_cpuid_dispose
    
    libxl_cpuid_policy_list is not allocated with GC-aware allocation so it
    needs to be freed manually, just like what libxl_string_list_dispose and
    libxl_key_value_list_dispose do.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_cpuid.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index d1ea50d..3787213 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -26,6 +26,7 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
             if (cpuid_list[i].policy[j] != NULL)
                 free(cpuid_list[i].policy[j]);
     }
+    free(cpuid_list);
     return;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wque6-0003Bz-4g; Sun, 01 Jun 2014 01:33:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wque5-0003Bq-0V
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:09 +0000
Received: from [193.109.254.147:50337] by server-2.bemta-14.messagelabs.com id
	56/76-21684-4D28A835; Sun, 01 Jun 2014 01:33:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1401586386!8334768!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11110 invoked from network); 1 Jun 2014 01:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqudz-0001KC-Rt
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqudz-0001NA-NE
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:03 +0000
Date: Sun, 01 Jun 2014 01:33:03 +0000
Message-Id: <E1Wqudz-0001NA-NE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix memory leak in
	libxl_cpuid_dispose
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e620f2dfa5ef288efcae0995cbf197bd79c364b6
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:48 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 10:59:41 2014 +0100

    libxl: fix memory leak in libxl_cpuid_dispose
    
    libxl_cpuid_policy_list is not allocated with GC-aware allocation so it
    needs to be freed manually, just like what libxl_string_list_dispose and
    libxl_key_value_list_dispose do.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_cpuid.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index d1ea50d..3787213 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -26,6 +26,7 @@ void libxl_cpuid_dispose(libxl_cpuid_policy_list *p_cpuid_list)
             if (cpuid_list[i].policy[j] != NULL)
                 free(cpuid_list[i].policy[j]);
     }
+    free(cpuid_list);
     return;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqueG-0003D7-8W; Sun, 01 Jun 2014 01:33:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueE-0003Cv-VS
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:19 +0000
Received: from [193.109.254.147:50513] by server-16.bemta-14.messagelabs.com
	id 88/F4-16986-ED28A835; Sun, 01 Jun 2014 01:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1401586396!3662065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25823 invoked from network); 1 Jun 2014 01:33:17 -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;
	1 Jun 2014 01:33:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueC-0001KF-8x
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueB-0001NY-WC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:16 +0000
Date: Sun, 01 Jun 2014 01:33:15 +0000
Message-Id: <E1WqueB-0001NY-WC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl.h: document the paradigm of
	using libxl types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00bfad10f82a0b5554a96e37aed7187c6f374112
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:49 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 10:59:53 2014 +0100

    libxl.h: document the paradigm of using libxl types
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index c7aa817..896ecab 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -245,6 +245,16 @@
  * libxl_types.idl). The library provides a common set of methods for
  * initialising and freeing these types.
  *
+ * IDL-generated libxl types should be used as follows: the user must
+ * always call the "init" function before using a type, even if the
+ * variable is simply being passed by reference as an out parameter
+ * to a libxl function.  The user must always calls "dispose" exactly
+ * once afterwards, to clean up, regardless of whether operations on
+ * this object succeeded or failed.  See the xl code for examples.
+ *
+ * "init" is idempotent.  We intend that "dispose" will become
+ * idempotent, but this is not currently the case.
+ *
  * void libxl_<type>_init(<type> *p):
  *
  *    Initialises the members of "p" to all defaults. These may either
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqueG-0003D7-8W; Sun, 01 Jun 2014 01:33:20 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueE-0003Cv-VS
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:19 +0000
Received: from [193.109.254.147:50513] by server-16.bemta-14.messagelabs.com
	id 88/F4-16986-ED28A835; Sun, 01 Jun 2014 01:33:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1401586396!3662065!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25823 invoked from network); 1 Jun 2014 01:33:17 -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;
	1 Jun 2014 01:33:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueC-0001KF-8x
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueB-0001NY-WC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:16 +0000
Date: Sun, 01 Jun 2014 01:33:15 +0000
Message-Id: <E1WqueB-0001NY-WC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl.h: document the paradigm of
	using libxl types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 00bfad10f82a0b5554a96e37aed7187c6f374112
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:49 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 10:59:53 2014 +0100

    libxl.h: document the paradigm of using libxl types
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index c7aa817..896ecab 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -245,6 +245,16 @@
  * libxl_types.idl). The library provides a common set of methods for
  * initialising and freeing these types.
  *
+ * IDL-generated libxl types should be used as follows: the user must
+ * always call the "init" function before using a type, even if the
+ * variable is simply being passed by reference as an out parameter
+ * to a libxl function.  The user must always calls "dispose" exactly
+ * once afterwards, to clean up, regardless of whether operations on
+ * this object succeeded or failed.  See the xl code for examples.
+ *
+ * "init" is idempotent.  We intend that "dispose" will become
+ * idempotent, but this is not currently the case.
+ *
  * void libxl_<type>_init(<type> *p):
  *
  *    Initialises the members of "p" to all defaults. These may either
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01: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.xen.org>)
	id 1WqueR-0003F0-BP; Sun, 01 Jun 2014 01:33:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueP-0003Ek-Sf
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:29 +0000
Received: from [193.109.254.147:30192] by server-12.bemta-14.messagelabs.com
	id 96/5F-27473-9E28A835; Sun, 01 Jun 2014 01:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586406!8293168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24372 invoked from network); 1 Jun 2014 01:33:27 -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;
	1 Jun 2014 01:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueM-0001KO-IC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueM-0001OQ-D5
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:26 +0000
Date: Sun, 01 Jun 2014 01:33:26 +0000
Message-Id: <E1WqueM-0001OQ-D5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl.h: document libxl_<type>_to_json
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe54fc1a96eabe6e903ddcf17ca4188bde1bdd61
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:50 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:24 2014 +0100

    libxl.h: document libxl_<type>_to_json
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 896ecab..80947c3 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -291,6 +291,11 @@
  *    Frees any dynamically allocated memory used by the members of
  *    "p" but not the storage used by "p" itself (this allows for the
  *    allocation of arrays of types and for the composition of types).
+ *
+ * char *libxl_<type>_to_json(instance *p)
+ *
+ *    Generates a JSON object from "p" in the form of a NULL terminated
+ *    string.
  */
 #ifndef LIBXL_H
 #define LIBXL_H
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01: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.xen.org>)
	id 1WqueR-0003F0-BP; Sun, 01 Jun 2014 01:33:31 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueP-0003Ek-Sf
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:29 +0000
Received: from [193.109.254.147:30192] by server-12.bemta-14.messagelabs.com
	id 96/5F-27473-9E28A835; Sun, 01 Jun 2014 01:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586406!8293168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24372 invoked from network); 1 Jun 2014 01:33:27 -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;
	1 Jun 2014 01:33:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueM-0001KO-IC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueM-0001OQ-D5
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:26 +0000
Date: Sun, 01 Jun 2014 01:33:26 +0000
Message-Id: <E1WqueM-0001OQ-D5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl.h: document libxl_<type>_to_json
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fe54fc1a96eabe6e903ddcf17ca4188bde1bdd61
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:50 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:24 2014 +0100

    libxl.h: document libxl_<type>_to_json
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 896ecab..80947c3 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -291,6 +291,11 @@
  *    Frees any dynamically allocated memory used by the members of
  *    "p" but not the storage used by "p" itself (this allows for the
  *    allocation of arrays of types and for the composition of types).
+ *
+ * char *libxl_<type>_to_json(instance *p)
+ *
+ *    Generates a JSON object from "p" in the form of a NULL terminated
+ *    string.
  */
 #ifndef LIBXL_H
 #define LIBXL_H
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqueb-0003H1-Ec; Sun, 01 Jun 2014 01:33:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueZ-0003Ga-BB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:39 +0000
Received: from [85.158.139.211:11649] by server-2.bemta-5.messagelabs.com id
	96/F5-12074-2F28A835; Sun, 01 Jun 2014 01:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1401586417!7391195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16725 invoked from network); 1 Jun 2014 01:33:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueW-0001KW-OK
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueW-0001Oq-NG
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:36 +0000
Date: Sun, 01 Jun 2014 01:33:36 +0000
Message-Id: <E1WqueW-0001Oq-NG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal.h: move / add some
	libxl defbool #define here
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a84725c201cffe714b91ace83b5dd381c879ba5b
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:51 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:30 2014 +0100

    libxl_internal.h: move / add some libxl defbool #define here
    
    They will be used by both JSON generator and parser so they should be in
    header file.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c          |   10 +++-------
 tools/libxl/libxl_internal.h |    8 ++++++++
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4ea7abb..900b8d4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -232,10 +232,6 @@ void libxl_key_value_list_dispose(libxl_key_value_list *pkvl)
     free(kvl);
 }
 
-#define LIBXL__DEFBOOL_DEFAULT (0)
-#define LIBXL__DEFBOOL_FALSE (-1)
-#define LIBXL__DEFBOOL_TRUE (1)
-
 void libxl_defbool_set(libxl_defbool *db, bool b)
 {
     db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
@@ -266,11 +262,11 @@ bool libxl_defbool_val(libxl_defbool db)
 const char *libxl_defbool_to_string(libxl_defbool b)
 {
     if (b.val < 0)
-        return "False";
+        return LIBXL__DEFBOOL_STR_FALSE;
     else if (b.val > 0)
-        return "True";
+        return LIBXL__DEFBOOL_STR_TRUE;
     else
-        return "<default>";
+        return LIBXL__DEFBOOL_STR_DEFAULT;
 }
 
 /******************************************************************************/
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index c2b73c4..294c595 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3036,6 +3036,14 @@ void libxl__numa_candidate_put_nodemap(libxl__gc *gc,
     libxl_bitmap_copy(CTX, &cndt->nodemap, nodemap);
 }
 
+/* Som handy macros for defbool type. */
+#define LIBXL__DEFBOOL_DEFAULT     (0)
+#define LIBXL__DEFBOOL_FALSE       (-1)
+#define LIBXL__DEFBOOL_TRUE        (1)
+#define LIBXL__DEFBOOL_STR_DEFAULT "<default>"
+#define LIBXL__DEFBOOL_STR_FALSE   "False"
+#define LIBXL__DEFBOOL_STR_TRUE    "True"
+
 /*
  * Inserts "elm_new" into the sorted list "head".
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:33:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqueb-0003H1-Ec; Sun, 01 Jun 2014 01:33:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueZ-0003Ga-BB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:39 +0000
Received: from [85.158.139.211:11649] by server-2.bemta-5.messagelabs.com id
	96/F5-12074-2F28A835; Sun, 01 Jun 2014 01:33:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1401586417!7391195!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16725 invoked from network); 1 Jun 2014 01:33:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueW-0001KW-OK
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqueW-0001Oq-NG
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:36 +0000
Date: Sun, 01 Jun 2014 01:33:36 +0000
Message-Id: <E1WqueW-0001Oq-NG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal.h: move / add some
	libxl defbool #define here
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a84725c201cffe714b91ace83b5dd381c879ba5b
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:51 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:30 2014 +0100

    libxl_internal.h: move / add some libxl defbool #define here
    
    They will be used by both JSON generator and parser so they should be in
    header file.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c          |   10 +++-------
 tools/libxl/libxl_internal.h |    8 ++++++++
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4ea7abb..900b8d4 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -232,10 +232,6 @@ void libxl_key_value_list_dispose(libxl_key_value_list *pkvl)
     free(kvl);
 }
 
-#define LIBXL__DEFBOOL_DEFAULT (0)
-#define LIBXL__DEFBOOL_FALSE (-1)
-#define LIBXL__DEFBOOL_TRUE (1)
-
 void libxl_defbool_set(libxl_defbool *db, bool b)
 {
     db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
@@ -266,11 +262,11 @@ bool libxl_defbool_val(libxl_defbool db)
 const char *libxl_defbool_to_string(libxl_defbool b)
 {
     if (b.val < 0)
-        return "False";
+        return LIBXL__DEFBOOL_STR_FALSE;
     else if (b.val > 0)
-        return "True";
+        return LIBXL__DEFBOOL_STR_TRUE;
     else
-        return "<default>";
+        return LIBXL__DEFBOOL_STR_DEFAULT;
 }
 
 /******************************************************************************/
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index c2b73c4..294c595 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3036,6 +3036,14 @@ void libxl__numa_candidate_put_nodemap(libxl__gc *gc,
     libxl_bitmap_copy(CTX, &cndt->nodemap, nodemap);
 }
 
+/* Som handy macros for defbool type. */
+#define LIBXL__DEFBOOL_DEFAULT     (0)
+#define LIBXL__DEFBOOL_FALSE       (-1)
+#define LIBXL__DEFBOOL_TRUE        (1)
+#define LIBXL__DEFBOOL_STR_DEFAULT "<default>"
+#define LIBXL__DEFBOOL_STR_FALSE   "False"
+#define LIBXL__DEFBOOL_STR_TRUE    "True"
+
 /*
  * Inserts "elm_new" into the sorted list "head".
  *
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01: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.xen.org>)
	id 1Wquel-0003Im-Hb; Sun, 01 Jun 2014 01:33:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquej-0003IO-I0
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:49 +0000
Received: from [85.158.143.35:10304] by server-3.bemta-4.messagelabs.com id
	60/1E-13602-CF28A835; Sun, 01 Jun 2014 01:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1401586427!8095691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26919 invoked from network); 1 Jun 2014 01:33:48 -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;
	1 Jun 2014 01:33: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 1Wqueh-0001Kc-0B
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqueg-0001PC-SH
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:46 +0000
Date: Sun, 01 Jun 2014 01:33:46 +0000
Message-Id: <E1Wqueg-0001PC-SH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal: make JSON_* types a
	bit-field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f68570ac7715ee2b338dfd8edc18b99901aebb9a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:44 2014 +0100

    libxl_internal: make JSON_* types a bit-field
    
    Libxl can generate number as type JSON_INTEGER, JSON_DOUBLE or
    JSON_NUMBER, string as type JSON_STRING or JSON_NULL (if string is
    null).
    
    So make JSON_* type a bit-field and use it in libxl__json_map_get. This is
    useful when parsing a libxl__json_object to libxl_FOO struct. We can
    enforce type checking on libxl__json_object in an easy way.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   18 +++++++++---------
 tools/libxl/libxl_json.c     |    2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 294c595..8906787 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1613,16 +1613,16 @@ _hidden yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str);
 _hidden yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str);
 
 typedef enum {
-    JSON_NULL,
-    JSON_BOOL,
-    JSON_INTEGER,
-    JSON_DOUBLE,
+    JSON_NULL    = (1 << 0),
+    JSON_BOOL    = (1 << 1),
+    JSON_INTEGER = (1 << 2),
+    JSON_DOUBLE  = (1 << 3),
     /* number is store in string, it's too big to be a long long or a double */
-    JSON_NUMBER,
-    JSON_STRING,
-    JSON_MAP,
-    JSON_ARRAY,
-    JSON_ANY
+    JSON_NUMBER  = (1 << 4),
+    JSON_STRING  = (1 << 5),
+    JSON_MAP     = (1 << 6),
+    JSON_ARRAY   = (1 << 7),
+    JSON_ANY     = 255 /* this is a mask of all values above, adjust as needed */
 } libxl__json_node_type;
 
 typedef struct libxl__json_object {
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 3ea56a4..65d4966 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -363,7 +363,7 @@ const libxl__json_object *libxl__json_map_get(const char *key,
                 return NULL;
             if (strcmp(key, node->map_key) == 0) {
                 if (expected_type == JSON_ANY
-                    || (node->obj && node->obj->type == expected_type)) {
+                    || (node->obj && (node->obj->type & expected_type))) {
                     return node->obj;
                 } else {
                     return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:33:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01: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.xen.org>)
	id 1Wquel-0003Im-Hb; Sun, 01 Jun 2014 01:33:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquej-0003IO-I0
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:49 +0000
Received: from [85.158.143.35:10304] by server-3.bemta-4.messagelabs.com id
	60/1E-13602-CF28A835; Sun, 01 Jun 2014 01:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1401586427!8095691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26919 invoked from network); 1 Jun 2014 01:33:48 -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;
	1 Jun 2014 01:33: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 1Wqueh-0001Kc-0B
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqueg-0001PC-SH
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:46 +0000
Date: Sun, 01 Jun 2014 01:33:46 +0000
Message-Id: <E1Wqueg-0001PC-SH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal: make JSON_* types a
	bit-field
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f68570ac7715ee2b338dfd8edc18b99901aebb9a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:44 2014 +0100

    libxl_internal: make JSON_* types a bit-field
    
    Libxl can generate number as type JSON_INTEGER, JSON_DOUBLE or
    JSON_NUMBER, string as type JSON_STRING or JSON_NULL (if string is
    null).
    
    So make JSON_* type a bit-field and use it in libxl__json_map_get. This is
    useful when parsing a libxl__json_object to libxl_FOO struct. We can
    enforce type checking on libxl__json_object in an easy way.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   18 +++++++++---------
 tools/libxl/libxl_json.c     |    2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 294c595..8906787 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1613,16 +1613,16 @@ _hidden yajl_gen_status libxl__yajl_gen_asciiz(yajl_gen hand, const char *str);
 _hidden yajl_gen_status libxl__yajl_gen_enum(yajl_gen hand, const char *str);
 
 typedef enum {
-    JSON_NULL,
-    JSON_BOOL,
-    JSON_INTEGER,
-    JSON_DOUBLE,
+    JSON_NULL    = (1 << 0),
+    JSON_BOOL    = (1 << 1),
+    JSON_INTEGER = (1 << 2),
+    JSON_DOUBLE  = (1 << 3),
     /* number is store in string, it's too big to be a long long or a double */
-    JSON_NUMBER,
-    JSON_STRING,
-    JSON_MAP,
-    JSON_ARRAY,
-    JSON_ANY
+    JSON_NUMBER  = (1 << 4),
+    JSON_STRING  = (1 << 5),
+    JSON_MAP     = (1 << 6),
+    JSON_ARRAY   = (1 << 7),
+    JSON_ANY     = 255 /* this is a mask of all values above, adjust as needed */
 } libxl__json_node_type;
 
 typedef struct libxl__json_object {
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 3ea56a4..65d4966 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -363,7 +363,7 @@ const libxl__json_object *libxl__json_map_get(const char *key,
                 return NULL;
             if (strcmp(key, node->map_key) == 0) {
                 if (expected_type == JSON_ANY
-                    || (node->obj && node->obj->type == expected_type)) {
+                    || (node->obj && (node->obj->type & expected_type))) {
                     return node->obj;
                 } else {
                     return NULL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqueu-0003Kd-KI; Sun, 01 Jun 2014 01:34:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqueu-0003KO-5w
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:00 +0000
Received: from [193.109.254.147:41306] by server-8.bemta-14.messagelabs.com id
	EC/19-01877-7038A835; Sun, 01 Jun 2014 01:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1401586437!8309367!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28521 invoked from network); 1 Jun 2014 01:33:58 -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;
	1 Jun 2014 01:33:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquer-0001Kl-7s
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquer-0001PY-6Y
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:57 +0000
Date: Sun, 01 Jun 2014 01:33:57 +0000
Message-Id: <E1Wquer-0001PY-6Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal.h: introduce
	libxl__json_object_is_{null, number, double}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7dd6000671ca38e0d31f07e2d09c59e0241287c8
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:54 2014 +0100

    libxl_internal.h: introduce libxl__json_object_is_{null, number, double}
    
    ... which return true if json object is valid and of type
    JSON_{NULL,NUMBER,DOUBLE}.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 8906787..325d340 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1647,6 +1647,10 @@ typedef struct {
 
 typedef struct libxl__yajl_ctx libxl__yajl_ctx;
 
+static inline bool libxl__json_object_is_null(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_NULL;
+}
 static inline bool libxl__json_object_is_bool(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_BOOL;
@@ -1659,6 +1663,14 @@ static inline bool libxl__json_object_is_integer(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_INTEGER;
 }
+static inline bool libxl__json_object_is_double(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_DOUBLE;
+}
+static inline bool libxl__json_object_is_number(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_NUMBER;
+}
 static inline bool libxl__json_object_is_map(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_MAP;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqueu-0003Kd-KI; Sun, 01 Jun 2014 01:34:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqueu-0003KO-5w
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:00 +0000
Received: from [193.109.254.147:41306] by server-8.bemta-14.messagelabs.com id
	EC/19-01877-7038A835; Sun, 01 Jun 2014 01:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1401586437!8309367!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28521 invoked from network); 1 Jun 2014 01:33:58 -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;
	1 Jun 2014 01:33:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquer-0001Kl-7s
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquer-0001PY-6Y
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:33:57 +0000
Date: Sun, 01 Jun 2014 01:33:57 +0000
Message-Id: <E1Wquer-0001PY-6Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal.h: introduce
	libxl__json_object_is_{null, number, double}
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7dd6000671ca38e0d31f07e2d09c59e0241287c8
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:00:54 2014 +0100

    libxl_internal.h: introduce libxl__json_object_is_{null, number, double}
    
    ... which return true if json object is valid and of type
    JSON_{NULL,NUMBER,DOUBLE}.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 8906787..325d340 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1647,6 +1647,10 @@ typedef struct {
 
 typedef struct libxl__yajl_ctx libxl__yajl_ctx;
 
+static inline bool libxl__json_object_is_null(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_NULL;
+}
 static inline bool libxl__json_object_is_bool(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_BOOL;
@@ -1659,6 +1663,14 @@ static inline bool libxl__json_object_is_integer(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_INTEGER;
 }
+static inline bool libxl__json_object_is_double(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_DOUBLE;
+}
+static inline bool libxl__json_object_is_number(const libxl__json_object *o)
+{
+    return o != NULL && o->type == JSON_NUMBER;
+}
 static inline bool libxl__json_object_is_map(const libxl__json_object *o)
 {
     return o != NULL && o->type == JSON_MAP;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquf4-0003MV-Na; Sun, 01 Jun 2014 01:34:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquf4-0003MD-23
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:10 +0000
Received: from [85.158.137.68:59345] by server-7.bemta-3.messagelabs.com id
	B3/FB-04151-1138A835; Sun, 01 Jun 2014 01:34:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1401586447!7269793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31598 invoked from network); 1 Jun 2014 01:34:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:34:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquf1-0001LK-Ea
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquf1-0001QD-C6
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:07 +0000
Date: Sun, 01 Jun 2014 01:34:07 +0000
Message-Id: <E1Wquf1-0001QD-C6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal.h: introduce
	libxl__json_object_get_number
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d638671fa44f8c1c55205a127d3224e8cf39a549
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:01:00 2014 +0100

    libxl_internal.h: introduce libxl__json_object_get_number
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 325d340..5974f00 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1696,6 +1696,14 @@ const char *libxl__json_object_get_string(const libxl__json_object *o)
         return NULL;
 }
 static inline
+const char *libxl__json_object_get_number(const libxl__json_object *o)
+{
+    if (libxl__json_object_is_number(o))
+        return o->u.string;
+    else
+        return NULL;
+}
+static inline
 flexarray_t *libxl__json_object_get_map(const libxl__json_object *o)
 {
     if (libxl__json_object_is_map(o))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquf4-0003MV-Na; Sun, 01 Jun 2014 01:34:10 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquf4-0003MD-23
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:10 +0000
Received: from [85.158.137.68:59345] by server-7.bemta-3.messagelabs.com id
	B3/FB-04151-1138A835; Sun, 01 Jun 2014 01:34:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1401586447!7269793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31598 invoked from network); 1 Jun 2014 01:34:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:34:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquf1-0001LK-Ea
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquf1-0001QD-C6
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:07 +0000
Date: Sun, 01 Jun 2014 01:34:07 +0000
Message-Id: <E1Wquf1-0001QD-C6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_internal.h: introduce
	libxl__json_object_get_number
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d638671fa44f8c1c55205a127d3224e8cf39a549
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:01:00 2014 +0100

    libxl_internal.h: introduce libxl__json_object_get_number
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 325d340..5974f00 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1696,6 +1696,14 @@ const char *libxl__json_object_get_string(const libxl__json_object *o)
         return NULL;
 }
 static inline
+const char *libxl__json_object_get_number(const libxl__json_object *o)
+{
+    if (libxl__json_object_is_number(o))
+        return o->u.string;
+    else
+        return NULL;
+}
+static inline
 flexarray_t *libxl__json_object_get_map(const libxl__json_object *o)
 {
     if (libxl__json_object_is_map(o))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqufF-0003OI-Qj; Sun, 01 Jun 2014 01:34:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufE-0003O2-D1
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:20 +0000
Received: from [193.109.254.147:45671] by server-8.bemta-14.messagelabs.com id
	88/29-01877-B138A835; Sun, 01 Jun 2014 01:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586457!8293217!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27826 invoked from network); 1 Jun 2014 01:34: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;
	1 Jun 2014 01:34:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufB-0001LQ-L0
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufB-0001Rb-Jd
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:17 +0000
Date: Sun, 01 Jun 2014 01:34:17 +0000
Message-Id: <E1WqufB-0001Rb-Jd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_json: allow basic JSON type
	objects generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f7752978189640fb4725922e901233065d5a3d7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:01:13 2014 +0100

    libxl_json: allow basic JSON type objects generation
    
    The original logic is that basic JSON types (number, string and null)
    must be an element of JSON map or array. This assumption doesn't hold
    true anymore when we need to return basic JSON types.
    
    Returning basic JSON types is required for parsing number, string and
    null objects back into libxl__json_object.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    2 +-
 tools/libxl/libxl_json.c     |   87 ++++++++++++++++++------------------------
 2 files changed, 38 insertions(+), 51 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5974f00..082749e 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1735,7 +1735,7 @@ _hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
                                                      libxl__json_node_type type);
 _hidden int libxl__json_object_append_to(libxl__gc *gc_opt,
                                          libxl__json_object *obj,
-                                         libxl__json_object *dst);
+                                         libxl__yajl_ctx *ctx);
 _hidden libxl__json_object *libxl__json_array_get(const libxl__json_object *o,
                                                   int i);
 _hidden
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 65d4966..ab964ab 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -234,36 +234,43 @@ libxl__json_object *libxl__json_object_alloc(libxl__gc *gc,
     return obj;
 }
 
-int libxl__json_object_append_to(libxl__gc *gc,
-                                 libxl__json_object *obj,
-                                 libxl__json_object *dst)
+int libxl__json_object_append_to(libxl__gc *gc, libxl__json_object *obj,
+                                 libxl__yajl_ctx *ctx)
 {
-    assert(dst != NULL);
+    libxl__json_object *dst = ctx->current;
 
-    switch (dst->type) {
-    case JSON_MAP: {
-        libxl__json_map_node *last;
+    if (dst) {
+        switch (dst->type) {
+        case JSON_MAP: {
+            libxl__json_map_node *last;
 
-        if (dst->u.map->count == 0) {
+            if (dst->u.map->count == 0) {
+                LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
+                           "Try to add a value to an empty map (with no key)");
+                return ERROR_FAIL;
+            }
+            flexarray_get(dst->u.map, dst->u.map->count - 1, (void**)&last);
+            last->obj = obj;
+            break;
+        }
+        case JSON_ARRAY:
+            flexarray_append(dst->u.array, obj);
+            break;
+        default:
             LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                       "Try to add a value to an empty map (with no key)");
-            return -1;
+                       "Try append an object is not a map/array (%i)\n",
+                       dst->type);
+            return ERROR_FAIL;
         }
-        flexarray_get(dst->u.map, dst->u.map->count - 1, (void**)&last);
-        last->obj = obj;
-        break;
-    }
-    case JSON_ARRAY:
-        flexarray_append(dst->u.array, obj);
-        break;
-    default:
-        LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                   "Try append an object is not a map/array (%i)\n",
-                   dst->type);
-        return -1;
     }
 
     obj->parent = dst;
+
+    if (libxl__json_object_is_map(obj) || libxl__json_object_is_array(obj))
+        ctx->current = obj;
+    if (ctx->head == NULL)
+        ctx->head = obj;
+
     return 0;
 }
 
@@ -449,9 +456,8 @@ static int json_callback_null(void *opaque)
 
     obj = libxl__json_object_alloc(ctx->gc, JSON_NULL);
 
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -466,9 +472,8 @@ static int json_callback_boolean(void *opaque, int boolean)
     obj = libxl__json_object_alloc(ctx->gc, JSON_BOOL);
     obj->u.b = boolean;
 
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -523,9 +528,8 @@ error:
     obj->u.string = t;
 
 out:
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -547,9 +551,8 @@ static int json_callback_string(void *opaque, const unsigned char *str,
     obj = libxl__json_object_alloc(ctx->gc, JSON_STRING);
     obj->u.string = t;
 
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -595,16 +598,8 @@ static int json_callback_start_map(void *opaque)
 
     obj = libxl__json_object_alloc(ctx->gc, JSON_MAP);
 
-    if (ctx->current) {
-        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            return 0;
-        }
-    }
-
-    ctx->current = obj;
-    if (ctx->head == NULL) {
-        ctx->head = obj;
-    }
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
+        return 0;
 
     return 1;
 }
@@ -635,16 +630,8 @@ static int json_callback_start_array(void *opaque)
 
     obj = libxl__json_object_alloc(ctx->gc, JSON_ARRAY);
 
-    if (ctx->current) {
-        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            return 0;
-        }
-    }
-
-    ctx->current = obj;
-    if (ctx->head == NULL) {
-        ctx->head = obj;
-    }
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
+        return 0;
 
     return 1;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqufF-0003OI-Qj; Sun, 01 Jun 2014 01:34:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufE-0003O2-D1
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:20 +0000
Received: from [193.109.254.147:45671] by server-8.bemta-14.messagelabs.com id
	88/29-01877-B138A835; Sun, 01 Jun 2014 01:34:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586457!8293217!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27826 invoked from network); 1 Jun 2014 01:34: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;
	1 Jun 2014 01:34:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufB-0001LQ-L0
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufB-0001Rb-Jd
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:17 +0000
Date: Sun, 01 Jun 2014 01:34:17 +0000
Message-Id: <E1WqufB-0001Rb-Jd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_json: allow basic JSON type
	objects generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1f7752978189640fb4725922e901233065d5a3d7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue May 13 22:53:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 11:01:13 2014 +0100

    libxl_json: allow basic JSON type objects generation
    
    The original logic is that basic JSON types (number, string and null)
    must be an element of JSON map or array. This assumption doesn't hold
    true anymore when we need to return basic JSON types.
    
    Returning basic JSON types is required for parsing number, string and
    null objects back into libxl__json_object.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    2 +-
 tools/libxl/libxl_json.c     |   87 ++++++++++++++++++------------------------
 2 files changed, 38 insertions(+), 51 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5974f00..082749e 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1735,7 +1735,7 @@ _hidden libxl__json_object *libxl__json_object_alloc(libxl__gc *gc_opt,
                                                      libxl__json_node_type type);
 _hidden int libxl__json_object_append_to(libxl__gc *gc_opt,
                                          libxl__json_object *obj,
-                                         libxl__json_object *dst);
+                                         libxl__yajl_ctx *ctx);
 _hidden libxl__json_object *libxl__json_array_get(const libxl__json_object *o,
                                                   int i);
 _hidden
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 65d4966..ab964ab 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -234,36 +234,43 @@ libxl__json_object *libxl__json_object_alloc(libxl__gc *gc,
     return obj;
 }
 
-int libxl__json_object_append_to(libxl__gc *gc,
-                                 libxl__json_object *obj,
-                                 libxl__json_object *dst)
+int libxl__json_object_append_to(libxl__gc *gc, libxl__json_object *obj,
+                                 libxl__yajl_ctx *ctx)
 {
-    assert(dst != NULL);
+    libxl__json_object *dst = ctx->current;
 
-    switch (dst->type) {
-    case JSON_MAP: {
-        libxl__json_map_node *last;
+    if (dst) {
+        switch (dst->type) {
+        case JSON_MAP: {
+            libxl__json_map_node *last;
 
-        if (dst->u.map->count == 0) {
+            if (dst->u.map->count == 0) {
+                LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
+                           "Try to add a value to an empty map (with no key)");
+                return ERROR_FAIL;
+            }
+            flexarray_get(dst->u.map, dst->u.map->count - 1, (void**)&last);
+            last->obj = obj;
+            break;
+        }
+        case JSON_ARRAY:
+            flexarray_append(dst->u.array, obj);
+            break;
+        default:
             LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                       "Try to add a value to an empty map (with no key)");
-            return -1;
+                       "Try append an object is not a map/array (%i)\n",
+                       dst->type);
+            return ERROR_FAIL;
         }
-        flexarray_get(dst->u.map, dst->u.map->count - 1, (void**)&last);
-        last->obj = obj;
-        break;
-    }
-    case JSON_ARRAY:
-        flexarray_append(dst->u.array, obj);
-        break;
-    default:
-        LIBXL__LOG(libxl__gc_owner(gc), LIBXL__LOG_ERROR,
-                   "Try append an object is not a map/array (%i)\n",
-                   dst->type);
-        return -1;
     }
 
     obj->parent = dst;
+
+    if (libxl__json_object_is_map(obj) || libxl__json_object_is_array(obj))
+        ctx->current = obj;
+    if (ctx->head == NULL)
+        ctx->head = obj;
+
     return 0;
 }
 
@@ -449,9 +456,8 @@ static int json_callback_null(void *opaque)
 
     obj = libxl__json_object_alloc(ctx->gc, JSON_NULL);
 
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -466,9 +472,8 @@ static int json_callback_boolean(void *opaque, int boolean)
     obj = libxl__json_object_alloc(ctx->gc, JSON_BOOL);
     obj->u.b = boolean;
 
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -523,9 +528,8 @@ error:
     obj->u.string = t;
 
 out:
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -547,9 +551,8 @@ static int json_callback_string(void *opaque, const unsigned char *str,
     obj = libxl__json_object_alloc(ctx->gc, JSON_STRING);
     obj->u.string = t;
 
-    if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
         return 0;
-    }
 
     return 1;
 }
@@ -595,16 +598,8 @@ static int json_callback_start_map(void *opaque)
 
     obj = libxl__json_object_alloc(ctx->gc, JSON_MAP);
 
-    if (ctx->current) {
-        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            return 0;
-        }
-    }
-
-    ctx->current = obj;
-    if (ctx->head == NULL) {
-        ctx->head = obj;
-    }
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
+        return 0;
 
     return 1;
 }
@@ -635,16 +630,8 @@ static int json_callback_start_array(void *opaque)
 
     obj = libxl__json_object_alloc(ctx->gc, JSON_ARRAY);
 
-    if (ctx->current) {
-        if (libxl__json_object_append_to(ctx->gc, obj, ctx->current) == -1) {
-            return 0;
-        }
-    }
-
-    ctx->current = obj;
-    if (ctx->head == NULL) {
-        ctx->head = obj;
-    }
+    if (libxl__json_object_append_to(ctx->gc, obj, ctx))
+        return 0;
 
     return 1;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:33 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqufQ-0003QJ-VI; Sun, 01 Jun 2014 01:34:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufP-0003Q2-CJ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:31 +0000
Received: from [85.158.137.68:25282] by server-1.bemta-3.messagelabs.com id
	05/F0-11134-6238A835; Sun, 01 Jun 2014 01:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1401586468!7238350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25559 invoked from network); 1 Jun 2014 01:34:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:34:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufL-0001LY-QB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufL-0001SF-P9
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:27 +0000
Date: Sun, 01 Jun 2014 01:34:27 +0000
Message-Id: <E1WqufL-0001SF-P9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: Store IRQ type in
	arch_irq_desc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8aaf906b8a0545fbedac5bf8bd0588d9e763f340
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:27 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:47:53 2014 +0100

    xen/arm: IRQ: Store IRQ type in arch_irq_desc
    
    For now, ARM uses different IRQ functions to setup an interrupt handler. This
    is a bit annoying for common driver because we have to add idefery when
    an IRQ is setup (see ns16550_init_postirq for an example).
    
    To avoid to completely fork the IRQ management code, we can introduce a field
    to store the IRQ type (e.g level/edge ...).
    
    This patch also adds platform_get_irq which will retrieve the IRQ from the
    device tree and setup correctly the IRQ type.
    
    In order to use this solution, we have to move init_IRQ earlier for the boot
    CPU. It's fine because the code only depends on percpu.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c            |   25 +++++---
 xen/arch/arm/irq.c            |  125 ++++++++++++++++++++++++++++++++++++++--
 xen/arch/arm/setup.c          |    3 +-
 xen/include/asm-arm/gic.h     |    5 +-
 xen/include/asm-arm/irq.h     |    6 ++
 xen/include/xen/device_tree.h |    3 +
 6 files changed, 146 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 577d85b..13eeb33 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -216,14 +216,21 @@ static hw_irq_controller gic_guest_irq_type = {
 /*
  * - needs to be called with a valid cpu_mask, ie each cpu in the mask has
  * already called gic_cpu_init
+ * - desc.lock must be held
+ * - arch.type must be valid (i.e != DT_IRQ_TYPE_INVALID)
  */
-static void gic_set_irq_properties(unsigned int irq, bool_t level,
+static void gic_set_irq_properties(struct irq_desc *desc,
                                    const cpumask_t *cpu_mask,
                                    unsigned int priority)
 {
     volatile unsigned char *bytereg;
     uint32_t cfg, edgebit;
     unsigned int mask;
+    unsigned int irq = desc->irq;
+    unsigned int type = desc->arch.type;
+
+    ASSERT(type != DT_IRQ_TYPE_INVALID);
+    ASSERT(spin_is_locked(&desc->lock));
 
     spin_lock(&gic.lock);
 
@@ -232,9 +239,9 @@ static void gic_set_irq_properties(unsigned int irq, bool_t level,
     /* Set edge / level */
     cfg = GICD[GICD_ICFGR + irq / 16];
     edgebit = 2u << (2 * (irq % 16));
-    if ( level )
+    if ( type & DT_IRQ_TYPE_LEVEL_MASK )
         cfg &= ~edgebit;
-    else
+    else if ( type & DT_IRQ_TYPE_EDGE_BOTH )
         cfg |= edgebit;
     GICD[GICD_ICFGR + irq / 16] = cfg;
 
@@ -252,8 +259,8 @@ static void gic_set_irq_properties(unsigned int irq, bool_t level,
 /* Program the GIC to route an interrupt to the host (i.e. Xen)
  * - needs to be called with desc.lock held
  */
-void gic_route_irq_to_xen(struct irq_desc *desc, bool_t level,
-                          const cpumask_t *cpu_mask, unsigned int priority)
+void gic_route_irq_to_xen(struct irq_desc *desc, const cpumask_t *cpu_mask,
+                          unsigned int priority)
 {
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
     ASSERT(desc->irq < gic.lines);/* Can't route interrupts that don't exist */
@@ -262,15 +269,14 @@ void gic_route_irq_to_xen(struct irq_desc *desc, bool_t level,
 
     desc->handler = &gic_host_irq_type;
 
-    gic_set_irq_properties(desc->irq, level, cpu_mask, priority);
+    gic_set_irq_properties(desc, cpu_mask, priority);
 }
 
 /* Program the GIC to route an interrupt to a guest
  *   - desc.lock must be held
  */
 void gic_route_irq_to_guest(struct domain *d, struct irq_desc *desc,
-                            bool_t level, const cpumask_t *cpu_mask,
-                            unsigned int priority)
+                            const cpumask_t *cpu_mask, unsigned int priority)
 {
     struct pending_irq *p;
     ASSERT(spin_is_locked(&desc->lock));
@@ -278,8 +284,7 @@ void gic_route_irq_to_guest(struct domain *d, struct irq_desc *desc,
     desc->handler = &gic_guest_irq_type;
     desc->status |= IRQ_GUEST;
 
-    gic_set_irq_properties(desc->irq, level, cpumask_of(smp_processor_id()),
-                           GIC_PRI_IRQ);
+    gic_set_irq_properties(desc, cpumask_of(smp_processor_id()), GIC_PRI_IRQ);
 
     /* TODO: do not assume delivery to vcpu0 */
     p = irq_to_pending(d->vcpu[0], desc->irq);
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 44696e7..832ee90 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -27,6 +27,9 @@
 
 #include <asm/gic.h>
 
+static unsigned int local_irqs_type[NR_LOCAL_IRQS];
+static DEFINE_SPINLOCK(local_irqs_type_lock);
+
 static void ack_none(struct irq_desc *irq)
 {
     printk("unexpected IRQ trap at irq %02x\n", irq->irq);
@@ -55,6 +58,7 @@ irq_desc_t *__irq_to_desc(int irq)
 
 int __init arch_init_one_irq_desc(struct irq_desc *desc)
 {
+    desc->arch.type = DT_IRQ_TYPE_INVALID;
     return 0;
 }
 
@@ -77,18 +81,37 @@ static int __cpuinit init_local_irq_data(void)
 {
     int irq;
 
+    spin_lock(&local_irqs_type_lock);
+
     for (irq = 0; irq < NR_LOCAL_IRQS; irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         init_one_irq_desc(desc);
         desc->irq = irq;
         desc->action  = NULL;
+
+        /* PPIs are included in local_irqs, we copy the IRQ type from
+         * local_irqs_type when bringing up local IRQ for this CPU in
+         * order to pick up any configuration done before this CPU came
+         * up. For interrupts configured after this point this is done in
+         * irq_set_type.
+         */
+        desc->arch.type = local_irqs_type[irq];
     }
 
+    spin_unlock(&local_irqs_type_lock);
+
     return 0;
 }
 
 void __init init_IRQ(void)
 {
+    int irq;
+
+    spin_lock(&local_irqs_type_lock);
+    for ( irq = 0; irq < NR_LOCAL_IRQS; irq++ )
+        local_irqs_type[irq] = DT_IRQ_TYPE_INVALID;
+    spin_unlock(&local_irqs_type_lock);
+
     BUG_ON(init_local_irq_data() < 0);
     BUG_ON(init_irq_data() < 0);
 }
@@ -275,9 +298,6 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
     /* First time the IRQ is setup */
     if ( disabled )
     {
-        bool_t level;
-
-        level = dt_irq_is_level_triggered(irq);
         /* It's fine to use smp_processor_id() because:
          * For PPI: irq_desc is banked
          * For SPI: we don't care for now which CPU will receive the
@@ -285,7 +305,8 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
          * TODO: Handle case where SPI is setup on different CPU than
          * the targeted CPU and the priority.
          */
-        gic_route_irq_to_xen(desc, level, cpumask_of(smp_processor_id()),
+        desc->arch.type = irq->type;
+        gic_route_irq_to_xen(desc, cpumask_of(smp_processor_id()),
                              GIC_PRI_IRQ);
         desc->handler->startup(desc);
     }
@@ -303,7 +324,6 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     struct irq_desc *desc = irq_to_desc(irq->irq);
     unsigned long flags;
     int retval = 0;
-    bool_t level;
 
     action = xmalloc(struct irqaction);
     if (!action)
@@ -341,8 +361,8 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     if ( retval )
         goto out;
 
-    level = dt_irq_is_level_triggered(irq);
-    gic_route_irq_to_guest(d, desc, level, cpumask_of(smp_processor_id()),
+    desc->arch.type = irq->type;
+    gic_route_irq_to_guest(d, desc, cpumask_of(smp_processor_id()),
                            GIC_PRI_IRQ);
     spin_unlock_irqrestore(&desc->lock, flags);
     return 0;
@@ -383,6 +403,97 @@ void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
     BUG();
 }
 
+static bool_t irq_validate_new_type(unsigned int curr, unsigned new)
+{
+    return (curr == DT_IRQ_TYPE_INVALID || curr == new );
+}
+
+int irq_set_spi_type(unsigned int spi, unsigned int type)
+{
+    unsigned long flags;
+    struct irq_desc *desc = irq_to_desc(spi);
+    int ret = -EBUSY;
+
+    /* This function should not be used for other than SPIs */
+    if ( spi < NR_LOCAL_IRQS )
+        return -EINVAL;
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    if ( !irq_validate_new_type(desc->arch.type, type) )
+        goto err;
+
+    desc->arch.type = type;
+
+    ret = 0;
+
+err:
+    spin_unlock_irqrestore(&desc->lock, flags);
+    return ret;
+}
+
+static int irq_local_set_type(unsigned int irq, unsigned int type)
+{
+    unsigned int cpu;
+    unsigned int old_type;
+    unsigned long flags;
+    int ret = -EBUSY;
+    struct irq_desc *desc;
+
+    ASSERT(irq < NR_LOCAL_IRQS);
+
+    spin_lock(&local_irqs_type_lock);
+
+    old_type = local_irqs_type[irq];
+
+    if ( !irq_validate_new_type(old_type, type) )
+        goto unlock;
+
+    ret = 0;
+    /* We don't need to reconfigure if the type is correctly set */
+    if ( old_type == type )
+        goto unlock;
+
+    local_irqs_type[irq] = type;
+
+    for_each_cpu( cpu, &cpu_online_map )
+    {
+        desc = &per_cpu(local_irq_desc, cpu)[irq];
+        spin_lock_irqsave(&desc->lock, flags);
+        desc->arch.type = type;
+        spin_unlock_irqrestore(&desc->lock, flags);
+    }
+
+unlock:
+    spin_unlock(&local_irqs_type_lock);
+    return ret;
+}
+
+int platform_get_irq(const struct dt_device_node *device, int index)
+{
+    struct dt_irq dt_irq;
+    unsigned int type, irq;
+    int res;
+
+    res = dt_device_get_irq(device, index, &dt_irq);
+    if ( res )
+        return -1;
+
+    irq = dt_irq.irq;
+    type = dt_irq.type;
+
+    /* Setup the IRQ type */
+    if ( irq < NR_LOCAL_IRQS )
+        res = irq_local_set_type(irq, type);
+    else
+        res = irq_set_spi_type(irq, type);
+
+    if ( res )
+            return -1;
+
+    return irq;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index c983d95..b9ce7a9 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -688,6 +688,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     dt_unflatten_host_device_tree();
     dt_irq_xlate = gic_irq_xlate;
 
+    init_IRQ();
+
     dt_uart_init();
     console_init_preirq();
 
@@ -717,7 +719,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     tasklet_subsys_init();
 
-    init_IRQ();
 
     xsm_dt_init();
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index b750b17..80f8dd2 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -168,11 +168,10 @@ extern void vgic_clear_pending_irqs(struct vcpu *v);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
 /* Program the GIC to route an interrupt */
-extern void gic_route_irq_to_xen(struct irq_desc *desc, bool_t level,
-                                 const cpumask_t *cpu_mask,
+extern void gic_route_irq_to_xen(struct irq_desc *desc, const cpumask_t *cpu_mask,
                                  unsigned int priority);
 extern void gic_route_irq_to_guest(struct domain *, struct irq_desc *desc,
-                                   bool_t level, const cpumask_t *cpu_mask,
+                                   const cpumask_t *cpu_mask,
                                    unsigned int priority);
 
 extern void gic_inject(void);
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index b52c26f..a7a796d 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -16,6 +16,7 @@ struct arch_pirq
 
 struct arch_irq_desc {
     int eoi_cpu;
+    unsigned int type;
 };
 
 #define NR_LOCAL_IRQS	32
@@ -47,6 +48,11 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
 int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
                           const char *devname);
 
+/* Set IRQ type for an SPI */
+int irq_set_spi_type(unsigned int spi, unsigned int type);
+
+int platform_get_irq(const struct dt_device_node *device, int index);
+
 #endif /* _ASM_HW_IRQ_H */
 /*
  * Local variables:
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index a169f0d..25db076 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -135,6 +135,7 @@ struct dt_phandle_args {
  * DT_IRQ_TYPE_LEVEL_LOW       - low level triggered
  * DT_IRQ_TYPE_LEVEL_MASK      - Mask to filter out the level bits
  * DT_IRQ_TYPE_SENSE_MASK      - Mask for all the above bits
+ * DT_IRQ_TYPE_INVALID         - Use to initialize the type
  */
 #define DT_IRQ_TYPE_NONE           0x00000000
 #define DT_IRQ_TYPE_EDGE_RISING    0x00000001
@@ -147,6 +148,8 @@ struct dt_phandle_args {
     (DT_IRQ_TYPE_LEVEL_LOW | DT_IRQ_TYPE_LEVEL_HIGH)
 #define DT_IRQ_TYPE_SENSE_MASK     0x0000000f
 
+#define DT_IRQ_TYPE_INVALID        0x00000010
+
 /**
  * dt_irq - describe an IRQ in the device tree
  * @irq: IRQ number
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:33 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqufQ-0003QJ-VI; Sun, 01 Jun 2014 01:34:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufP-0003Q2-CJ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:31 +0000
Received: from [85.158.137.68:25282] by server-1.bemta-3.messagelabs.com id
	05/F0-11134-6238A835; Sun, 01 Jun 2014 01:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1401586468!7238350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25559 invoked from network); 1 Jun 2014 01:34:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:34:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufL-0001LY-QB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufL-0001SF-P9
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:27 +0000
Date: Sun, 01 Jun 2014 01:34:27 +0000
Message-Id: <E1WqufL-0001SF-P9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: Store IRQ type in
	arch_irq_desc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8aaf906b8a0545fbedac5bf8bd0588d9e763f340
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:27 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:47:53 2014 +0100

    xen/arm: IRQ: Store IRQ type in arch_irq_desc
    
    For now, ARM uses different IRQ functions to setup an interrupt handler. This
    is a bit annoying for common driver because we have to add idefery when
    an IRQ is setup (see ns16550_init_postirq for an example).
    
    To avoid to completely fork the IRQ management code, we can introduce a field
    to store the IRQ type (e.g level/edge ...).
    
    This patch also adds platform_get_irq which will retrieve the IRQ from the
    device tree and setup correctly the IRQ type.
    
    In order to use this solution, we have to move init_IRQ earlier for the boot
    CPU. It's fine because the code only depends on percpu.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c            |   25 +++++---
 xen/arch/arm/irq.c            |  125 ++++++++++++++++++++++++++++++++++++++--
 xen/arch/arm/setup.c          |    3 +-
 xen/include/asm-arm/gic.h     |    5 +-
 xen/include/asm-arm/irq.h     |    6 ++
 xen/include/xen/device_tree.h |    3 +
 6 files changed, 146 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 577d85b..13eeb33 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -216,14 +216,21 @@ static hw_irq_controller gic_guest_irq_type = {
 /*
  * - needs to be called with a valid cpu_mask, ie each cpu in the mask has
  * already called gic_cpu_init
+ * - desc.lock must be held
+ * - arch.type must be valid (i.e != DT_IRQ_TYPE_INVALID)
  */
-static void gic_set_irq_properties(unsigned int irq, bool_t level,
+static void gic_set_irq_properties(struct irq_desc *desc,
                                    const cpumask_t *cpu_mask,
                                    unsigned int priority)
 {
     volatile unsigned char *bytereg;
     uint32_t cfg, edgebit;
     unsigned int mask;
+    unsigned int irq = desc->irq;
+    unsigned int type = desc->arch.type;
+
+    ASSERT(type != DT_IRQ_TYPE_INVALID);
+    ASSERT(spin_is_locked(&desc->lock));
 
     spin_lock(&gic.lock);
 
@@ -232,9 +239,9 @@ static void gic_set_irq_properties(unsigned int irq, bool_t level,
     /* Set edge / level */
     cfg = GICD[GICD_ICFGR + irq / 16];
     edgebit = 2u << (2 * (irq % 16));
-    if ( level )
+    if ( type & DT_IRQ_TYPE_LEVEL_MASK )
         cfg &= ~edgebit;
-    else
+    else if ( type & DT_IRQ_TYPE_EDGE_BOTH )
         cfg |= edgebit;
     GICD[GICD_ICFGR + irq / 16] = cfg;
 
@@ -252,8 +259,8 @@ static void gic_set_irq_properties(unsigned int irq, bool_t level,
 /* Program the GIC to route an interrupt to the host (i.e. Xen)
  * - needs to be called with desc.lock held
  */
-void gic_route_irq_to_xen(struct irq_desc *desc, bool_t level,
-                          const cpumask_t *cpu_mask, unsigned int priority)
+void gic_route_irq_to_xen(struct irq_desc *desc, const cpumask_t *cpu_mask,
+                          unsigned int priority)
 {
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
     ASSERT(desc->irq < gic.lines);/* Can't route interrupts that don't exist */
@@ -262,15 +269,14 @@ void gic_route_irq_to_xen(struct irq_desc *desc, bool_t level,
 
     desc->handler = &gic_host_irq_type;
 
-    gic_set_irq_properties(desc->irq, level, cpu_mask, priority);
+    gic_set_irq_properties(desc, cpu_mask, priority);
 }
 
 /* Program the GIC to route an interrupt to a guest
  *   - desc.lock must be held
  */
 void gic_route_irq_to_guest(struct domain *d, struct irq_desc *desc,
-                            bool_t level, const cpumask_t *cpu_mask,
-                            unsigned int priority)
+                            const cpumask_t *cpu_mask, unsigned int priority)
 {
     struct pending_irq *p;
     ASSERT(spin_is_locked(&desc->lock));
@@ -278,8 +284,7 @@ void gic_route_irq_to_guest(struct domain *d, struct irq_desc *desc,
     desc->handler = &gic_guest_irq_type;
     desc->status |= IRQ_GUEST;
 
-    gic_set_irq_properties(desc->irq, level, cpumask_of(smp_processor_id()),
-                           GIC_PRI_IRQ);
+    gic_set_irq_properties(desc, cpumask_of(smp_processor_id()), GIC_PRI_IRQ);
 
     /* TODO: do not assume delivery to vcpu0 */
     p = irq_to_pending(d->vcpu[0], desc->irq);
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 44696e7..832ee90 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -27,6 +27,9 @@
 
 #include <asm/gic.h>
 
+static unsigned int local_irqs_type[NR_LOCAL_IRQS];
+static DEFINE_SPINLOCK(local_irqs_type_lock);
+
 static void ack_none(struct irq_desc *irq)
 {
     printk("unexpected IRQ trap at irq %02x\n", irq->irq);
@@ -55,6 +58,7 @@ irq_desc_t *__irq_to_desc(int irq)
 
 int __init arch_init_one_irq_desc(struct irq_desc *desc)
 {
+    desc->arch.type = DT_IRQ_TYPE_INVALID;
     return 0;
 }
 
@@ -77,18 +81,37 @@ static int __cpuinit init_local_irq_data(void)
 {
     int irq;
 
+    spin_lock(&local_irqs_type_lock);
+
     for (irq = 0; irq < NR_LOCAL_IRQS; irq++) {
         struct irq_desc *desc = irq_to_desc(irq);
         init_one_irq_desc(desc);
         desc->irq = irq;
         desc->action  = NULL;
+
+        /* PPIs are included in local_irqs, we copy the IRQ type from
+         * local_irqs_type when bringing up local IRQ for this CPU in
+         * order to pick up any configuration done before this CPU came
+         * up. For interrupts configured after this point this is done in
+         * irq_set_type.
+         */
+        desc->arch.type = local_irqs_type[irq];
     }
 
+    spin_unlock(&local_irqs_type_lock);
+
     return 0;
 }
 
 void __init init_IRQ(void)
 {
+    int irq;
+
+    spin_lock(&local_irqs_type_lock);
+    for ( irq = 0; irq < NR_LOCAL_IRQS; irq++ )
+        local_irqs_type[irq] = DT_IRQ_TYPE_INVALID;
+    spin_unlock(&local_irqs_type_lock);
+
     BUG_ON(init_local_irq_data() < 0);
     BUG_ON(init_irq_data() < 0);
 }
@@ -275,9 +298,6 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
     /* First time the IRQ is setup */
     if ( disabled )
     {
-        bool_t level;
-
-        level = dt_irq_is_level_triggered(irq);
         /* It's fine to use smp_processor_id() because:
          * For PPI: irq_desc is banked
          * For SPI: we don't care for now which CPU will receive the
@@ -285,7 +305,8 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
          * TODO: Handle case where SPI is setup on different CPU than
          * the targeted CPU and the priority.
          */
-        gic_route_irq_to_xen(desc, level, cpumask_of(smp_processor_id()),
+        desc->arch.type = irq->type;
+        gic_route_irq_to_xen(desc, cpumask_of(smp_processor_id()),
                              GIC_PRI_IRQ);
         desc->handler->startup(desc);
     }
@@ -303,7 +324,6 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     struct irq_desc *desc = irq_to_desc(irq->irq);
     unsigned long flags;
     int retval = 0;
-    bool_t level;
 
     action = xmalloc(struct irqaction);
     if (!action)
@@ -341,8 +361,8 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     if ( retval )
         goto out;
 
-    level = dt_irq_is_level_triggered(irq);
-    gic_route_irq_to_guest(d, desc, level, cpumask_of(smp_processor_id()),
+    desc->arch.type = irq->type;
+    gic_route_irq_to_guest(d, desc, cpumask_of(smp_processor_id()),
                            GIC_PRI_IRQ);
     spin_unlock_irqrestore(&desc->lock, flags);
     return 0;
@@ -383,6 +403,97 @@ void pirq_set_affinity(struct domain *d, int pirq, const cpumask_t *mask)
     BUG();
 }
 
+static bool_t irq_validate_new_type(unsigned int curr, unsigned new)
+{
+    return (curr == DT_IRQ_TYPE_INVALID || curr == new );
+}
+
+int irq_set_spi_type(unsigned int spi, unsigned int type)
+{
+    unsigned long flags;
+    struct irq_desc *desc = irq_to_desc(spi);
+    int ret = -EBUSY;
+
+    /* This function should not be used for other than SPIs */
+    if ( spi < NR_LOCAL_IRQS )
+        return -EINVAL;
+
+    spin_lock_irqsave(&desc->lock, flags);
+
+    if ( !irq_validate_new_type(desc->arch.type, type) )
+        goto err;
+
+    desc->arch.type = type;
+
+    ret = 0;
+
+err:
+    spin_unlock_irqrestore(&desc->lock, flags);
+    return ret;
+}
+
+static int irq_local_set_type(unsigned int irq, unsigned int type)
+{
+    unsigned int cpu;
+    unsigned int old_type;
+    unsigned long flags;
+    int ret = -EBUSY;
+    struct irq_desc *desc;
+
+    ASSERT(irq < NR_LOCAL_IRQS);
+
+    spin_lock(&local_irqs_type_lock);
+
+    old_type = local_irqs_type[irq];
+
+    if ( !irq_validate_new_type(old_type, type) )
+        goto unlock;
+
+    ret = 0;
+    /* We don't need to reconfigure if the type is correctly set */
+    if ( old_type == type )
+        goto unlock;
+
+    local_irqs_type[irq] = type;
+
+    for_each_cpu( cpu, &cpu_online_map )
+    {
+        desc = &per_cpu(local_irq_desc, cpu)[irq];
+        spin_lock_irqsave(&desc->lock, flags);
+        desc->arch.type = type;
+        spin_unlock_irqrestore(&desc->lock, flags);
+    }
+
+unlock:
+    spin_unlock(&local_irqs_type_lock);
+    return ret;
+}
+
+int platform_get_irq(const struct dt_device_node *device, int index)
+{
+    struct dt_irq dt_irq;
+    unsigned int type, irq;
+    int res;
+
+    res = dt_device_get_irq(device, index, &dt_irq);
+    if ( res )
+        return -1;
+
+    irq = dt_irq.irq;
+    type = dt_irq.type;
+
+    /* Setup the IRQ type */
+    if ( irq < NR_LOCAL_IRQS )
+        res = irq_local_set_type(irq, type);
+    else
+        res = irq_set_spi_type(irq, type);
+
+    if ( res )
+            return -1;
+
+    return irq;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index c983d95..b9ce7a9 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -688,6 +688,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     dt_unflatten_host_device_tree();
     dt_irq_xlate = gic_irq_xlate;
 
+    init_IRQ();
+
     dt_uart_init();
     console_init_preirq();
 
@@ -717,7 +719,6 @@ void __init start_xen(unsigned long boot_phys_offset,
 
     tasklet_subsys_init();
 
-    init_IRQ();
 
     xsm_dt_init();
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index b750b17..80f8dd2 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -168,11 +168,10 @@ extern void vgic_clear_pending_irqs(struct vcpu *v);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
 /* Program the GIC to route an interrupt */
-extern void gic_route_irq_to_xen(struct irq_desc *desc, bool_t level,
-                                 const cpumask_t *cpu_mask,
+extern void gic_route_irq_to_xen(struct irq_desc *desc, const cpumask_t *cpu_mask,
                                  unsigned int priority);
 extern void gic_route_irq_to_guest(struct domain *, struct irq_desc *desc,
-                                   bool_t level, const cpumask_t *cpu_mask,
+                                   const cpumask_t *cpu_mask,
                                    unsigned int priority);
 
 extern void gic_inject(void);
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index b52c26f..a7a796d 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -16,6 +16,7 @@ struct arch_pirq
 
 struct arch_irq_desc {
     int eoi_cpu;
+    unsigned int type;
 };
 
 #define NR_LOCAL_IRQS	32
@@ -47,6 +48,11 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
 int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
                           const char *devname);
 
+/* Set IRQ type for an SPI */
+int irq_set_spi_type(unsigned int spi, unsigned int type);
+
+int platform_get_irq(const struct dt_device_node *device, int index);
+
 #endif /* _ASM_HW_IRQ_H */
 /*
  * Local variables:
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index a169f0d..25db076 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -135,6 +135,7 @@ struct dt_phandle_args {
  * DT_IRQ_TYPE_LEVEL_LOW       - low level triggered
  * DT_IRQ_TYPE_LEVEL_MASK      - Mask to filter out the level bits
  * DT_IRQ_TYPE_SENSE_MASK      - Mask for all the above bits
+ * DT_IRQ_TYPE_INVALID         - Use to initialize the type
  */
 #define DT_IRQ_TYPE_NONE           0x00000000
 #define DT_IRQ_TYPE_EDGE_RISING    0x00000001
@@ -147,6 +148,8 @@ struct dt_phandle_args {
     (DT_IRQ_TYPE_LEVEL_LOW | DT_IRQ_TYPE_LEVEL_HIGH)
 #define DT_IRQ_TYPE_SENSE_MASK     0x0000000f
 
+#define DT_IRQ_TYPE_INVALID        0x00000010
+
 /**
  * dt_irq - describe an IRQ in the device tree
  * @irq: IRQ number
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqufb-0003S1-26; Sun, 01 Jun 2014 01:34:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufZ-0003Rg-BS
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:41 +0000
Received: from [193.109.254.147:57933] by server-2.bemta-14.messagelabs.com id
	67/B6-21684-0338A835; Sun, 01 Jun 2014 01:34:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586478!8293234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28875 invoked from network); 1 Jun 2014 01:34:39 -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;
	1 Jun 2014 01:34: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 1WqufV-0001Le-Vm
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufV-0001Sx-Uh
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:37 +0000
Date: Sun, 01 Jun 2014 01:34:37 +0000
Message-Id: <E1WqufV-0001Sx-Uh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: Replace {request,
	setup}_dt_irq by {request, setup}_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 554cbe32381fa4482e1a47cd31afb054e97d986d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:28 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:01 2014 +0100

    xen/arm: IRQ: Replace {request, setup}_dt_irq by {request, setup}_irq
    
    Now that irq_desc stores the type of the IRQ (e.g level/edge,...), we don't
    need to use specific IRQ function for ARM.
    
    Also replace every call to dt_device_get_irq by platform_get_irq which is
    a wrapper to this function and setup the IRQ type correctly.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/gic.c                 |   13 +++++++------
 xen/arch/arm/irq.c                 |   23 +++++++++++------------
 xen/arch/arm/time.c                |   30 ++++++++++++++++--------------
 xen/drivers/char/exynos4210-uart.c |   15 ++++++++-------
 xen/drivers/char/ns16550.c         |   18 ++++--------------
 xen/drivers/char/omap-uart.c       |   15 ++++++++-------
 xen/drivers/char/pl011.c           |   18 ++++++++++--------
 xen/include/asm-arm/irq.h          |    5 -----
 8 files changed, 64 insertions(+), 73 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 13eeb33..b9fa73d 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -47,7 +47,7 @@ static struct {
     paddr_t hbase;       /* Address of virtual interface registers */
     paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;  /* Number of interrupts (SPIs + PPIs + SGIs) */
-    struct dt_irq maintenance; /* IRQ maintenance */
+    unsigned int maintenance_irq; /* IRQ maintenance */
     unsigned int cpus;
     spinlock_t lock;
 } gic;
@@ -433,9 +433,10 @@ void __init gic_init(void)
     if ( res || !gic.vbase || (gic.vbase & ~PAGE_MASK) )
         panic("GIC: Cannot find a valid address for the virtual CPU");
 
-    res = dt_device_get_irq(node, 0, &gic.maintenance);
-    if ( res )
+    res = platform_get_irq(node, 0);
+    if ( res < 0 )
         panic("GIC: Cannot find the maintenance IRQ");
+    gic.maintenance_irq = res;
 
     /* Set the GIC as the primary interrupt controller */
     dt_interrupt_controller = node;
@@ -449,7 +450,7 @@ void __init gic_init(void)
               "        gic_vcpu_addr=%"PRIpaddr"\n"
               "        gic_maintenance_irq=%u\n",
               gic.dbase, gic.cbase, gic.hbase, gic.vbase,
-              gic.maintenance.irq);
+              gic.maintenance_irq);
 
     if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) ||
          (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~PAGE_MASK) )
@@ -886,8 +887,8 @@ void gic_dump_info(struct vcpu *v)
 
 void __cpuinit init_maintenance_interrupt(void)
 {
-    request_dt_irq(&gic.maintenance, maintenance_interrupt,
-                   "irq-maintenance", NULL);
+    request_irq(gic.maintenance_irq, maintenance_interrupt,
+                "irq-maintenance", NULL);
 }
 
 /*
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 832ee90..0808e36 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -133,9 +133,9 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
     return desc->action->dev_id;
 }
 
-int request_dt_irq(const struct dt_irq *irq,
-                   void (*handler)(int, void *, struct cpu_user_regs *),
-                   const char *devname, void *dev_id)
+int request_irq(unsigned int irq,
+                void (*handler)(int, void *, struct cpu_user_regs *),
+                const char *devname, void *dev_id)
 {
     struct irqaction *action;
     int retval;
@@ -146,13 +146,13 @@ int request_dt_irq(const struct dt_irq *irq,
      * which interrupt is which (messes up the interrupt freeing
      * logic etc).
      */
-    if (irq->irq >= nr_irqs)
+    if ( irq >= nr_irqs )
         return -EINVAL;
-    if (!handler)
+    if ( !handler )
         return -EINVAL;
 
     action = xmalloc(struct irqaction);
-    if (!action)
+    if ( !action )
         return -ENOMEM;
 
     action->handler = handler;
@@ -160,8 +160,8 @@ int request_dt_irq(const struct dt_irq *irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_dt_irq(irq, action);
-    if (retval)
+    retval = setup_irq(irq, action);
+    if ( retval )
         xfree(action);
 
     return retval;
@@ -268,14 +268,14 @@ static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
     return 0;
 }
 
-int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
+int setup_irq(unsigned int irq, struct irqaction *new)
 {
     int rc;
     unsigned long flags;
     struct irq_desc *desc;
     bool_t disabled;
 
-    desc = irq_to_desc(irq->irq);
+    desc = irq_to_desc(irq);
 
     spin_lock_irqsave(&desc->lock, flags);
 
@@ -285,7 +285,7 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
 
         spin_unlock_irqrestore(&desc->lock, flags);
         printk(XENLOG_ERR "ERROR: IRQ %u is already in use by the domain %u\n",
-               irq->irq, d->domain_id);
+               irq, d->domain_id);
         return -EBUSY;
     }
 
@@ -305,7 +305,6 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
          * TODO: Handle case where SPI is setup on different CPU than
          * the targeted CPU and the priority.
          */
-        desc->arch.type = irq->type;
         gic_route_irq_to_xen(desc, cpumask_of(smp_processor_id()),
                              GIC_PRI_IRQ);
         desc->handler->startup(desc);
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index d04c97a..7eb480e 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -48,13 +48,13 @@ uint64_t __read_mostly boot_count;
  * register-mapped time source in the SoC. */
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 
-static struct dt_irq timer_irq[MAX_TIMER_PPI];
+static unsigned int timer_irq[MAX_TIMER_PPI];
 
 unsigned int timer_get_irq(enum timer_ppi ppi)
 {
     ASSERT(ppi >= TIMER_PHYS_SECURE_PPI && ppi < MAX_TIMER_PPI);
 
-    return timer_irq[ppi].irq;
+    return timer_irq[ppi];
 }
 
 /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks)
@@ -120,15 +120,17 @@ int __init init_xen_time(void)
     /* Retrieve all IRQs for the timer */
     for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ )
     {
-        res = dt_device_get_irq(dev, i, &timer_irq[i]);
-        if ( res )
+        res = platform_get_irq(dev, i);
+
+        if ( res < 0 )
             panic("Timer: Unable to retrieve IRQ %u from the device tree", i);
+        timer_irq[i] = res;
     }
 
     printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
-           timer_irq[TIMER_PHYS_NONSECURE_PPI].irq,
-           timer_irq[TIMER_HYP_PPI].irq,
-           timer_irq[TIMER_VIRT_PPI].irq);
+           timer_irq[TIMER_PHYS_NONSECURE_PPI],
+           timer_irq[TIMER_HYP_PPI],
+           timer_irq[TIMER_VIRT_PPI]);
 
     res = platform_init_time();
     if ( res )
@@ -192,7 +194,7 @@ int reprogram_timer(s_time_t timeout)
 /* Handle the firing timer */
 static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    if ( irq == (timer_irq[TIMER_HYP_PPI].irq) &&
+    if ( irq == (timer_irq[TIMER_HYP_PPI]) &&
          READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
@@ -201,7 +203,7 @@ static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
         WRITE_SYSREG32(0, CNTHP_CTL_EL2);
     }
 
-    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI].irq) &&
+    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI]) &&
          READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
@@ -234,12 +236,12 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt,
-                   "hyptimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
+    request_irq(timer_irq[TIMER_HYP_PPI], timer_interrupt,
+                "hyptimer", NULL);
+    request_irq(timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
                    "virtimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
-                   "phytimer", NULL);
+    request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
+                "phytimer", NULL);
 }
 
 /* Wait a set number of microseconds */
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 370539c..404ce05 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -30,7 +30,7 @@
 
 static struct exynos4210_uart {
     unsigned int baud, clock_hz, data_bits, parity, stop_bits;
-    struct dt_irq irq;
+    unsigned int irq;
     void *regs;
     struct irqaction irqaction;
     struct vuart_info vuart;
@@ -197,9 +197,9 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name    = "exynos4210_uart";
     uart->irqaction.dev_id  = port;
 
-    if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
+    if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
         dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
-                uart->irq.irq);
+                uart->irq);
 
     /* Unmask interrupts */
     exynos4210_write(uart, UINTM, ~UINTM_ALLI);
@@ -272,7 +272,7 @@ static int __init exynos4210_uart_irq(struct serial_port *port)
 {
     struct exynos4210_uart *uart = port->uart;
 
-    return uart->irq.irq;
+    return uart->irq;
 }
 
 static const struct vuart_info *exynos4210_vuart_info(struct serial_port *port)
@@ -323,12 +323,13 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev,
         return res;
     }
 
-    res = dt_device_get_irq(dev, 0, &uart->irq);
-    if ( res )
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
     {
         printk("exynos4210: Unable to retrieve the IRQ\n");
-        return res;
+        return -EINVAL;
     }
+    uart->irq = res;
 
     uart->regs = ioremap_nocache(addr, size);
     if ( !uart->regs )
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 21f086a..6691806 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -76,9 +76,6 @@ static struct ns16550 {
     u8 bar_idx;
     bool_t enable_ro; /* Make MMIO devices read only to Dom0 */
 #endif
-#ifdef HAS_DEVICE_TREE
-    struct dt_irq dt_irq;
-#endif
 } ns16550_com[2] = { { 0 } };
 
 struct ns16550_config_mmio {
@@ -612,13 +609,8 @@ static void __init ns16550_init_postirq(struct serial_port *port)
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
         uart->irqaction.dev_id  = port;
-#ifdef HAS_DEVICE_TREE
-        if ( (rc = setup_dt_irq(&uart->dt_irq, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate ns16550 DT IRQ.\n");
-#else
         if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
             printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
-#endif
     }
 
     ns16550_setup_postirq(uart);
@@ -1172,12 +1164,10 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     if ( uart->reg_width != 1 && uart->reg_width != 4 )
         return -EINVAL;
 
-    res = dt_device_get_irq(dev, 0, &uart->dt_irq);
-    if ( res )
-        return res;
-
-    /* The common bit of the driver mostly deals with irq not dt_irq. */
-    uart->irq = uart->dt_irq.irq;
+    res = platform_get_irq(dev, 0);
+    if ( ! res )
+        return -EINVAL;
+    uart->irq = res;
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
 
diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index b8da509..e598785 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -30,7 +30,7 @@
 
 static struct omap_uart {
     u32 baud, clock_hz, data_bits, parity, stop_bits, fifo_size;
-    struct dt_irq irq;
+    unsigned int irq;
     char __iomem *regs;
     struct irqaction irqaction;
     struct vuart_info vuart;
@@ -205,10 +205,10 @@ static void __init omap_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name = "omap_uart";
     uart->irqaction.dev_id = port;
 
-    if ( setup_dt_irq(&uart->irq, &uart->irqaction) != 0 )
+    if ( setup_irq(uart->irq, &uart->irqaction) != 0 )
     {
         dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n",
-                uart->irq.irq);
+                uart->irq);
         return;
     }
 
@@ -259,7 +259,7 @@ static int __init omap_uart_irq(struct serial_port *port)
 {
     struct omap_uart *uart = port->uart;
 
-    return ((uart->irq.irq > 0) ? uart->irq.irq : -1);
+    return ((uart->irq > 0) ? uart->irq : -1);
 }
 
 static const struct vuart_info *omap_vuart_info(struct serial_port *port)
@@ -317,12 +317,13 @@ static int __init omap_uart_init(struct dt_device_node *dev,
         return res;
     }
 
-    res = dt_device_get_irq(dev, 0, &uart->irq);
-    if ( res )
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
     {
         printk("omap-uart: Unable to retrieve the IRQ\n");
-        return res;
+        return -EINVAL;
     }
+    uart->irq = res;
 
     uart->regs = ioremap_nocache(addr, size);
     if ( !uart->regs )
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 459e686..89bda94 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -32,7 +32,7 @@
 
 static struct pl011 {
     unsigned int baud, clock_hz, data_bits, parity, stop_bits;
-    struct dt_irq irq;
+    unsigned int irq;
     void __iomem *regs;
     /* UART with IRQ line: interrupt-driven I/O. */
     struct irqaction irqaction;
@@ -132,13 +132,13 @@ static void __init pl011_init_postirq(struct serial_port *port)
     struct pl011 *uart = port->uart;
     int rc;
 
-    if ( uart->irq.irq > 0 )
+    if ( uart->irq > 0 )
     {
         uart->irqaction.handler = pl011_interrupt;
         uart->irqaction.name    = "pl011";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq.irq);
+        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
     }
 
     /* Clear pending error interrupts */
@@ -186,7 +186,8 @@ static int pl011_getc(struct serial_port *port, char *pc)
 static int __init pl011_irq(struct serial_port *port)
 {
     struct pl011 *uart = port->uart;
-    return ((uart->irq.irq > 0) ? uart->irq.irq : -1);
+
+    return ((uart->irq > 0) ? uart->irq : -1);
 }
 
 static const struct vuart_info *pl011_vuart(struct serial_port *port)
@@ -239,12 +240,13 @@ static int __init pl011_uart_init(struct dt_device_node *dev,
         return res;
     }
 
-    res = dt_device_get_irq(dev, 0, &uart->irq);
-    if ( res )
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
     {
         printk("pl011: Unable to retrieve the IRQ\n");
-        return res;
+        return -EINVAL;
     }
+    uart->irq = res;
 
     uart->regs = ioremap_nocache(addr, size);
     if ( !uart->regs )
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index a7a796d..bb55390 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -40,11 +40,6 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
-int request_dt_irq(const struct dt_irq *irq,
-                   void (*handler)(int, void *, struct cpu_user_regs *),
-                   const char *devname, void *dev_id);
-int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
-
 int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
                           const char *devname);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqufb-0003S1-26; Sun, 01 Jun 2014 01:34:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufZ-0003Rg-BS
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:41 +0000
Received: from [193.109.254.147:57933] by server-2.bemta-14.messagelabs.com id
	67/B6-21684-0338A835; Sun, 01 Jun 2014 01:34:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586478!8293234!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28875 invoked from network); 1 Jun 2014 01:34:39 -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;
	1 Jun 2014 01:34: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 1WqufV-0001Le-Vm
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqufV-0001Sx-Uh
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:37 +0000
Date: Sun, 01 Jun 2014 01:34:37 +0000
Message-Id: <E1WqufV-0001Sx-Uh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: Replace {request,
	setup}_dt_irq by {request, setup}_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 554cbe32381fa4482e1a47cd31afb054e97d986d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:28 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:01 2014 +0100

    xen/arm: IRQ: Replace {request, setup}_dt_irq by {request, setup}_irq
    
    Now that irq_desc stores the type of the IRQ (e.g level/edge,...), we don't
    need to use specific IRQ function for ARM.
    
    Also replace every call to dt_device_get_irq by platform_get_irq which is
    a wrapper to this function and setup the IRQ type correctly.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Keir Fraser <keir@xen.org>
---
 xen/arch/arm/gic.c                 |   13 +++++++------
 xen/arch/arm/irq.c                 |   23 +++++++++++------------
 xen/arch/arm/time.c                |   30 ++++++++++++++++--------------
 xen/drivers/char/exynos4210-uart.c |   15 ++++++++-------
 xen/drivers/char/ns16550.c         |   18 ++++--------------
 xen/drivers/char/omap-uart.c       |   15 ++++++++-------
 xen/drivers/char/pl011.c           |   18 ++++++++++--------
 xen/include/asm-arm/irq.h          |    5 -----
 8 files changed, 64 insertions(+), 73 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 13eeb33..b9fa73d 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -47,7 +47,7 @@ static struct {
     paddr_t hbase;       /* Address of virtual interface registers */
     paddr_t vbase;       /* Address of virtual cpu interface registers */
     unsigned int lines;  /* Number of interrupts (SPIs + PPIs + SGIs) */
-    struct dt_irq maintenance; /* IRQ maintenance */
+    unsigned int maintenance_irq; /* IRQ maintenance */
     unsigned int cpus;
     spinlock_t lock;
 } gic;
@@ -433,9 +433,10 @@ void __init gic_init(void)
     if ( res || !gic.vbase || (gic.vbase & ~PAGE_MASK) )
         panic("GIC: Cannot find a valid address for the virtual CPU");
 
-    res = dt_device_get_irq(node, 0, &gic.maintenance);
-    if ( res )
+    res = platform_get_irq(node, 0);
+    if ( res < 0 )
         panic("GIC: Cannot find the maintenance IRQ");
+    gic.maintenance_irq = res;
 
     /* Set the GIC as the primary interrupt controller */
     dt_interrupt_controller = node;
@@ -449,7 +450,7 @@ void __init gic_init(void)
               "        gic_vcpu_addr=%"PRIpaddr"\n"
               "        gic_maintenance_irq=%u\n",
               gic.dbase, gic.cbase, gic.hbase, gic.vbase,
-              gic.maintenance.irq);
+              gic.maintenance_irq);
 
     if ( (gic.dbase & ~PAGE_MASK) || (gic.cbase & ~PAGE_MASK) ||
          (gic.hbase & ~PAGE_MASK) || (gic.vbase & ~PAGE_MASK) )
@@ -886,8 +887,8 @@ void gic_dump_info(struct vcpu *v)
 
 void __cpuinit init_maintenance_interrupt(void)
 {
-    request_dt_irq(&gic.maintenance, maintenance_interrupt,
-                   "irq-maintenance", NULL);
+    request_irq(gic.maintenance_irq, maintenance_interrupt,
+                "irq-maintenance", NULL);
 }
 
 /*
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 832ee90..0808e36 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -133,9 +133,9 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
     return desc->action->dev_id;
 }
 
-int request_dt_irq(const struct dt_irq *irq,
-                   void (*handler)(int, void *, struct cpu_user_regs *),
-                   const char *devname, void *dev_id)
+int request_irq(unsigned int irq,
+                void (*handler)(int, void *, struct cpu_user_regs *),
+                const char *devname, void *dev_id)
 {
     struct irqaction *action;
     int retval;
@@ -146,13 +146,13 @@ int request_dt_irq(const struct dt_irq *irq,
      * which interrupt is which (messes up the interrupt freeing
      * logic etc).
      */
-    if (irq->irq >= nr_irqs)
+    if ( irq >= nr_irqs )
         return -EINVAL;
-    if (!handler)
+    if ( !handler )
         return -EINVAL;
 
     action = xmalloc(struct irqaction);
-    if (!action)
+    if ( !action )
         return -ENOMEM;
 
     action->handler = handler;
@@ -160,8 +160,8 @@ int request_dt_irq(const struct dt_irq *irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_dt_irq(irq, action);
-    if (retval)
+    retval = setup_irq(irq, action);
+    if ( retval )
         xfree(action);
 
     return retval;
@@ -268,14 +268,14 @@ static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
     return 0;
 }
 
-int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
+int setup_irq(unsigned int irq, struct irqaction *new)
 {
     int rc;
     unsigned long flags;
     struct irq_desc *desc;
     bool_t disabled;
 
-    desc = irq_to_desc(irq->irq);
+    desc = irq_to_desc(irq);
 
     spin_lock_irqsave(&desc->lock, flags);
 
@@ -285,7 +285,7 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
 
         spin_unlock_irqrestore(&desc->lock, flags);
         printk(XENLOG_ERR "ERROR: IRQ %u is already in use by the domain %u\n",
-               irq->irq, d->domain_id);
+               irq, d->domain_id);
         return -EBUSY;
     }
 
@@ -305,7 +305,6 @@ int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new)
          * TODO: Handle case where SPI is setup on different CPU than
          * the targeted CPU and the priority.
          */
-        desc->arch.type = irq->type;
         gic_route_irq_to_xen(desc, cpumask_of(smp_processor_id()),
                              GIC_PRI_IRQ);
         desc->handler->startup(desc);
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index d04c97a..7eb480e 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -48,13 +48,13 @@ uint64_t __read_mostly boot_count;
  * register-mapped time source in the SoC. */
 unsigned long __read_mostly cpu_khz;  /* CPU clock frequency in kHz. */
 
-static struct dt_irq timer_irq[MAX_TIMER_PPI];
+static unsigned int timer_irq[MAX_TIMER_PPI];
 
 unsigned int timer_get_irq(enum timer_ppi ppi)
 {
     ASSERT(ppi >= TIMER_PHYS_SECURE_PPI && ppi < MAX_TIMER_PPI);
 
-    return timer_irq[ppi].irq;
+    return timer_irq[ppi];
 }
 
 /*static inline*/ s_time_t ticks_to_ns(uint64_t ticks)
@@ -120,15 +120,17 @@ int __init init_xen_time(void)
     /* Retrieve all IRQs for the timer */
     for ( i = TIMER_PHYS_SECURE_PPI; i < MAX_TIMER_PPI; i++ )
     {
-        res = dt_device_get_irq(dev, i, &timer_irq[i]);
-        if ( res )
+        res = platform_get_irq(dev, i);
+
+        if ( res < 0 )
             panic("Timer: Unable to retrieve IRQ %u from the device tree", i);
+        timer_irq[i] = res;
     }
 
     printk("Generic Timer IRQ: phys=%u hyp=%u virt=%u\n",
-           timer_irq[TIMER_PHYS_NONSECURE_PPI].irq,
-           timer_irq[TIMER_HYP_PPI].irq,
-           timer_irq[TIMER_VIRT_PPI].irq);
+           timer_irq[TIMER_PHYS_NONSECURE_PPI],
+           timer_irq[TIMER_HYP_PPI],
+           timer_irq[TIMER_VIRT_PPI]);
 
     res = platform_init_time();
     if ( res )
@@ -192,7 +194,7 @@ int reprogram_timer(s_time_t timeout)
 /* Handle the firing timer */
 static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    if ( irq == (timer_irq[TIMER_HYP_PPI].irq) &&
+    if ( irq == (timer_irq[TIMER_HYP_PPI]) &&
          READ_SYSREG32(CNTHP_CTL_EL2) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
@@ -201,7 +203,7 @@ static void timer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
         WRITE_SYSREG32(0, CNTHP_CTL_EL2);
     }
 
-    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI].irq) &&
+    if ( irq == (timer_irq[TIMER_PHYS_NONSECURE_PPI]) &&
          READ_SYSREG32(CNTP_CTL_EL0) & CNTx_CTL_PENDING )
     {
         /* Signal the generic timer code to do its work */
@@ -234,12 +236,12 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    request_dt_irq(&timer_irq[TIMER_HYP_PPI], timer_interrupt,
-                   "hyptimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
+    request_irq(timer_irq[TIMER_HYP_PPI], timer_interrupt,
+                "hyptimer", NULL);
+    request_irq(timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
                    "virtimer", NULL);
-    request_dt_irq(&timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
-                   "phytimer", NULL);
+    request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
+                "phytimer", NULL);
 }
 
 /* Wait a set number of microseconds */
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 370539c..404ce05 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -30,7 +30,7 @@
 
 static struct exynos4210_uart {
     unsigned int baud, clock_hz, data_bits, parity, stop_bits;
-    struct dt_irq irq;
+    unsigned int irq;
     void *regs;
     struct irqaction irqaction;
     struct vuart_info vuart;
@@ -197,9 +197,9 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name    = "exynos4210_uart";
     uart->irqaction.dev_id  = port;
 
-    if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
+    if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
         dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
-                uart->irq.irq);
+                uart->irq);
 
     /* Unmask interrupts */
     exynos4210_write(uart, UINTM, ~UINTM_ALLI);
@@ -272,7 +272,7 @@ static int __init exynos4210_uart_irq(struct serial_port *port)
 {
     struct exynos4210_uart *uart = port->uart;
 
-    return uart->irq.irq;
+    return uart->irq;
 }
 
 static const struct vuart_info *exynos4210_vuart_info(struct serial_port *port)
@@ -323,12 +323,13 @@ static int __init exynos4210_uart_init(struct dt_device_node *dev,
         return res;
     }
 
-    res = dt_device_get_irq(dev, 0, &uart->irq);
-    if ( res )
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
     {
         printk("exynos4210: Unable to retrieve the IRQ\n");
-        return res;
+        return -EINVAL;
     }
+    uart->irq = res;
 
     uart->regs = ioremap_nocache(addr, size);
     if ( !uart->regs )
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 21f086a..6691806 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -76,9 +76,6 @@ static struct ns16550 {
     u8 bar_idx;
     bool_t enable_ro; /* Make MMIO devices read only to Dom0 */
 #endif
-#ifdef HAS_DEVICE_TREE
-    struct dt_irq dt_irq;
-#endif
 } ns16550_com[2] = { { 0 } };
 
 struct ns16550_config_mmio {
@@ -612,13 +609,8 @@ static void __init ns16550_init_postirq(struct serial_port *port)
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
         uart->irqaction.dev_id  = port;
-#ifdef HAS_DEVICE_TREE
-        if ( (rc = setup_dt_irq(&uart->dt_irq, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate ns16550 DT IRQ.\n");
-#else
         if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
             printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
-#endif
     }
 
     ns16550_setup_postirq(uart);
@@ -1172,12 +1164,10 @@ static int __init ns16550_uart_dt_init(struct dt_device_node *dev,
     if ( uart->reg_width != 1 && uart->reg_width != 4 )
         return -EINVAL;
 
-    res = dt_device_get_irq(dev, 0, &uart->dt_irq);
-    if ( res )
-        return res;
-
-    /* The common bit of the driver mostly deals with irq not dt_irq. */
-    uart->irq = uart->dt_irq.irq;
+    res = platform_get_irq(dev, 0);
+    if ( ! res )
+        return -EINVAL;
+    uart->irq = res;
 
     uart->dw_usr_bsy = dt_device_is_compatible(dev, "snps,dw-apb-uart");
 
diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index b8da509..e598785 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -30,7 +30,7 @@
 
 static struct omap_uart {
     u32 baud, clock_hz, data_bits, parity, stop_bits, fifo_size;
-    struct dt_irq irq;
+    unsigned int irq;
     char __iomem *regs;
     struct irqaction irqaction;
     struct vuart_info vuart;
@@ -205,10 +205,10 @@ static void __init omap_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name = "omap_uart";
     uart->irqaction.dev_id = port;
 
-    if ( setup_dt_irq(&uart->irq, &uart->irqaction) != 0 )
+    if ( setup_irq(uart->irq, &uart->irqaction) != 0 )
     {
         dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n",
-                uart->irq.irq);
+                uart->irq);
         return;
     }
 
@@ -259,7 +259,7 @@ static int __init omap_uart_irq(struct serial_port *port)
 {
     struct omap_uart *uart = port->uart;
 
-    return ((uart->irq.irq > 0) ? uart->irq.irq : -1);
+    return ((uart->irq > 0) ? uart->irq : -1);
 }
 
 static const struct vuart_info *omap_vuart_info(struct serial_port *port)
@@ -317,12 +317,13 @@ static int __init omap_uart_init(struct dt_device_node *dev,
         return res;
     }
 
-    res = dt_device_get_irq(dev, 0, &uart->irq);
-    if ( res )
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
     {
         printk("omap-uart: Unable to retrieve the IRQ\n");
-        return res;
+        return -EINVAL;
     }
+    uart->irq = res;
 
     uart->regs = ioremap_nocache(addr, size);
     if ( !uart->regs )
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 459e686..89bda94 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -32,7 +32,7 @@
 
 static struct pl011 {
     unsigned int baud, clock_hz, data_bits, parity, stop_bits;
-    struct dt_irq irq;
+    unsigned int irq;
     void __iomem *regs;
     /* UART with IRQ line: interrupt-driven I/O. */
     struct irqaction irqaction;
@@ -132,13 +132,13 @@ static void __init pl011_init_postirq(struct serial_port *port)
     struct pl011 *uart = port->uart;
     int rc;
 
-    if ( uart->irq.irq > 0 )
+    if ( uart->irq > 0 )
     {
         uart->irqaction.handler = pl011_interrupt;
         uart->irqaction.name    = "pl011";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_dt_irq(&uart->irq, &uart->irqaction)) != 0 )
-            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq.irq);
+        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+            printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
     }
 
     /* Clear pending error interrupts */
@@ -186,7 +186,8 @@ static int pl011_getc(struct serial_port *port, char *pc)
 static int __init pl011_irq(struct serial_port *port)
 {
     struct pl011 *uart = port->uart;
-    return ((uart->irq.irq > 0) ? uart->irq.irq : -1);
+
+    return ((uart->irq > 0) ? uart->irq : -1);
 }
 
 static const struct vuart_info *pl011_vuart(struct serial_port *port)
@@ -239,12 +240,13 @@ static int __init pl011_uart_init(struct dt_device_node *dev,
         return res;
     }
 
-    res = dt_device_get_irq(dev, 0, &uart->irq);
-    if ( res )
+    res = platform_get_irq(dev, 0);
+    if ( res < 0 )
     {
         printk("pl011: Unable to retrieve the IRQ\n");
-        return res;
+        return -EINVAL;
     }
+    uart->irq = res;
 
     uart->regs = ioremap_nocache(addr, size);
     if ( !uart->regs )
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index a7a796d..bb55390 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -40,11 +40,6 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
-int request_dt_irq(const struct dt_irq *irq,
-                   void (*handler)(int, void *, struct cpu_user_regs *),
-                   const char *devname, void *dev_id);
-int setup_dt_irq(const struct dt_irq *irq, struct irqaction *new);
-
 int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
                           const char *devname);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqufk-0003Ty-7C; Sun, 01 Jun 2014 01:34:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufi-0003Tj-Pv
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:50 +0000
Received: from [85.158.143.35:11427] by server-2.bemta-4.messagelabs.com id
	C4/59-06539-A338A835; Sun, 01 Jun 2014 01:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1401586488!8386277!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24766 invoked from network); 1 Jun 2014 01:34: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;
	1 Jun 2014 01:34:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufg-0001Lk-4x
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufg-0001Tb-3y
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:48 +0000
Date: Sun, 01 Jun 2014 01:34:48 +0000
Message-Id: <E1Wqufg-0001Tb-3y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Replace route_guest_dt_irq by
	route_guest_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebb398b771a0d205f5cd2e36e98da83b186265cf
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:29 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:01 2014 +0100

    xen/arm: Replace route_guest_dt_irq by route_guest_irq
    
    We can use platform_get_irq to get the IRQ which will be route to the guest.
    
    platform_get_irq will store the type of IRQ (e.g level/edge...) directly in
    the irq_desc.
    
    This will avoid to have device tree specific routing function.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c          |   16 +++++++++-------
 xen/arch/arm/irq.c                   |   12 +++++-------
 xen/arch/arm/platforms/xgene-storm.c |   15 ++++++++++-----
 xen/include/asm-arm/irq.h            |    4 ++--
 4 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c424793..ddbb88d 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -686,7 +686,7 @@ static int map_device(struct domain *d, struct dt_device_node *dev)
     unsigned int naddr;
     unsigned int i;
     int res;
-    struct dt_irq irq;
+    unsigned int irq;
     struct dt_raw_irq rirq;
     u64 addr, size;
 
@@ -729,20 +729,22 @@ static int map_device(struct domain *d, struct dt_device_node *dev)
             continue;
         }
 
-        res = dt_irq_translate(&rirq, &irq);
-        if ( res )
+        res = platform_get_irq(dev, i);
+        if ( res < 0 )
         {
-            printk(XENLOG_ERR "Unable to translate irq %u for %s\n",
+            printk(XENLOG_ERR "Unable to get irq %u for %s\n",
                    i, dt_node_full_name(dev));
             return res;
         }
 
-        DPRINT("irq %u = %u type = 0x%x\n", i, irq.irq, irq.type);
-        res = route_dt_irq_to_guest(d, &irq, dt_node_name(dev));
+        irq = res;
+
+        DPRINT("irq %u = %u\n", i, irq);
+        res = route_irq_to_guest(d, irq, dt_node_name(dev));
         if ( res )
         {
             printk(XENLOG_ERR "Unable to route IRQ %u to domain %u\n",
-                   irq.irq, d->domain_id);
+                   irq, d->domain_id);
             return res;
         }
     }
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 0808e36..fa35e0d 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -316,11 +316,11 @@ err:
     return rc;
 }
 
-int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
-                          const char * devname)
+int route_irq_to_guest(struct domain *d, unsigned int irq,
+                       const char * devname)
 {
     struct irqaction *action;
-    struct irq_desc *desc = irq_to_desc(irq->irq);
+    struct irq_desc *desc = irq_to_desc(irq);
     unsigned long flags;
     int retval = 0;
 
@@ -348,10 +348,9 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
 
         if ( desc->status & IRQ_GUEST )
             printk(XENLOG_ERR "ERROR: IRQ %u is already used by domain %u\n",
-                   irq->irq, ad->domain_id);
+                   irq, ad->domain_id);
         else
-            printk(XENLOG_ERR "ERROR: IRQ %u is already used by Xen\n",
-                   irq->irq);
+            printk(XENLOG_ERR "ERROR: IRQ %u is already used by Xen\n", irq);
         retval = -EBUSY;
         goto out;
     }
@@ -360,7 +359,6 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     if ( retval )
         goto out;
 
-    desc->arch.type = irq->type;
     gic_route_irq_to_guest(d, desc, cpumask_of(smp_processor_id()),
                            GIC_PRI_IRQ);
     spin_unlock_irqrestore(&desc->lock, flags);
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 70aab73..c9dd63c 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -57,16 +57,21 @@ static int map_one_mmio(struct domain *d, const char *what,
 static int map_one_spi(struct domain *d, const char *what,
                        unsigned int spi, unsigned int type)
 {
-    struct dt_irq irq;
+    unsigned int irq;
     int ret;
 
-    irq.type = type;
+    irq = spi + 32; /* SPIs start at IRQ 32 */
 
-    irq.irq = spi + 32; /* SPIs start at IRQ 32 */
+    ret = irq_set_spi_type(irq, type);
+    if ( ret )
+    {
+        printk("Failed to set the type for IRQ%u\n", irq);
+        return ret;
+    }
 
-    printk("Additional IRQ %u (%s)\n", irq.irq, what);
+    printk("Additional IRQ %u (%s)\n", irq, what);
 
-    ret = route_dt_irq_to_guest(d, &irq, what);
+    ret = route_irq_to_guest(d, irq, what);
     if ( ret )
         printk("Failed to route %s to dom%d\n", what, d->domain_id);
 
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index bb55390..e567f71 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -40,8 +40,8 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
-int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
-                          const char *devname);
+int route_irq_to_guest(struct domain *d, unsigned int irq,
+                       const char *devname);
 
 /* Set IRQ type for an SPI */
 int irq_set_spi_type(unsigned int spi, unsigned int type);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:34:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:34:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqufk-0003Ty-7C; Sun, 01 Jun 2014 01:34:52 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufi-0003Tj-Pv
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:50 +0000
Received: from [85.158.143.35:11427] by server-2.bemta-4.messagelabs.com id
	C4/59-06539-A338A835; Sun, 01 Jun 2014 01:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1401586488!8386277!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24766 invoked from network); 1 Jun 2014 01:34: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;
	1 Jun 2014 01:34:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufg-0001Lk-4x
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufg-0001Tb-3y
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:48 +0000
Date: Sun, 01 Jun 2014 01:34:48 +0000
Message-Id: <E1Wqufg-0001Tb-3y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Replace route_guest_dt_irq by
	route_guest_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebb398b771a0d205f5cd2e36e98da83b186265cf
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:29 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:01 2014 +0100

    xen/arm: Replace route_guest_dt_irq by route_guest_irq
    
    We can use platform_get_irq to get the IRQ which will be route to the guest.
    
    platform_get_irq will store the type of IRQ (e.g level/edge...) directly in
    the irq_desc.
    
    This will avoid to have device tree specific routing function.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain_build.c          |   16 +++++++++-------
 xen/arch/arm/irq.c                   |   12 +++++-------
 xen/arch/arm/platforms/xgene-storm.c |   15 ++++++++++-----
 xen/include/asm-arm/irq.h            |    4 ++--
 4 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c424793..ddbb88d 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -686,7 +686,7 @@ static int map_device(struct domain *d, struct dt_device_node *dev)
     unsigned int naddr;
     unsigned int i;
     int res;
-    struct dt_irq irq;
+    unsigned int irq;
     struct dt_raw_irq rirq;
     u64 addr, size;
 
@@ -729,20 +729,22 @@ static int map_device(struct domain *d, struct dt_device_node *dev)
             continue;
         }
 
-        res = dt_irq_translate(&rirq, &irq);
-        if ( res )
+        res = platform_get_irq(dev, i);
+        if ( res < 0 )
         {
-            printk(XENLOG_ERR "Unable to translate irq %u for %s\n",
+            printk(XENLOG_ERR "Unable to get irq %u for %s\n",
                    i, dt_node_full_name(dev));
             return res;
         }
 
-        DPRINT("irq %u = %u type = 0x%x\n", i, irq.irq, irq.type);
-        res = route_dt_irq_to_guest(d, &irq, dt_node_name(dev));
+        irq = res;
+
+        DPRINT("irq %u = %u\n", i, irq);
+        res = route_irq_to_guest(d, irq, dt_node_name(dev));
         if ( res )
         {
             printk(XENLOG_ERR "Unable to route IRQ %u to domain %u\n",
-                   irq.irq, d->domain_id);
+                   irq, d->domain_id);
             return res;
         }
     }
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 0808e36..fa35e0d 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -316,11 +316,11 @@ err:
     return rc;
 }
 
-int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
-                          const char * devname)
+int route_irq_to_guest(struct domain *d, unsigned int irq,
+                       const char * devname)
 {
     struct irqaction *action;
-    struct irq_desc *desc = irq_to_desc(irq->irq);
+    struct irq_desc *desc = irq_to_desc(irq);
     unsigned long flags;
     int retval = 0;
 
@@ -348,10 +348,9 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
 
         if ( desc->status & IRQ_GUEST )
             printk(XENLOG_ERR "ERROR: IRQ %u is already used by domain %u\n",
-                   irq->irq, ad->domain_id);
+                   irq, ad->domain_id);
         else
-            printk(XENLOG_ERR "ERROR: IRQ %u is already used by Xen\n",
-                   irq->irq);
+            printk(XENLOG_ERR "ERROR: IRQ %u is already used by Xen\n", irq);
         retval = -EBUSY;
         goto out;
     }
@@ -360,7 +359,6 @@ int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
     if ( retval )
         goto out;
 
-    desc->arch.type = irq->type;
     gic_route_irq_to_guest(d, desc, cpumask_of(smp_processor_id()),
                            GIC_PRI_IRQ);
     spin_unlock_irqrestore(&desc->lock, flags);
diff --git a/xen/arch/arm/platforms/xgene-storm.c b/xen/arch/arm/platforms/xgene-storm.c
index 70aab73..c9dd63c 100644
--- a/xen/arch/arm/platforms/xgene-storm.c
+++ b/xen/arch/arm/platforms/xgene-storm.c
@@ -57,16 +57,21 @@ static int map_one_mmio(struct domain *d, const char *what,
 static int map_one_spi(struct domain *d, const char *what,
                        unsigned int spi, unsigned int type)
 {
-    struct dt_irq irq;
+    unsigned int irq;
     int ret;
 
-    irq.type = type;
+    irq = spi + 32; /* SPIs start at IRQ 32 */
 
-    irq.irq = spi + 32; /* SPIs start at IRQ 32 */
+    ret = irq_set_spi_type(irq, type);
+    if ( ret )
+    {
+        printk("Failed to set the type for IRQ%u\n", irq);
+        return ret;
+    }
 
-    printk("Additional IRQ %u (%s)\n", irq.irq, what);
+    printk("Additional IRQ %u (%s)\n", irq, what);
 
-    ret = route_dt_irq_to_guest(d, &irq, what);
+    ret = route_irq_to_guest(d, irq, what);
     if ( ret )
         printk("Failed to route %s to dom%d\n", what, d->domain_id);
 
diff --git a/xen/include/asm-arm/irq.h b/xen/include/asm-arm/irq.h
index bb55390..e567f71 100644
--- a/xen/include/asm-arm/irq.h
+++ b/xen/include/asm-arm/irq.h
@@ -40,8 +40,8 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq);
 void init_IRQ(void);
 void init_secondary_IRQ(void);
 
-int route_dt_irq_to_guest(struct domain *d, const struct dt_irq *irq,
-                          const char *devname);
+int route_irq_to_guest(struct domain *d, unsigned int irq,
+                       const char *devname);
 
 /* Set IRQ type for an SPI */
 int irq_set_spi_type(unsigned int spi, unsigned int type);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqufy-0003Vb-A6; Sun, 01 Jun 2014 01:35:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufs-0003VG-Sb
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:01 +0000
Received: from [193.109.254.147:46394] by server-12.bemta-14.messagelabs.com
	id D4/9F-27473-4438A835; Sun, 01 Jun 2014 01:35:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1401586498!8246209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2383 invoked from network); 1 Jun 2014 01:34:59 -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;
	1 Jun 2014 01:34:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufq-0001Lt-AF
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufq-0001UC-8l
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:58 +0000
Date: Sun, 01 Jun 2014 01:34:58 +0000
Message-Id: <E1Wqufq-0001UC-8l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: IRQ: Add dev_id parameter to
	release_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df3f46b6cd1ec809b8d70dcdf4d243295747b605
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:01 2014 +0100

    xen: IRQ: Add dev_id parameter to release_irq
    
    The new parameter (dev_id) will be used in on ARM to release the right
    action when support for multiple action is added.
    
    Even if this function is declared in common code, no one is using it. So it's
    safe to modify the prototype also for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c    |    2 +-
 xen/arch/x86/irq.c    |    2 +-
 xen/include/xen/irq.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index fa35e0d..24eca0a 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -232,7 +232,7 @@ out_no_end:
     irq_exit();
 }
 
-void release_irq(unsigned int irq)
+void release_irq(unsigned int irq, const void *dev_id)
 {
     struct irq_desc *desc;
     unsigned long flags;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 5b5b169..727472d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -983,7 +983,7 @@ int __init request_irq(unsigned int irq,
     return retval;
 }
 
-void __init release_irq(unsigned int irq)
+void __init release_irq(unsigned int irq, const void *dev_id)
 {
     struct irq_desc *desc;
     unsigned long flags;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index f2e6215..1f8bdb3 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -90,7 +90,7 @@ int arch_init_one_irq_desc(struct irq_desc *);
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
 extern int setup_irq(unsigned int irq, struct irqaction *);
-extern void release_irq(unsigned int irq);
+extern void release_irq(unsigned int irq, const void *dev_id);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
                const char * devname, void *dev_id);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqufy-0003Vb-A6; Sun, 01 Jun 2014 01:35:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufs-0003VG-Sb
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:01 +0000
Received: from [193.109.254.147:46394] by server-12.bemta-14.messagelabs.com
	id D4/9F-27473-4438A835; Sun, 01 Jun 2014 01:35:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1401586498!8246209!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2383 invoked from network); 1 Jun 2014 01:34:59 -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;
	1 Jun 2014 01:34:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufq-0001Lt-AF
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqufq-0001UC-8l
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:34:58 +0000
Date: Sun, 01 Jun 2014 01:34:58 +0000
Message-Id: <E1Wqufq-0001UC-8l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: IRQ: Add dev_id parameter to
	release_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit df3f46b6cd1ec809b8d70dcdf4d243295747b605
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:01 2014 +0100

    xen: IRQ: Add dev_id parameter to release_irq
    
    The new parameter (dev_id) will be used in on ARM to release the right
    action when support for multiple action is added.
    
    Even if this function is declared in common code, no one is using it. So it's
    safe to modify the prototype also for x86.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c    |    2 +-
 xen/arch/x86/irq.c    |    2 +-
 xen/include/xen/irq.h |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index fa35e0d..24eca0a 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -232,7 +232,7 @@ out_no_end:
     irq_exit();
 }
 
-void release_irq(unsigned int irq)
+void release_irq(unsigned int irq, const void *dev_id)
 {
     struct irq_desc *desc;
     unsigned long flags;
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 5b5b169..727472d 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -983,7 +983,7 @@ int __init request_irq(unsigned int irq,
     return retval;
 }
 
-void __init release_irq(unsigned int irq)
+void __init release_irq(unsigned int irq, const void *dev_id)
 {
     struct irq_desc *desc;
     unsigned long flags;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index f2e6215..1f8bdb3 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -90,7 +90,7 @@ int arch_init_one_irq_desc(struct irq_desc *);
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
 extern int setup_irq(unsigned int irq, struct irqaction *);
-extern void release_irq(unsigned int irq);
+extern void release_irq(unsigned int irq, const void *dev_id);
 extern int request_irq(unsigned int irq,
                void (*handler)(int, void *, struct cpu_user_regs *),
                const char * devname, void *dev_id);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqug5-0003X1-Cl; Sun, 01 Jun 2014 01:35:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqug3-0003Wf-Lz
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:11 +0000
Received: from [85.158.143.35:11843] by server-2.bemta-4.messagelabs.com id
	D5/69-06539-F438A835; Sun, 01 Jun 2014 01:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1401586508!8447864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10165 invoked from network); 1 Jun 2014 01:35:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqug0-0001MQ-HB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqug0-0001V0-Fu
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:08 +0000
Date: Sun, 01 Jun 2014 01:35:08 +0000
Message-Id: <E1Wqug0-0001V0-Fu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: extend {request,
	setup}_irq to take an irqflags in parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 660deea8935a7dcb99e1114f15729bf56fb9d4d8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:31 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:02 2014 +0100

    xen/arm: IRQ: extend {request, setup}_irq to take an irqflags in parameter
    
    The irqflags will be used later on ARM to know if we can shared the IRQ or not.
    
    On x86, the irqflags should always be 0.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
    Cc: Xiantao Zhang <xiantao.zhang@intel.com>
---
 xen/arch/arm/gic.c                       |    2 +-
 xen/arch/arm/irq.c                       |    6 +++---
 xen/arch/arm/time.c                      |    6 +++---
 xen/arch/x86/hpet.c                      |    2 +-
 xen/arch/x86/i8259.c                     |    2 +-
 xen/arch/x86/irq.c                       |    9 ++++++---
 xen/arch/x86/time.c                      |    2 +-
 xen/drivers/char/exynos4210-uart.c       |    2 +-
 xen/drivers/char/ns16550.c               |    2 +-
 xen/drivers/char/omap-uart.c             |    2 +-
 xen/drivers/char/pl011.c                 |    2 +-
 xen/drivers/passthrough/amd/iommu_init.c |    2 +-
 xen/drivers/passthrough/vtd/iommu.c      |    2 +-
 xen/include/xen/irq.h                    |    5 +++--
 14 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index b9fa73d..ff1addc 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -887,7 +887,7 @@ void gic_dump_info(struct vcpu *v)
 
 void __cpuinit init_maintenance_interrupt(void)
 {
-    request_irq(gic.maintenance_irq, maintenance_interrupt,
+    request_irq(gic.maintenance_irq, 0, maintenance_interrupt,
                 "irq-maintenance", NULL);
 }
 
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 24eca0a..1b62d83 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -133,7 +133,7 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
     return desc->action->dev_id;
 }
 
-int request_irq(unsigned int irq,
+int request_irq(unsigned int irq, unsigned int irqflags,
                 void (*handler)(int, void *, struct cpu_user_regs *),
                 const char *devname, void *dev_id)
 {
@@ -160,7 +160,7 @@ int request_irq(unsigned int irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_irq(irq, action);
+    retval = setup_irq(irq, irqflags, action);
     if ( retval )
         xfree(action);
 
@@ -268,7 +268,7 @@ static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
     return 0;
 }
 
-int setup_irq(unsigned int irq, struct irqaction *new)
+int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
 {
     int rc;
     unsigned long flags;
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 7eb480e..0395b7b 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -236,11 +236,11 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    request_irq(timer_irq[TIMER_HYP_PPI], timer_interrupt,
+    request_irq(timer_irq[TIMER_HYP_PPI], 0, timer_interrupt,
                 "hyptimer", NULL);
-    request_irq(timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
+    request_irq(timer_irq[TIMER_VIRT_PPI], 0, vtimer_interrupt,
                    "virtimer", NULL);
-    request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
+    request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], 0, timer_interrupt,
                 "phytimer", NULL);
 }
 
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 3a4f7e8..0b13f52 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -355,7 +355,7 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
 
     desc->handler = &hpet_msi_type;
-    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, "HPET", ch);
+    ret = request_irq(ch->msi.irq, 0, hpet_interrupt_handler, "HPET", ch);
     if ( ret >= 0 )
         ret = __hpet_setup_msi_irq(desc);
     if ( ret < 0 )
diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 9f99995..c2c9005 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -366,6 +366,6 @@ void __init init_IRQ(void)
     outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
     outb(LATCH >> 8, PIT_CH0);     /* MSB */
 
-    setup_irq(2, &cascade);
+    setup_irq(2, 0, &cascade);
 }
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 727472d..dafd338 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -949,7 +949,7 @@ static int __init irq_ratelimit_init(void)
 }
 __initcall(irq_ratelimit_init);
 
-int __init request_irq(unsigned int irq,
+int __init request_irq(unsigned int irq, unsigned int irqflags,
         void (*handler)(int, void *, struct cpu_user_regs *),
         const char * devname, void *dev_id)
 {
@@ -976,7 +976,7 @@ int __init request_irq(unsigned int irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_irq(irq, action);
+    retval = setup_irq(irq, irqflags, action);
     if (retval)
         xfree(action);
 
@@ -1005,11 +1005,14 @@ void __init release_irq(unsigned int irq, const void *dev_id)
         xfree(action);
 }
 
-int __init setup_irq(unsigned int irq, struct irqaction *new)
+int __init setup_irq(unsigned int irq, unsigned int irqflags,
+                     struct irqaction *new)
 {
     struct irq_desc *desc;
     unsigned long flags;
 
+    ASSERT(irqflags == 0);
+
     desc = irq_to_desc(irq);
  
     spin_lock_irqsave(&desc->lock,flags);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b2dbde7..a4e1656 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1473,7 +1473,7 @@ void __init early_time_init(void)
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
-    setup_irq(0, &irq0);
+    setup_irq(0, 0, &irq0);
 }
 
 /* keep pit enabled for pit_broadcast working while cpuidle enabled */
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 404ce05..cba8729 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -197,7 +197,7 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name    = "exynos4210_uart";
     uart->irqaction.dev_id  = port;
 
-    if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
         dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
                 uart->irq);
 
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 6691806..161b251 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -609,7 +609,7 @@ static void __init ns16550_init_postirq(struct serial_port *port)
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
             printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
     }
 
diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index e598785..a798b8d 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -205,7 +205,7 @@ static void __init omap_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name = "omap_uart";
     uart->irqaction.dev_id = port;
 
-    if ( setup_irq(uart->irq, &uart->irqaction) != 0 )
+    if ( setup_irq(uart->irq, 0, &uart->irqaction) != 0 )
     {
         dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n",
                 uart->irq);
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 89bda94..dd19ce8 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -137,7 +137,7 @@ static void __init pl011_init_postirq(struct serial_port *port)
         uart->irqaction.handler = pl011_interrupt;
         uart->irqaction.name    = "pl011";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
             printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
     }
 
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index ee8851a..b2f74ef 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -815,7 +815,7 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
         handler = &iommu_msi_type;
     ret = __setup_msi_irq(irq_to_desc(irq), &iommu->msi, handler);
     if ( !ret )
-        ret = request_irq(irq, iommu_interrupt_handler, "amd_iommu", iommu);
+        ret = request_irq(irq, 0, iommu_interrupt_handler, "amd_iommu", iommu);
     if ( ret )
     {
         destroy_irq(irq);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index be6d324..431adb4 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1082,7 +1082,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd)
 
     desc = irq_to_desc(irq);
     desc->handler = &dma_msi_type;
-    ret = request_irq(irq, iommu_page_fault, "dmar", iommu);
+    ret = request_irq(irq, 0, iommu_page_fault, "dmar", iommu);
     if ( ret )
     {
         desc->handler = &no_irq_type;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 1f8bdb3..f9a18d8 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -89,9 +89,10 @@ int arch_init_one_irq_desc(struct irq_desc *);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
-extern int setup_irq(unsigned int irq, struct irqaction *);
+extern int setup_irq(unsigned int irq, unsigned int irqflags,
+                     struct irqaction *);
 extern void release_irq(unsigned int irq, const void *dev_id);
-extern int request_irq(unsigned int irq,
+extern int request_irq(unsigned int irq, unsigned int irqflags,
                void (*handler)(int, void *, struct cpu_user_regs *),
                const char * devname, void *dev_id);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqug5-0003X1-Cl; Sun, 01 Jun 2014 01:35:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqug3-0003Wf-Lz
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:11 +0000
Received: from [85.158.143.35:11843] by server-2.bemta-4.messagelabs.com id
	D5/69-06539-F438A835; Sun, 01 Jun 2014 01:35:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1401586508!8447864!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG, SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10165 invoked from network); 1 Jun 2014 01:35:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqug0-0001MQ-HB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqug0-0001V0-Fu
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:08 +0000
Date: Sun, 01 Jun 2014 01:35:08 +0000
Message-Id: <E1Wqug0-0001V0-Fu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: extend {request,
	setup}_irq to take an irqflags in parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 660deea8935a7dcb99e1114f15729bf56fb9d4d8
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:31 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:02 2014 +0100

    xen/arm: IRQ: extend {request, setup}_irq to take an irqflags in parameter
    
    The irqflags will be used later on ARM to know if we can shared the IRQ or not.
    
    On x86, the irqflags should always be 0.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Cc: Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>
    Cc: Xiantao Zhang <xiantao.zhang@intel.com>
---
 xen/arch/arm/gic.c                       |    2 +-
 xen/arch/arm/irq.c                       |    6 +++---
 xen/arch/arm/time.c                      |    6 +++---
 xen/arch/x86/hpet.c                      |    2 +-
 xen/arch/x86/i8259.c                     |    2 +-
 xen/arch/x86/irq.c                       |    9 ++++++---
 xen/arch/x86/time.c                      |    2 +-
 xen/drivers/char/exynos4210-uart.c       |    2 +-
 xen/drivers/char/ns16550.c               |    2 +-
 xen/drivers/char/omap-uart.c             |    2 +-
 xen/drivers/char/pl011.c                 |    2 +-
 xen/drivers/passthrough/amd/iommu_init.c |    2 +-
 xen/drivers/passthrough/vtd/iommu.c      |    2 +-
 xen/include/xen/irq.h                    |    5 +++--
 14 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index b9fa73d..ff1addc 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -887,7 +887,7 @@ void gic_dump_info(struct vcpu *v)
 
 void __cpuinit init_maintenance_interrupt(void)
 {
-    request_irq(gic.maintenance_irq, maintenance_interrupt,
+    request_irq(gic.maintenance_irq, 0, maintenance_interrupt,
                 "irq-maintenance", NULL);
 }
 
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 24eca0a..1b62d83 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -133,7 +133,7 @@ static inline struct domain *irq_get_domain(struct irq_desc *desc)
     return desc->action->dev_id;
 }
 
-int request_irq(unsigned int irq,
+int request_irq(unsigned int irq, unsigned int irqflags,
                 void (*handler)(int, void *, struct cpu_user_regs *),
                 const char *devname, void *dev_id)
 {
@@ -160,7 +160,7 @@ int request_irq(unsigned int irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_irq(irq, action);
+    retval = setup_irq(irq, irqflags, action);
     if ( retval )
         xfree(action);
 
@@ -268,7 +268,7 @@ static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
     return 0;
 }
 
-int setup_irq(unsigned int irq, struct irqaction *new)
+int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
 {
     int rc;
     unsigned long flags;
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 7eb480e..0395b7b 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -236,11 +236,11 @@ void __cpuinit init_timer_interrupt(void)
     WRITE_SYSREG32(0, CNTHP_CTL_EL2);   /* Hypervisor's timer disabled */
     isb();
 
-    request_irq(timer_irq[TIMER_HYP_PPI], timer_interrupt,
+    request_irq(timer_irq[TIMER_HYP_PPI], 0, timer_interrupt,
                 "hyptimer", NULL);
-    request_irq(timer_irq[TIMER_VIRT_PPI], vtimer_interrupt,
+    request_irq(timer_irq[TIMER_VIRT_PPI], 0, vtimer_interrupt,
                    "virtimer", NULL);
-    request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], timer_interrupt,
+    request_irq(timer_irq[TIMER_PHYS_NONSECURE_PPI], 0, timer_interrupt,
                 "phytimer", NULL);
 }
 
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 3a4f7e8..0b13f52 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -355,7 +355,7 @@ static int __init hpet_setup_msi_irq(struct hpet_event_channel *ch)
     hpet_write32(cfg, HPET_Tn_CFG(ch->idx));
 
     desc->handler = &hpet_msi_type;
-    ret = request_irq(ch->msi.irq, hpet_interrupt_handler, "HPET", ch);
+    ret = request_irq(ch->msi.irq, 0, hpet_interrupt_handler, "HPET", ch);
     if ( ret >= 0 )
         ret = __hpet_setup_msi_irq(desc);
     if ( ret < 0 )
diff --git a/xen/arch/x86/i8259.c b/xen/arch/x86/i8259.c
index 9f99995..c2c9005 100644
--- a/xen/arch/x86/i8259.c
+++ b/xen/arch/x86/i8259.c
@@ -366,6 +366,6 @@ void __init init_IRQ(void)
     outb_p(LATCH & 0xff, PIT_CH0); /* LSB */
     outb(LATCH >> 8, PIT_CH0);     /* MSB */
 
-    setup_irq(2, &cascade);
+    setup_irq(2, 0, &cascade);
 }
 
diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c
index 727472d..dafd338 100644
--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -949,7 +949,7 @@ static int __init irq_ratelimit_init(void)
 }
 __initcall(irq_ratelimit_init);
 
-int __init request_irq(unsigned int irq,
+int __init request_irq(unsigned int irq, unsigned int irqflags,
         void (*handler)(int, void *, struct cpu_user_regs *),
         const char * devname, void *dev_id)
 {
@@ -976,7 +976,7 @@ int __init request_irq(unsigned int irq,
     action->dev_id = dev_id;
     action->free_on_release = 1;
 
-    retval = setup_irq(irq, action);
+    retval = setup_irq(irq, irqflags, action);
     if (retval)
         xfree(action);
 
@@ -1005,11 +1005,14 @@ void __init release_irq(unsigned int irq, const void *dev_id)
         xfree(action);
 }
 
-int __init setup_irq(unsigned int irq, struct irqaction *new)
+int __init setup_irq(unsigned int irq, unsigned int irqflags,
+                     struct irqaction *new)
 {
     struct irq_desc *desc;
     unsigned long flags;
 
+    ASSERT(irqflags == 0);
+
     desc = irq_to_desc(irq);
  
     spin_lock_irqsave(&desc->lock,flags);
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index b2dbde7..a4e1656 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -1473,7 +1473,7 @@ void __init early_time_init(void)
     printk("Detected %lu.%03lu MHz processor.\n", 
            cpu_khz / 1000, cpu_khz % 1000);
 
-    setup_irq(0, &irq0);
+    setup_irq(0, 0, &irq0);
 }
 
 /* keep pit enabled for pit_broadcast working while cpuidle enabled */
diff --git a/xen/drivers/char/exynos4210-uart.c b/xen/drivers/char/exynos4210-uart.c
index 404ce05..cba8729 100644
--- a/xen/drivers/char/exynos4210-uart.c
+++ b/xen/drivers/char/exynos4210-uart.c
@@ -197,7 +197,7 @@ static void __init exynos4210_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name    = "exynos4210_uart";
     uart->irqaction.dev_id  = port;
 
-    if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+    if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
         dprintk(XENLOG_ERR, "Failed to allocated exynos4210_uart IRQ %d\n",
                 uart->irq);
 
diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
index 6691806..161b251 100644
--- a/xen/drivers/char/ns16550.c
+++ b/xen/drivers/char/ns16550.c
@@ -609,7 +609,7 @@ static void __init ns16550_init_postirq(struct serial_port *port)
         uart->irqaction.handler = ns16550_interrupt;
         uart->irqaction.name    = "ns16550";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
             printk("ERROR: Failed to allocate ns16550 IRQ %d\n", uart->irq);
     }
 
diff --git a/xen/drivers/char/omap-uart.c b/xen/drivers/char/omap-uart.c
index e598785..a798b8d 100644
--- a/xen/drivers/char/omap-uart.c
+++ b/xen/drivers/char/omap-uart.c
@@ -205,7 +205,7 @@ static void __init omap_uart_init_postirq(struct serial_port *port)
     uart->irqaction.name = "omap_uart";
     uart->irqaction.dev_id = port;
 
-    if ( setup_irq(uart->irq, &uart->irqaction) != 0 )
+    if ( setup_irq(uart->irq, 0, &uart->irqaction) != 0 )
     {
         dprintk(XENLOG_ERR, "Failed to allocated omap_uart IRQ %d\n",
                 uart->irq);
diff --git a/xen/drivers/char/pl011.c b/xen/drivers/char/pl011.c
index 89bda94..dd19ce8 100644
--- a/xen/drivers/char/pl011.c
+++ b/xen/drivers/char/pl011.c
@@ -137,7 +137,7 @@ static void __init pl011_init_postirq(struct serial_port *port)
         uart->irqaction.handler = pl011_interrupt;
         uart->irqaction.name    = "pl011";
         uart->irqaction.dev_id  = port;
-        if ( (rc = setup_irq(uart->irq, &uart->irqaction)) != 0 )
+        if ( (rc = setup_irq(uart->irq, 0, &uart->irqaction)) != 0 )
             printk("ERROR: Failed to allocate pl011 IRQ %d\n", uart->irq);
     }
 
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index ee8851a..b2f74ef 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -815,7 +815,7 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
         handler = &iommu_msi_type;
     ret = __setup_msi_irq(irq_to_desc(irq), &iommu->msi, handler);
     if ( !ret )
-        ret = request_irq(irq, iommu_interrupt_handler, "amd_iommu", iommu);
+        ret = request_irq(irq, 0, iommu_interrupt_handler, "amd_iommu", iommu);
     if ( ret )
     {
         destroy_irq(irq);
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index be6d324..431adb4 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1082,7 +1082,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd)
 
     desc = irq_to_desc(irq);
     desc->handler = &dma_msi_type;
-    ret = request_irq(irq, iommu_page_fault, "dmar", iommu);
+    ret = request_irq(irq, 0, iommu_page_fault, "dmar", iommu);
     if ( ret )
     {
         desc->handler = &no_irq_type;
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index 1f8bdb3..f9a18d8 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -89,9 +89,10 @@ int arch_init_one_irq_desc(struct irq_desc *);
 
 #define irq_desc_initialized(desc) ((desc)->handler != NULL)
 
-extern int setup_irq(unsigned int irq, struct irqaction *);
+extern int setup_irq(unsigned int irq, unsigned int irqflags,
+                     struct irqaction *);
 extern void release_irq(unsigned int irq, const void *dev_id);
-extern int request_irq(unsigned int irq,
+extern int request_irq(unsigned int irq, unsigned int irqflags,
                void (*handler)(int, void *, struct cpu_user_regs *),
                const char * devname, void *dev_id);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqugF-0003Yh-Fa; Sun, 01 Jun 2014 01:35:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugD-0003YT-MC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:21 +0000
Received: from [85.158.137.68:32058] by server-6.bemta-3.messagelabs.com id
	42/14-00470-8538A835; Sun, 01 Jun 2014 01:35:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1401586518!7225686!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26069 invoked from network); 1 Jun 2014 01:35:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugA-0001MX-NJ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugA-0001W3-LA
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:18 +0000
Date: Sun, 01 Jun 2014 01:35:18 +0000
Message-Id: <E1WqugA-0001W3-LA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: Handle multiple action
	per IRQ
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ba30e2bdc15918982242315717541bd76dd527e7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:32 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:02 2014 +0100

    xen/arm: IRQ: Handle multiple action per IRQ
    
    On ARM, it may happen (eg ARM SMMU) to setup multiple handler for the same
    interrupt.
    
    To be able to use multiple action, the driver has to explicitly call
    {setup,request}_irq with IRQF_SHARED as 2nd parameter.
    
    The behavior stays the same on x86, e.g only one action is handled.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c           |   79 +++++++++++++++++++++++++++++++++---------
 xen/include/asm-arm/config.h |    2 +
 xen/include/xen/irq.h        |    4 ++
 3 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 1b62d83..3a9a688 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -171,7 +171,6 @@ int request_irq(unsigned int irq, unsigned int irqflags,
 void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
 {
     struct irq_desc *desc = irq_to_desc(irq);
-    struct irqaction *action = desc->action;
 
     /* TODO: perfc_incr(irqs); */
 
@@ -182,7 +181,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
     spin_lock(&desc->lock);
     desc->handler->ack(desc);
 
-    if ( action == NULL )
+    if ( !desc->action )
     {
         printk("Unknown %s %#3.3x\n",
                is_fiq ? "FIQ" : "IRQ", irq);
@@ -214,12 +213,21 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
 
     desc->status |= IRQ_INPROGRESS;
 
-    action = desc->action;
     while ( desc->status & IRQ_PENDING )
     {
+        struct irqaction *action;
+
         desc->status &= ~IRQ_PENDING;
+        action = desc->action;
+
         spin_unlock_irq(&desc->lock);
-        action->handler(irq, action->dev_id, regs);
+
+        do
+        {
+            action->handler(irq, action->dev_id, regs);
+            action = action->next;
+        } while ( action );
+
         spin_lock_irq(&desc->lock);
     }
 
@@ -236,34 +244,71 @@ void release_irq(unsigned int irq, const void *dev_id)
 {
     struct irq_desc *desc;
     unsigned long flags;
-   struct irqaction *action;
+    struct irqaction *action, **action_ptr;
 
     desc = irq_to_desc(irq);
 
     spin_lock_irqsave(&desc->lock,flags);
 
-    desc->handler->shutdown(desc);
+    action_ptr = &desc->action;
+    for ( ;; )
+    {
+        action = *action_ptr;
+        if ( !action )
+        {
+            printk(XENLOG_WARNING "Trying to free already-free IRQ %u\n", irq);
+            spin_unlock_irqrestore(&desc->lock, flags);
+            return;
+        }
+
+        if ( action->dev_id == dev_id )
+            break;
+
+        action_ptr = &action->next;
+    }
+
+    /* Found it - remove it from the action list */
+    *action_ptr = action->next;
 
-    action = desc->action;
-    desc->action  = NULL;
-    desc->status &= ~IRQ_GUEST;
+    /* If this was the last action, shut down the IRQ */
+    if ( !desc->action )
+    {
+        desc->handler->shutdown(desc);
+        desc->status &= ~IRQ_GUEST;
+    }
 
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
     do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
 
-    if ( action && action->free_on_release )
+    if ( action->free_on_release )
         xfree(action);
 }
 
-static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
+static int __setup_irq(struct irq_desc *desc, unsigned int irqflags,
+                       struct irqaction *new)
 {
-    if ( desc->action != NULL )
-        return -EBUSY;
+    bool_t shared = !!(irqflags & IRQF_SHARED);
+
+    ASSERT(new != NULL);
+
+    /* Sanity checks:
+     *  - if the IRQ is marked as shared
+     *  - dev_id is not NULL when IRQF_SHARED is set
+     */
+    if ( desc->action != NULL && (!(desc->status & IRQF_SHARED) || !shared) )
+        return -EINVAL;
+    if ( shared && new->dev_id == NULL )
+        return -EINVAL;
+
+    if ( shared )
+        desc->status |= IRQF_SHARED;
 
-    desc->action  = new;
-    dsb(sy);
+    new->next = desc->action;
+    dsb(ish);
+    desc->action = new;
+    dsb(ish);
 
     return 0;
 }
@@ -291,7 +336,7 @@ int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
 
     disabled = (desc->action == NULL);
 
-    rc = __setup_irq(desc, new);
+    rc = __setup_irq(desc, irqflags, new);
     if ( rc )
         goto err;
 
@@ -355,7 +400,7 @@ int route_irq_to_guest(struct domain *d, unsigned int irq,
         goto out;
     }
 
-    retval = __setup_irq(desc, action);
+    retval = __setup_irq(desc, 0, action);
     if ( retval )
         goto out;
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index ef291ff..1c3abcf 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -37,6 +37,8 @@
 
 #define CONFIG_VIDEO 1
 
+#define CONFIG_IRQ_HAS_MULTIPLE_ACTION 1
+
 #define OPT_CONSOLE_STR "dtuart"
 
 #ifdef MAX_PHYS_CPUS
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index f9a18d8..40c0f3f 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -14,6 +14,9 @@ struct irqaction {
     const char *name;
     void *dev_id;
     bool_t free_on_release;
+#ifdef CONFIG_IRQ_HAS_MULTIPLE_ACTION
+    struct irqaction *next;
+#endif
 };
 
 /*
@@ -27,6 +30,7 @@ struct irqaction {
 #define IRQ_MOVE_PENDING  (1u<<5) /* IRQ is migrating to another CPUs */
 #define IRQ_PER_CPU       (1u<<6) /* IRQ is per CPU */
 #define IRQ_GUEST_EOI_PENDING (1u<<7) /* IRQ was disabled, pending a guest EOI */
+#define IRQF_SHARED       (1<<8)  /* IRQ is shared */
 
 /* Special IRQ numbers. */
 #define AUTO_ASSIGN_IRQ         (-1)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqugF-0003Yh-Fa; Sun, 01 Jun 2014 01:35:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugD-0003YT-MC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:21 +0000
Received: from [85.158.137.68:32058] by server-6.bemta-3.messagelabs.com id
	42/14-00470-8538A835; Sun, 01 Jun 2014 01:35:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1401586518!7225686!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26069 invoked from network); 1 Jun 2014 01:35:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugA-0001MX-NJ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugA-0001W3-LA
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:18 +0000
Date: Sun, 01 Jun 2014 01:35:18 +0000
Message-Id: <E1WqugA-0001W3-LA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: IRQ: Handle multiple action
	per IRQ
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ba30e2bdc15918982242315717541bd76dd527e7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri May 16 15:40:32 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 12:48:02 2014 +0100

    xen/arm: IRQ: Handle multiple action per IRQ
    
    On ARM, it may happen (eg ARM SMMU) to setup multiple handler for the same
    interrupt.
    
    To be able to use multiple action, the driver has to explicitly call
    {setup,request}_irq with IRQF_SHARED as 2nd parameter.
    
    The behavior stays the same on x86, e.g only one action is handled.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/irq.c           |   79 +++++++++++++++++++++++++++++++++---------
 xen/include/asm-arm/config.h |    2 +
 xen/include/xen/irq.h        |    4 ++
 3 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 1b62d83..3a9a688 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -171,7 +171,6 @@ int request_irq(unsigned int irq, unsigned int irqflags,
 void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
 {
     struct irq_desc *desc = irq_to_desc(irq);
-    struct irqaction *action = desc->action;
 
     /* TODO: perfc_incr(irqs); */
 
@@ -182,7 +181,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
     spin_lock(&desc->lock);
     desc->handler->ack(desc);
 
-    if ( action == NULL )
+    if ( !desc->action )
     {
         printk("Unknown %s %#3.3x\n",
                is_fiq ? "FIQ" : "IRQ", irq);
@@ -214,12 +213,21 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
 
     desc->status |= IRQ_INPROGRESS;
 
-    action = desc->action;
     while ( desc->status & IRQ_PENDING )
     {
+        struct irqaction *action;
+
         desc->status &= ~IRQ_PENDING;
+        action = desc->action;
+
         spin_unlock_irq(&desc->lock);
-        action->handler(irq, action->dev_id, regs);
+
+        do
+        {
+            action->handler(irq, action->dev_id, regs);
+            action = action->next;
+        } while ( action );
+
         spin_lock_irq(&desc->lock);
     }
 
@@ -236,34 +244,71 @@ void release_irq(unsigned int irq, const void *dev_id)
 {
     struct irq_desc *desc;
     unsigned long flags;
-   struct irqaction *action;
+    struct irqaction *action, **action_ptr;
 
     desc = irq_to_desc(irq);
 
     spin_lock_irqsave(&desc->lock,flags);
 
-    desc->handler->shutdown(desc);
+    action_ptr = &desc->action;
+    for ( ;; )
+    {
+        action = *action_ptr;
+        if ( !action )
+        {
+            printk(XENLOG_WARNING "Trying to free already-free IRQ %u\n", irq);
+            spin_unlock_irqrestore(&desc->lock, flags);
+            return;
+        }
+
+        if ( action->dev_id == dev_id )
+            break;
+
+        action_ptr = &action->next;
+    }
+
+    /* Found it - remove it from the action list */
+    *action_ptr = action->next;
 
-    action = desc->action;
-    desc->action  = NULL;
-    desc->status &= ~IRQ_GUEST;
+    /* If this was the last action, shut down the IRQ */
+    if ( !desc->action )
+    {
+        desc->handler->shutdown(desc);
+        desc->status &= ~IRQ_GUEST;
+    }
 
     spin_unlock_irqrestore(&desc->lock,flags);
 
     /* Wait to make sure it's not being used on another CPU */
     do { smp_mb(); } while ( desc->status & IRQ_INPROGRESS );
 
-    if ( action && action->free_on_release )
+    if ( action->free_on_release )
         xfree(action);
 }
 
-static int __setup_irq(struct irq_desc *desc, struct irqaction *new)
+static int __setup_irq(struct irq_desc *desc, unsigned int irqflags,
+                       struct irqaction *new)
 {
-    if ( desc->action != NULL )
-        return -EBUSY;
+    bool_t shared = !!(irqflags & IRQF_SHARED);
+
+    ASSERT(new != NULL);
+
+    /* Sanity checks:
+     *  - if the IRQ is marked as shared
+     *  - dev_id is not NULL when IRQF_SHARED is set
+     */
+    if ( desc->action != NULL && (!(desc->status & IRQF_SHARED) || !shared) )
+        return -EINVAL;
+    if ( shared && new->dev_id == NULL )
+        return -EINVAL;
+
+    if ( shared )
+        desc->status |= IRQF_SHARED;
 
-    desc->action  = new;
-    dsb(sy);
+    new->next = desc->action;
+    dsb(ish);
+    desc->action = new;
+    dsb(ish);
 
     return 0;
 }
@@ -291,7 +336,7 @@ int setup_irq(unsigned int irq, unsigned int irqflags, struct irqaction *new)
 
     disabled = (desc->action == NULL);
 
-    rc = __setup_irq(desc, new);
+    rc = __setup_irq(desc, irqflags, new);
     if ( rc )
         goto err;
 
@@ -355,7 +400,7 @@ int route_irq_to_guest(struct domain *d, unsigned int irq,
         goto out;
     }
 
-    retval = __setup_irq(desc, action);
+    retval = __setup_irq(desc, 0, action);
     if ( retval )
         goto out;
 
diff --git a/xen/include/asm-arm/config.h b/xen/include/asm-arm/config.h
index ef291ff..1c3abcf 100644
--- a/xen/include/asm-arm/config.h
+++ b/xen/include/asm-arm/config.h
@@ -37,6 +37,8 @@
 
 #define CONFIG_VIDEO 1
 
+#define CONFIG_IRQ_HAS_MULTIPLE_ACTION 1
+
 #define OPT_CONSOLE_STR "dtuart"
 
 #ifdef MAX_PHYS_CPUS
diff --git a/xen/include/xen/irq.h b/xen/include/xen/irq.h
index f9a18d8..40c0f3f 100644
--- a/xen/include/xen/irq.h
+++ b/xen/include/xen/irq.h
@@ -14,6 +14,9 @@ struct irqaction {
     const char *name;
     void *dev_id;
     bool_t free_on_release;
+#ifdef CONFIG_IRQ_HAS_MULTIPLE_ACTION
+    struct irqaction *next;
+#endif
 };
 
 /*
@@ -27,6 +30,7 @@ struct irqaction {
 #define IRQ_MOVE_PENDING  (1u<<5) /* IRQ is migrating to another CPUs */
 #define IRQ_PER_CPU       (1u<<6) /* IRQ is per CPU */
 #define IRQ_GUEST_EOI_PENDING (1u<<7) /* IRQ was disabled, pending a guest EOI */
+#define IRQF_SHARED       (1<<8)  /* IRQ is shared */
 
 /* Special IRQ numbers. */
 #define AUTO_ASSIGN_IRQ         (-1)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqugO-0003aZ-KE; Sun, 01 Jun 2014 01:35:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugN-0003aL-KA
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:31 +0000
Received: from [85.158.137.68:3189] by server-4.bemta-3.messagelabs.com id
	FE/6A-17399-2638A835; Sun, 01 Jun 2014 01:35:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1401586529!7285811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7977 invoked from network); 1 Jun 2014 01:35:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugK-0001Mg-TQ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugK-0001Wh-Rr
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:28 +0000
Date: Sun, 01 Jun 2014 01:35:28 +0000
Message-Id: <E1WqugK-0001Wh-Rr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Protect xc_domain_resume from
	clobbering domain registers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84acc84afbd1bd859cd31d44831db77da6ade960
Author:     Jason Andryuk <andryuk@aero.org>
AuthorDate: Tue May 20 09:37:08 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:02:28 2014 +0100

    libxc: Protect xc_domain_resume from clobbering domain registers
    
    xc_domain_resume() expects the guest to be in state SHUTDOWN_suspend.
    However, nothing verifies the state before modify_returncode() modifies
    the domain's registers.  This will crash guest processes or the kernel
    itself.
    
    This can be demonstrated with `LIBXL_SAVE_HELPER=/bin/false xl migrate`.
    
    Signed-off-by: Jason Andryuk <andryuk@aero.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_resume.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c
index 18b4818..e423814 100644
--- a/tools/libxc/xc_resume.c
+++ b/tools/libxc/xc_resume.c
@@ -33,12 +33,21 @@ static int modify_returncode(xc_interface *xch, uint32_t domid)
     struct domain_info_context *dinfo = &_dinfo;
     int rc;
 
-    if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 )
+    if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 ||
+         info.domid != domid )
     {
         PERROR("Could not get domain info");
         return -1;
     }
 
+    if ( !info.shutdown || (info.shutdown_reason != SHUTDOWN_suspend) )
+    {
+        ERROR("Dom %d not suspended: (shutdown %d, reason %d)", domid,
+              info.shutdown, info.shutdown_reason);
+        errno = EINVAL;
+        return -1;
+    }
+
     if ( info.hvm )
     {
         /* HVM guests without PV drivers have no return code to modify. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqugO-0003aZ-KE; Sun, 01 Jun 2014 01:35:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugN-0003aL-KA
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:31 +0000
Received: from [85.158.137.68:3189] by server-4.bemta-3.messagelabs.com id
	FE/6A-17399-2638A835; Sun, 01 Jun 2014 01:35:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1401586529!7285811!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7977 invoked from network); 1 Jun 2014 01:35:30 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugK-0001Mg-TQ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugK-0001Wh-Rr
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:28 +0000
Date: Sun, 01 Jun 2014 01:35:28 +0000
Message-Id: <E1WqugK-0001Wh-Rr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Protect xc_domain_resume from
	clobbering domain registers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84acc84afbd1bd859cd31d44831db77da6ade960
Author:     Jason Andryuk <andryuk@aero.org>
AuthorDate: Tue May 20 09:37:08 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:02:28 2014 +0100

    libxc: Protect xc_domain_resume from clobbering domain registers
    
    xc_domain_resume() expects the guest to be in state SHUTDOWN_suspend.
    However, nothing verifies the state before modify_returncode() modifies
    the domain's registers.  This will crash guest processes or the kernel
    itself.
    
    This can be demonstrated with `LIBXL_SAVE_HELPER=/bin/false xl migrate`.
    
    Signed-off-by: Jason Andryuk <andryuk@aero.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_resume.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_resume.c b/tools/libxc/xc_resume.c
index 18b4818..e423814 100644
--- a/tools/libxc/xc_resume.c
+++ b/tools/libxc/xc_resume.c
@@ -33,12 +33,21 @@ static int modify_returncode(xc_interface *xch, uint32_t domid)
     struct domain_info_context *dinfo = &_dinfo;
     int rc;
 
-    if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 )
+    if ( xc_domain_getinfo(xch, domid, 1, &info) != 1 ||
+         info.domid != domid )
     {
         PERROR("Could not get domain info");
         return -1;
     }
 
+    if ( !info.shutdown || (info.shutdown_reason != SHUTDOWN_suspend) )
+    {
+        ERROR("Dom %d not suspended: (shutdown %d, reason %d)", domid,
+              info.shutdown, info.shutdown_reason);
+        errno = EINVAL;
+        return -1;
+    }
+
     if ( info.hvm )
     {
         /* HVM guests without PV drivers have no return code to modify. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqugY-0003cE-NJ; Sun, 01 Jun 2014 01:35:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugX-0003bz-JV
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:41 +0000
Received: from [193.109.254.147:58881] by server-11.bemta-14.messagelabs.com
	id C7/4B-09902-C638A835; Sun, 01 Jun 2014 01:35:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586539!8293292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 843 invoked from network); 1 Jun 2014 01:35:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugV-0001Mm-3k
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugV-0001XN-1u
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:39 +0000
Date: Sun, 01 Jun 2014 01:35:39 +0000
Message-Id: <E1WqugV-0001XN-1u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/man/xl.cfg.pod.5: add a missing
	new line and remove some redundant ones
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5f54c8a041e68dedfed76aea6778d20b5026f232
Author:     Zhigang Wang <zhigang.x.wang@oracle.com>
AuthorDate: Tue May 20 13:44:25 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:04:57 2014 +0100

    docs/man/xl.cfg.pod.5: add a missing new line and remove some redundant ones
    
    Without a new line after the `pvh` item, the generate html is wrong.
    
    Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5 |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 0ca37bc..a94d037 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -620,7 +620,6 @@ must be given in hexadecimal.
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
-
 =item B<irqs=[ NUMBER, NUMBER, ... ]>
 
 Allow a guest to access specific physical IRQs.
@@ -702,6 +701,7 @@ it is safe to allow this to be enabled but you may wish to disable it
 anyway.
 
 =item B<pvh=BOOLEAN>
+
 Selects whether to run this PV guest in an HVM container. Default is 0.
 
 =back
@@ -944,7 +944,6 @@ preceded by a 32b integer indicating the size of the next structure.
 
 =item B<tsc_mode="MODE">
 
-
 Specifies how the TSC (Time Stamp Counter) should be provided to the
 guest (X86 only). Specifying this option as a number is
 deprecated. Options are:
@@ -990,7 +989,6 @@ i.e. set to UTC.
 
 Set the real time clock offset in seconds. False (0) by default.
 
-
 =item B<vpt_align=BOOLEAN>
 
 Specifies that periodic Virtual Platform Timers should be aligned to
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqugY-0003cE-NJ; Sun, 01 Jun 2014 01:35:42 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugX-0003bz-JV
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:41 +0000
Received: from [193.109.254.147:58881] by server-11.bemta-14.messagelabs.com
	id C7/4B-09902-C638A835; Sun, 01 Jun 2014 01:35:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586539!8293292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 843 invoked from network); 1 Jun 2014 01:35:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugV-0001Mm-3k
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqugV-0001XN-1u
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:39 +0000
Date: Sun, 01 Jun 2014 01:35:39 +0000
Message-Id: <E1WqugV-0001XN-1u@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs/man/xl.cfg.pod.5: add a missing
	new line and remove some redundant ones
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5f54c8a041e68dedfed76aea6778d20b5026f232
Author:     Zhigang Wang <zhigang.x.wang@oracle.com>
AuthorDate: Tue May 20 13:44:25 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:04:57 2014 +0100

    docs/man/xl.cfg.pod.5: add a missing new line and remove some redundant ones
    
    Without a new line after the `pvh` item, the generate html is wrong.
    
    Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5 |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index 0ca37bc..a94d037 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -620,7 +620,6 @@ must be given in hexadecimal.
 It is recommended to use this option only for trusted VMs under
 administrator control.
 
-
 =item B<irqs=[ NUMBER, NUMBER, ... ]>
 
 Allow a guest to access specific physical IRQs.
@@ -702,6 +701,7 @@ it is safe to allow this to be enabled but you may wish to disable it
 anyway.
 
 =item B<pvh=BOOLEAN>
+
 Selects whether to run this PV guest in an HVM container. Default is 0.
 
 =back
@@ -944,7 +944,6 @@ preceded by a 32b integer indicating the size of the next structure.
 
 =item B<tsc_mode="MODE">
 
-
 Specifies how the TSC (Time Stamp Counter) should be provided to the
 guest (X86 only). Specifying this option as a number is
 deprecated. Options are:
@@ -990,7 +989,6 @@ i.e. set to UTC.
 
 Set the real time clock offset in seconds. False (0) by default.
 
-
 =item B<vpt_align=BOOLEAN>
 
 Specifies that periodic Virtual Platform Timers should be aligned to
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqugj-0003eB-Pz; Sun, 01 Jun 2014 01:35:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugh-0003dr-RB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:52 +0000
Received: from [85.158.137.68:32478] by server-12.bemta-3.messagelabs.com id
	19/7E-14831-7738A835; Sun, 01 Jun 2014 01:35:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1401586549!7229675!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14103 invoked from network); 1 Jun 2014 01:35:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugf-0001Ms-8q
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugf-0001Y5-7b
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:49 +0000
Date: Sun, 01 Jun 2014 01:35:49 +0000
Message-Id: <E1Wqugf-0001Y5-7b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: check return values on mmap()
	and madvise() on xc_alloc_hypercall_buffer()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e86539a388314cd3dca88f5e69d7873343197cd8
Author:     Luis R. Rodriguez <mcgrof@suse.com>
AuthorDate: Tue May 20 05:37:35 2014 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:30:47 2014 +0100

    libxc: check return values on mmap() and madvise() on xc_alloc_hypercall_buffer()
    
    On a Thinkpad T4440p with OpenSUSE tumbleweed with v3.15-rc4
    and today's latest xen tip from the git tree strace -f reveals
    we end up on a never ending wait shortly after
    
    write(20, "backend/console/5\0", 18 <unfinished ...>
    
    This is right before we just wait on the qemu process which we
    had mmap'd for. Without this you'll end up getting stuck on a
    loop if mmap() worked but madvise() did not. While at it I noticed
    even the mmap() error fail was not being checked, fix that too.
    
    Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_linux_osdep.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 73860a2..86bff3e 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -92,14 +92,32 @@ static void *linux_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_ha
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
+    int rc, saved_errno;
 
     /* Address returned by mmap is page aligned. */
     p = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_LOCKED, -1, 0);
+    if ( p == MAP_FAILED )
+    {
+        PERROR("xc_alloc_hypercall_buffer: mmap failed");
+        return NULL;
+    }
 
     /* Do not copy the VMA to child process on fork. Avoid the page being COW
         on hypercall. */
-    madvise(p, npages * XC_PAGE_SIZE, MADV_DONTFORK);
+    rc = madvise(p, npages * XC_PAGE_SIZE, MADV_DONTFORK);
+    if ( rc < 0 )
+    {
+        PERROR("xc_alloc_hypercall_buffer: madvise failed");
+        goto out;
+    }
+
     return p;
+
+out:
+    saved_errno = errno;
+    (void)munmap(p, size);
+    errno = saved_errno;
+    return NULL;
 }
 
 static void linux_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:35:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:35:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqugj-0003eB-Pz; Sun, 01 Jun 2014 01:35:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugh-0003dr-RB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:52 +0000
Received: from [85.158.137.68:32478] by server-12.bemta-3.messagelabs.com id
	19/7E-14831-7738A835; Sun, 01 Jun 2014 01:35:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1401586549!7229675!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14103 invoked from network); 1 Jun 2014 01:35:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:35:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugf-0001Ms-8q
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugf-0001Y5-7b
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:49 +0000
Date: Sun, 01 Jun 2014 01:35:49 +0000
Message-Id: <E1Wqugf-0001Y5-7b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: check return values on mmap()
	and madvise() on xc_alloc_hypercall_buffer()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e86539a388314cd3dca88f5e69d7873343197cd8
Author:     Luis R. Rodriguez <mcgrof@suse.com>
AuthorDate: Tue May 20 05:37:35 2014 -0700
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:30:47 2014 +0100

    libxc: check return values on mmap() and madvise() on xc_alloc_hypercall_buffer()
    
    On a Thinkpad T4440p with OpenSUSE tumbleweed with v3.15-rc4
    and today's latest xen tip from the git tree strace -f reveals
    we end up on a never ending wait shortly after
    
    write(20, "backend/console/5\0", 18 <unfinished ...>
    
    This is right before we just wait on the qemu process which we
    had mmap'd for. Without this you'll end up getting stuck on a
    loop if mmap() worked but madvise() did not. While at it I noticed
    even the mmap() error fail was not being checked, fix that too.
    
    Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_linux_osdep.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c
index 73860a2..86bff3e 100644
--- a/tools/libxc/xc_linux_osdep.c
+++ b/tools/libxc/xc_linux_osdep.c
@@ -92,14 +92,32 @@ static void *linux_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_ha
 {
     size_t size = npages * XC_PAGE_SIZE;
     void *p;
+    int rc, saved_errno;
 
     /* Address returned by mmap is page aligned. */
     p = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_LOCKED, -1, 0);
+    if ( p == MAP_FAILED )
+    {
+        PERROR("xc_alloc_hypercall_buffer: mmap failed");
+        return NULL;
+    }
 
     /* Do not copy the VMA to child process on fork. Avoid the page being COW
         on hypercall. */
-    madvise(p, npages * XC_PAGE_SIZE, MADV_DONTFORK);
+    rc = madvise(p, npages * XC_PAGE_SIZE, MADV_DONTFORK);
+    if ( rc < 0 )
+    {
+        PERROR("xc_alloc_hypercall_buffer: madvise failed");
+        goto out;
+    }
+
     return p;
+
+out:
+    saved_errno = errno;
+    (void)munmap(p, size);
+    errno = saved_errno;
+    return NULL;
 }
 
 static void linux_privcmd_free_hypercall_buffer(xc_interface *xch, xc_osdep_handle h, void *ptr, int npages)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqugt-0003fz-Ss; Sun, 01 Jun 2014 01:36:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugs-0003fi-Bi
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:02 +0000
Received: from [193.109.254.147:36855] by server-12.bemta-14.messagelabs.com
	id 21/CF-27473-1838A835; Sun, 01 Jun 2014 01:36:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586559!8293322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1932 invoked from network); 1 Jun 2014 01:36:00 -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;
	1 Jun 2014 01:36:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugp-0001N1-FG
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugp-0001Yq-Dr
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:59 +0000
Date: Sun, 01 Jun 2014 01:35:59 +0000
Message-Id: <E1Wqugp-0001Yq-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Clean cache PT when the
	IOMMU doesn't support coherent walk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4c5f4cb78cec23411ab02353a93c3d2263dea47a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon May 19 17:23:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:53:21 2014 +0100

    xen/arm: p2m: Clean cache PT when the IOMMU doesn't support coherent walk
    
    Some IOMMU don't suppport coherent PT walk. When the p2m is shared with
    the CPU, Xen has to make sure the PT changes have reached the memory.
    
    Introduce new IOMMU function that will check if the IOMMU feature is enabled
    for a specified domain.
    
    On ARM, the platform can contain multiple IOMMUs. Each of them may not
    have the same set of feature. The domain parameter will be used to get the
    set of features for IOMMUs used by this domain.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c               |   10 ++++++++
 xen/arch/arm/p2m.c              |   46 +++++++++++++++++++++++++-------------
 xen/drivers/passthrough/iommu.c |   10 ++++++++
 xen/include/asm-arm/mm.h        |    3 ++
 xen/include/xen/hvm/iommu.h     |    6 +++++
 xen/include/xen/iommu.h         |    9 +++++++
 6 files changed, 68 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index eac228c..7e8e06a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1235,6 +1235,16 @@ int is_iomem_page(unsigned long mfn)
         return 1;
     return 0;
 }
+
+void clear_and_clean_page(struct page_info *page)
+{
+    void *p = __map_domain_page(page);
+
+    clear_page(p);
+    clean_xen_dcache_va_range(p, PAGE_SIZE);
+    unmap_domain_page(p);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index b85143b..96bc0ef 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -253,9 +253,15 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
     return e;
 }
 
+static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool_t flush_cache)
+{
+    write_pte(p, pte);
+    if ( flush_cache )
+        clean_xen_dcache(*p);
+}
+
 /* Allocate a new page table page and hook it in via the given entry */
-static int p2m_create_table(struct domain *d,
-                            lpae_t *entry)
+static int p2m_create_table(struct domain *d, lpae_t *entry, bool_t flush_cache)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     struct page_info *page;
@@ -272,11 +278,13 @@ static int p2m_create_table(struct domain *d,
 
     p = __map_domain_page(page);
     clear_page(p);
+    if ( flush_cache )
+        clean_xen_dcache_va_range(p, PAGE_SIZE);
     unmap_domain_page(p);
 
     pte = mfn_to_p2m_entry(page_to_mfn(page), MATTR_MEM, p2m_invalid);
 
-    write_pte(entry, pte);
+    p2m_write_pte(entry, pte, flush_cache);
 
     return 0;
 }
@@ -308,6 +316,13 @@ static int apply_p2m_changes(struct domain *d,
     unsigned int flush = 0;
     bool_t populate = (op == INSERT || op == ALLOCATE);
     lpae_t pte;
+    bool_t flush_pt;
+
+    /* Some IOMMU don't support coherent PT walk. When the p2m is
+     * shared with the CPU, Xen has to make sure that the PT changes have
+     * reached the memory
+     */
+    flush_pt = iommu_enabled && !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
 
     spin_lock(&p2m->lock);
 
@@ -334,7 +349,8 @@ static int apply_p2m_changes(struct domain *d,
                 continue;
             }
 
-            rc = p2m_create_table(d, &first[first_table_offset(addr)]);
+            rc = p2m_create_table(d, &first[first_table_offset(addr)],
+                                  flush_pt);
             if ( rc < 0 )
             {
                 printk("p2m_populate_ram: L1 failed\n");
@@ -360,7 +376,8 @@ static int apply_p2m_changes(struct domain *d,
                 continue;
             }
 
-            rc = p2m_create_table(d, &second[second_table_offset(addr)]);
+            rc = p2m_create_table(d, &second[second_table_offset(addr)],
+                                  flush_pt);
             if ( rc < 0 ) {
                 printk("p2m_populate_ram: L2 failed\n");
                 goto out;
@@ -411,13 +428,15 @@ static int apply_p2m_changes(struct domain *d,
 
                     pte = mfn_to_p2m_entry(page_to_mfn(page), mattr, t);
 
-                    write_pte(&third[third_table_offset(addr)], pte);
+                    p2m_write_pte(&third[third_table_offset(addr)],
+                                  pte, flush_pt);
                 }
                 break;
             case INSERT:
                 {
                     pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr, t);
-                    write_pte(&third[third_table_offset(addr)], pte);
+                    p2m_write_pte(&third[third_table_offset(addr)],
+                                  pte, flush_pt);
                     maddr += PAGE_SIZE;
                 }
                 break;
@@ -433,7 +452,8 @@ static int apply_p2m_changes(struct domain *d,
                     count += 0x10;
 
                     memset(&pte, 0x00, sizeof(pte));
-                    write_pte(&third[third_table_offset(addr)], pte);
+                    p2m_write_pte(&third[third_table_offset(addr)],
+                                  pte, flush_pt);
                     count++;
                 }
                 break;
@@ -537,7 +557,6 @@ int p2m_alloc_table(struct domain *d)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     struct page_info *page;
-    void *p;
 
     page = alloc_domheap_pages(NULL, P2M_FIRST_ORDER, 0);
     if ( page == NULL )
@@ -546,13 +565,8 @@ int p2m_alloc_table(struct domain *d)
     spin_lock(&p2m->lock);
 
     /* Clear both first level pages */
-    p = __map_domain_page(page);
-    clear_page(p);
-    unmap_domain_page(p);
-
-    p = __map_domain_page(page + 1);
-    clear_page(p);
-    unmap_domain_page(p);
+    clear_and_clean_page(page);
+    clear_and_clean_page(page + 1);
 
     p2m->first_level = page;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 59f1c3e..cc12735 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -344,6 +344,16 @@ void iommu_crash_shutdown(void)
     iommu_enabled = iommu_intremap = 0;
 }
 
+bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature)
+{
+    const struct hvm_iommu *hd = domain_hvm_iommu(d);
+
+    if ( !iommu_enabled )
+        return 0;
+
+    return test_bit(feature, hd->features);
+}
+
 static void iommu_dump_p2m_table(unsigned char key)
 {
     struct domain *d;
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index b8d4e7d..3bef93f 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -5,6 +5,7 @@
 #include <xen/kernel.h>
 #include <asm/page.h>
 #include <public/xen.h>
+#include <xen/domain_page.h>
 
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
@@ -341,6 +342,8 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
+void clear_and_clean_page(struct page_info *page);
+
 #endif /*  __ARCH_ARM_MM__ */
 /*
  * Local variables:
diff --git a/xen/include/xen/hvm/iommu.h b/xen/include/xen/hvm/iommu.h
index 1259e16..693346c 100644
--- a/xen/include/xen/hvm/iommu.h
+++ b/xen/include/xen/hvm/iommu.h
@@ -34,6 +34,12 @@ struct hvm_iommu {
     /* List of DT devices assigned to this domain */
     struct list_head dt_devices;
 #endif
+
+    /* Features supported by the IOMMU */
+    DECLARE_BITMAP(features, IOMMU_FEAT_count);
 };
 
+#define iommu_set_feature(d, f)   set_bit((f), domain_hvm_iommu(d)->features)
+#define iommu_clear_feature(d, f) clear_bit((f), domain_hvm_iommu(d)->features)
+
 #endif /* __XEN_HVM_IOMMU_H__ */
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index b7481dac..2ec7834 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -67,6 +67,15 @@ int iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
                    unsigned int flags);
 int iommu_unmap_page(struct domain *d, unsigned long gfn);
 
+enum iommu_feature
+{
+    IOMMU_FEAT_COHERENT_WALK,
+    IOMMU_FEAT_count
+};
+
+bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature);
+
+
 #ifdef HAS_PCI
 void pt_pci_init(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqugt-0003fz-Ss; Sun, 01 Jun 2014 01:36:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugs-0003fi-Bi
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:02 +0000
Received: from [193.109.254.147:36855] by server-12.bemta-14.messagelabs.com
	id 21/CF-27473-1838A835; Sun, 01 Jun 2014 01:36:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1401586559!8293322!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1932 invoked from network); 1 Jun 2014 01:36:00 -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;
	1 Jun 2014 01:36:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugp-0001N1-FG
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugp-0001Yq-Dr
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:35:59 +0000
Date: Sun, 01 Jun 2014 01:35:59 +0000
Message-Id: <E1Wqugp-0001Yq-Dr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: p2m: Clean cache PT when the
	IOMMU doesn't support coherent walk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4c5f4cb78cec23411ab02353a93c3d2263dea47a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon May 19 17:23:57 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:53:21 2014 +0100

    xen/arm: p2m: Clean cache PT when the IOMMU doesn't support coherent walk
    
    Some IOMMU don't suppport coherent PT walk. When the p2m is shared with
    the CPU, Xen has to make sure the PT changes have reached the memory.
    
    Introduce new IOMMU function that will check if the IOMMU feature is enabled
    for a specified domain.
    
    On ARM, the platform can contain multiple IOMMUs. Each of them may not
    have the same set of feature. The domain parameter will be used to get the
    set of features for IOMMUs used by this domain.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/mm.c               |   10 ++++++++
 xen/arch/arm/p2m.c              |   46 +++++++++++++++++++++++++-------------
 xen/drivers/passthrough/iommu.c |   10 ++++++++
 xen/include/asm-arm/mm.h        |    3 ++
 xen/include/xen/hvm/iommu.h     |    6 +++++
 xen/include/xen/iommu.h         |    9 +++++++
 6 files changed, 68 insertions(+), 16 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index eac228c..7e8e06a 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1235,6 +1235,16 @@ int is_iomem_page(unsigned long mfn)
         return 1;
     return 0;
 }
+
+void clear_and_clean_page(struct page_info *page)
+{
+    void *p = __map_domain_page(page);
+
+    clear_page(p);
+    clean_xen_dcache_va_range(p, PAGE_SIZE);
+    unmap_domain_page(p);
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index b85143b..96bc0ef 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -253,9 +253,15 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
     return e;
 }
 
+static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool_t flush_cache)
+{
+    write_pte(p, pte);
+    if ( flush_cache )
+        clean_xen_dcache(*p);
+}
+
 /* Allocate a new page table page and hook it in via the given entry */
-static int p2m_create_table(struct domain *d,
-                            lpae_t *entry)
+static int p2m_create_table(struct domain *d, lpae_t *entry, bool_t flush_cache)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     struct page_info *page;
@@ -272,11 +278,13 @@ static int p2m_create_table(struct domain *d,
 
     p = __map_domain_page(page);
     clear_page(p);
+    if ( flush_cache )
+        clean_xen_dcache_va_range(p, PAGE_SIZE);
     unmap_domain_page(p);
 
     pte = mfn_to_p2m_entry(page_to_mfn(page), MATTR_MEM, p2m_invalid);
 
-    write_pte(entry, pte);
+    p2m_write_pte(entry, pte, flush_cache);
 
     return 0;
 }
@@ -308,6 +316,13 @@ static int apply_p2m_changes(struct domain *d,
     unsigned int flush = 0;
     bool_t populate = (op == INSERT || op == ALLOCATE);
     lpae_t pte;
+    bool_t flush_pt;
+
+    /* Some IOMMU don't support coherent PT walk. When the p2m is
+     * shared with the CPU, Xen has to make sure that the PT changes have
+     * reached the memory
+     */
+    flush_pt = iommu_enabled && !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
 
     spin_lock(&p2m->lock);
 
@@ -334,7 +349,8 @@ static int apply_p2m_changes(struct domain *d,
                 continue;
             }
 
-            rc = p2m_create_table(d, &first[first_table_offset(addr)]);
+            rc = p2m_create_table(d, &first[first_table_offset(addr)],
+                                  flush_pt);
             if ( rc < 0 )
             {
                 printk("p2m_populate_ram: L1 failed\n");
@@ -360,7 +376,8 @@ static int apply_p2m_changes(struct domain *d,
                 continue;
             }
 
-            rc = p2m_create_table(d, &second[second_table_offset(addr)]);
+            rc = p2m_create_table(d, &second[second_table_offset(addr)],
+                                  flush_pt);
             if ( rc < 0 ) {
                 printk("p2m_populate_ram: L2 failed\n");
                 goto out;
@@ -411,13 +428,15 @@ static int apply_p2m_changes(struct domain *d,
 
                     pte = mfn_to_p2m_entry(page_to_mfn(page), mattr, t);
 
-                    write_pte(&third[third_table_offset(addr)], pte);
+                    p2m_write_pte(&third[third_table_offset(addr)],
+                                  pte, flush_pt);
                 }
                 break;
             case INSERT:
                 {
                     pte = mfn_to_p2m_entry(maddr >> PAGE_SHIFT, mattr, t);
-                    write_pte(&third[third_table_offset(addr)], pte);
+                    p2m_write_pte(&third[third_table_offset(addr)],
+                                  pte, flush_pt);
                     maddr += PAGE_SIZE;
                 }
                 break;
@@ -433,7 +452,8 @@ static int apply_p2m_changes(struct domain *d,
                     count += 0x10;
 
                     memset(&pte, 0x00, sizeof(pte));
-                    write_pte(&third[third_table_offset(addr)], pte);
+                    p2m_write_pte(&third[third_table_offset(addr)],
+                                  pte, flush_pt);
                     count++;
                 }
                 break;
@@ -537,7 +557,6 @@ int p2m_alloc_table(struct domain *d)
 {
     struct p2m_domain *p2m = &d->arch.p2m;
     struct page_info *page;
-    void *p;
 
     page = alloc_domheap_pages(NULL, P2M_FIRST_ORDER, 0);
     if ( page == NULL )
@@ -546,13 +565,8 @@ int p2m_alloc_table(struct domain *d)
     spin_lock(&p2m->lock);
 
     /* Clear both first level pages */
-    p = __map_domain_page(page);
-    clear_page(p);
-    unmap_domain_page(p);
-
-    p = __map_domain_page(page + 1);
-    clear_page(p);
-    unmap_domain_page(p);
+    clear_and_clean_page(page);
+    clear_and_clean_page(page + 1);
 
     p2m->first_level = page;
 
diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index 59f1c3e..cc12735 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -344,6 +344,16 @@ void iommu_crash_shutdown(void)
     iommu_enabled = iommu_intremap = 0;
 }
 
+bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature)
+{
+    const struct hvm_iommu *hd = domain_hvm_iommu(d);
+
+    if ( !iommu_enabled )
+        return 0;
+
+    return test_bit(feature, hd->features);
+}
+
 static void iommu_dump_p2m_table(unsigned char key)
 {
     struct domain *d;
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index b8d4e7d..3bef93f 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -5,6 +5,7 @@
 #include <xen/kernel.h>
 #include <asm/page.h>
 #include <public/xen.h>
+#include <xen/domain_page.h>
 
 /* Align Xen to a 2 MiB boundary. */
 #define XEN_PADDR_ALIGN (1 << 21)
@@ -341,6 +342,8 @@ static inline void put_page_and_type(struct page_info *page)
     put_page(page);
 }
 
+void clear_and_clean_page(struct page_info *page);
+
 #endif /*  __ARCH_ARM_MM__ */
 /*
  * Local variables:
diff --git a/xen/include/xen/hvm/iommu.h b/xen/include/xen/hvm/iommu.h
index 1259e16..693346c 100644
--- a/xen/include/xen/hvm/iommu.h
+++ b/xen/include/xen/hvm/iommu.h
@@ -34,6 +34,12 @@ struct hvm_iommu {
     /* List of DT devices assigned to this domain */
     struct list_head dt_devices;
 #endif
+
+    /* Features supported by the IOMMU */
+    DECLARE_BITMAP(features, IOMMU_FEAT_count);
 };
 
+#define iommu_set_feature(d, f)   set_bit((f), domain_hvm_iommu(d)->features)
+#define iommu_clear_feature(d, f) clear_bit((f), domain_hvm_iommu(d)->features)
+
 #endif /* __XEN_HVM_IOMMU_H__ */
diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index b7481dac..2ec7834 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -67,6 +67,15 @@ int iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
                    unsigned int flags);
 int iommu_unmap_page(struct domain *d, unsigned long gfn);
 
+enum iommu_feature
+{
+    IOMMU_FEAT_COHERENT_WALK,
+    IOMMU_FEAT_count
+};
+
+bool_t iommu_has_feature(struct domain *d, enum iommu_feature feature);
+
+
 #ifdef HAS_PCI
 void pt_pci_init(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquh3-0003hZ-Vr; Sun, 01 Jun 2014 01:36:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquh2-0003hL-Bi
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:12 +0000
Received: from [85.158.137.68:3757] by server-3.bemta-3.messagelabs.com id
	12/D5-08149-B838A835; Sun, 01 Jun 2014 01:36:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1401586569!7238433!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29551 invoked from network); 1 Jun 2014 01:36:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugz-0001Nb-LC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugz-0001Zg-JB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:09 +0000
Date: Sun, 01 Jun 2014 01:36:09 +0000
Message-Id: <E1Wqugz-0001Zg-JB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: iommu: Define PAGE_{SHIFT, SIZE,
	ALIGN, MASK)_64K
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81bccf87465e0e7db0061c6c7aecfe0e0f5ef4c9
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon May 19 17:23:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:53:32 2014 +0100

    xen: iommu: Define PAGE_{SHIFT, SIZE, ALIGN, MASK)_64K
    
    Also add IOMMU_PAGE_* helper macros to help creating PAGE_* defines.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/iommu.h |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 2ec7834..8eb764a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -35,10 +35,19 @@ extern bool_t iommu_hap_pt_share;
 extern bool_t iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
 
+#define IOMMU_PAGE_SIZE(sz) (1UL << PAGE_SHIFT_##sz)
+#define IOMMU_PAGE_MASK(sz) (~(u64)0 << PAGE_SHIFT_##sz)
+#define IOMMU_PAGE_ALIGN(sz, addr)  (((addr) + ~PAGE_MASK_##sz) & PAGE_MASK_##sz)
+
 #define PAGE_SHIFT_4K       (12)
-#define PAGE_SIZE_4K        (1UL << PAGE_SHIFT_4K)
-#define PAGE_MASK_4K        (((u64)-1) << PAGE_SHIFT_4K)
-#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
+#define PAGE_SIZE_4K        IOMMU_PAGE_SIZE(4K)
+#define PAGE_MASK_4K        IOMMU_PAGE_MASK(4K)
+#define PAGE_ALIGN_4K(addr) IOMMU_PAGE_ALIGN(4K, addr)
+
+#define PAGE_SHIFT_64K          (16)
+#define PAGE_SIZE_64K           IOMMU_PAGE_SIZE(64K)
+#define PAGE_MASK_64K           IOMMU_PAGE_MASK(64K)
+#define PAGE_ALIGN_64K(addr)    IOMMU_PAGE_ALIGN(64K, addr)
 
 int iommu_setup(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquh3-0003hZ-Vr; Sun, 01 Jun 2014 01:36:13 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquh2-0003hL-Bi
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:12 +0000
Received: from [85.158.137.68:3757] by server-3.bemta-3.messagelabs.com id
	12/D5-08149-B838A835; Sun, 01 Jun 2014 01:36:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1401586569!7238433!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29551 invoked from network); 1 Jun 2014 01:36:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugz-0001Nb-LC
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqugz-0001Zg-JB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:09 +0000
Date: Sun, 01 Jun 2014 01:36:09 +0000
Message-Id: <E1Wqugz-0001Zg-JB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: iommu: Define PAGE_{SHIFT, SIZE,
	ALIGN, MASK)_64K
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81bccf87465e0e7db0061c6c7aecfe0e0f5ef4c9
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon May 19 17:23:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 13:53:32 2014 +0100

    xen: iommu: Define PAGE_{SHIFT, SIZE, ALIGN, MASK)_64K
    
    Also add IOMMU_PAGE_* helper macros to help creating PAGE_* defines.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/xen/iommu.h |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h
index 2ec7834..8eb764a 100644
--- a/xen/include/xen/iommu.h
+++ b/xen/include/xen/iommu.h
@@ -35,10 +35,19 @@ extern bool_t iommu_hap_pt_share;
 extern bool_t iommu_debug;
 extern bool_t amd_iommu_perdev_intremap;
 
+#define IOMMU_PAGE_SIZE(sz) (1UL << PAGE_SHIFT_##sz)
+#define IOMMU_PAGE_MASK(sz) (~(u64)0 << PAGE_SHIFT_##sz)
+#define IOMMU_PAGE_ALIGN(sz, addr)  (((addr) + ~PAGE_MASK_##sz) & PAGE_MASK_##sz)
+
 #define PAGE_SHIFT_4K       (12)
-#define PAGE_SIZE_4K        (1UL << PAGE_SHIFT_4K)
-#define PAGE_MASK_4K        (((u64)-1) << PAGE_SHIFT_4K)
-#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K)
+#define PAGE_SIZE_4K        IOMMU_PAGE_SIZE(4K)
+#define PAGE_MASK_4K        IOMMU_PAGE_MASK(4K)
+#define PAGE_ALIGN_4K(addr) IOMMU_PAGE_ALIGN(4K, addr)
+
+#define PAGE_SHIFT_64K          (16)
+#define PAGE_SIZE_64K           IOMMU_PAGE_SIZE(64K)
+#define PAGE_MASK_64K           IOMMU_PAGE_MASK(64K)
+#define PAGE_ALIGN_64K(addr)    IOMMU_PAGE_ALIGN(64K, addr)
 
 int iommu_setup(void);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquhE-0003j3-2S; Sun, 01 Jun 2014 01:36:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhC-0003io-Fb
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:22 +0000
Received: from [85.158.139.211:14463] by server-12.bemta-5.messagelabs.com id
	AF/16-03824-5938A835; Sun, 01 Jun 2014 01:36:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1401586580!7394907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30153 invoked from network); 1 Jun 2014 01:36:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquh9-0001Nk-R7
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquh9-0001b0-P6
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:19 +0000
Date: Sun, 01 Jun 2014 01:36:19 +0000
Message-Id: <E1Wquh9-0001b0-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/linux: Fix the vif script to
	handle_iptable for tap interfaces
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b08834a20e482be4771b5120b58b7dfee675e67b
Author:     Sylvain Munaut <s.munaut@whatever-company.com>
AuthorDate: Tue May 20 16:56:43 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 14:02:27 2014 +0100

    hotplug/linux: Fix the vif script to handle_iptable for tap interfaces
    
    The TAP interfaces need the same iptables rules as the VIF, without it,
    traffic will not be forwarded to/from them is the default FORWARD policy
    is DROP/REJECT
    
    Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/vif-bridge    |    4 +---
 tools/hotplug/Linux/vif-common.sh |    4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index b7dcbd6..df44789 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -97,9 +97,7 @@ case "$command" in
         ;;
 esac
 
-if [ "$type_if" = vif ]; then
-    handle_iptable
-fi
+handle_iptable
 
 call_hooks vif post
 
diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh
index 73ee241..28ddae5 100644
--- a/tools/hotplug/Linux/vif-common.sh
+++ b/tools/hotplug/Linux/vif-common.sh
@@ -123,7 +123,7 @@ ip=$(xenstore_read_default "$XENBUS_PATH/ip" "$ip")
 
 frob_iptable()
 {
-  if [ "$command" == "online" ]
+  if [ "$command" == "online" -o "$command" == "add" ]
   then
     local c="-I"
   else
@@ -135,7 +135,7 @@ frob_iptable()
   iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-out "$dev" \
     -j ACCEPT 2>/dev/null
 
-  if [ "$command" == "online" -a $? -ne 0 ]
+  if [ \( "$command" == "online" -o "$command" == "add" \) -a $? -ne 0 ]
   then
     log err "iptables setup failed. This may affect guest networking."
   fi
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquhE-0003j3-2S; Sun, 01 Jun 2014 01:36:24 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhC-0003io-Fb
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:22 +0000
Received: from [85.158.139.211:14463] by server-12.bemta-5.messagelabs.com id
	AF/16-03824-5938A835; Sun, 01 Jun 2014 01:36:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1401586580!7394907!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30153 invoked from network); 1 Jun 2014 01:36:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquh9-0001Nk-R7
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquh9-0001b0-P6
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:19 +0000
Date: Sun, 01 Jun 2014 01:36:19 +0000
Message-Id: <E1Wquh9-0001b0-P6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug/linux: Fix the vif script to
	handle_iptable for tap interfaces
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b08834a20e482be4771b5120b58b7dfee675e67b
Author:     Sylvain Munaut <s.munaut@whatever-company.com>
AuthorDate: Tue May 20 16:56:43 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed May 21 14:02:27 2014 +0100

    hotplug/linux: Fix the vif script to handle_iptable for tap interfaces
    
    The TAP interfaces need the same iptables rules as the VIF, without it,
    traffic will not be forwarded to/from them is the default FORWARD policy
    is DROP/REJECT
    
    Signed-off-by: Sylvain Munaut <s.munaut@whatever-company.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/Linux/vif-bridge    |    4 +---
 tools/hotplug/Linux/vif-common.sh |    4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge
index b7dcbd6..df44789 100644
--- a/tools/hotplug/Linux/vif-bridge
+++ b/tools/hotplug/Linux/vif-bridge
@@ -97,9 +97,7 @@ case "$command" in
         ;;
 esac
 
-if [ "$type_if" = vif ]; then
-    handle_iptable
-fi
+handle_iptable
 
 call_hooks vif post
 
diff --git a/tools/hotplug/Linux/vif-common.sh b/tools/hotplug/Linux/vif-common.sh
index 73ee241..28ddae5 100644
--- a/tools/hotplug/Linux/vif-common.sh
+++ b/tools/hotplug/Linux/vif-common.sh
@@ -123,7 +123,7 @@ ip=$(xenstore_read_default "$XENBUS_PATH/ip" "$ip")
 
 frob_iptable()
 {
-  if [ "$command" == "online" ]
+  if [ "$command" == "online" -o "$command" == "add" ]
   then
     local c="-I"
   else
@@ -135,7 +135,7 @@ frob_iptable()
   iptables "$c" FORWARD -m physdev --physdev-is-bridged --physdev-out "$dev" \
     -j ACCEPT 2>/dev/null
 
-  if [ "$command" == "online" -a $? -ne 0 ]
+  if [ \( "$command" == "online" -o "$command" == "add" \) -a $? -ne 0 ]
   then
     log err "iptables setup failed. This may affect guest networking."
   fi
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:35 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquhP-0003l0-74; Sun, 01 Jun 2014 01:36:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhN-0003kl-Kb
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:33 +0000
Received: from [85.158.139.211:26217] by server-17.bemta-5.messagelabs.com id
	82/C5-09046-0A38A835; Sun, 01 Jun 2014 01:36:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1401586590!7391331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19188 invoked from network); 1 Jun 2014 01:36:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhK-0001Ns-0T
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhJ-0001bb-VB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:29 +0000
Date: Sun, 01 Jun 2014 01:36:29 +0000
Message-Id: <E1WquhJ-0001bb-VB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: also cover PCI MMIO ranges
	above 4G with UC MTRR ranges
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d06886694328a31369addc1f614cf326728d65a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 21 18:13:36 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 21 18:13:36 2014 +0200

    hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges
    
    When adding support for BAR assignments to addresses above 4G, the MTRR
    side of things was left out.
    
    Additionally the MMIO ranges in the DSDT's \_SB.PCI0._CRS were having
    memory types not matching the ones put into MTRRs: The legacy VGA range
    is supposed to be WC, and the other ones should be UC.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/acpi/build.c  |    6 ++++++
 tools/firmware/hvmloader/acpi/dsdt.asl |   32 ++++++++++++++++++++++++++++----
 tools/firmware/hvmloader/cacheattr.c   |   21 +++++++++++++++++----
 tools/firmware/hvmloader/config.h      |    2 +-
 tools/firmware/hvmloader/pci.c         |   16 +++++++++++++---
 5 files changed, 65 insertions(+), 12 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c
index f1dd3f0..5c42d89 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -51,6 +51,7 @@ struct acpi_info {
     uint32_t madt_csum_addr;    /* 12   - Address of MADT checksum */
     uint32_t madt_lapic0_addr;  /* 16   - Address of first MADT LAPIC struct */
     uint32_t vm_gid_addr;       /* 20   - Address of VM generation id buffer */
+    uint64_t pci_hi_min, pci_hi_len; /* 24, 32 - PCI I/O hole boundaries */
 };
 
 /* Number of processor objects in the chosen DSDT. */
@@ -525,6 +526,11 @@ void acpi_build_tables(struct acpi_config *config, unsigned int physical)
     acpi_info->hpet_present = hpet_exists(ACPI_HPET_ADDRESS);
     acpi_info->pci_min = pci_mem_start;
     acpi_info->pci_len = pci_mem_end - pci_mem_start;
+    if ( pci_hi_mem_end > pci_hi_mem_start )
+    {
+        acpi_info->pci_hi_min = pci_hi_mem_start;
+        acpi_info->pci_hi_len = pci_hi_mem_end - pci_hi_mem_start;
+    }
 
     return;
 
diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 247a8ad..958ebb1 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -45,7 +45,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
     Scope (\_SB)
     {
        /* ACPI_INFO_PHYSICAL_ADDRESS == 0xFC000000 */
-       OperationRegion(BIOS, SystemMemory, 0xFC000000, 24)
+       OperationRegion(BIOS, SystemMemory, 0xFC000000, 40)
        Field(BIOS, ByteAcc, NoLock, Preserve) {
            UAR1, 1,
            UAR2, 1,
@@ -56,7 +56,9 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
            PLEN, 32,
            MSUA, 32, /* MADT checksum address */
            MAPA, 32, /* MADT LAPIC0 address */
-           VGIA, 32  /* VM generation id address */
+           VGIA, 32, /* VM generation id address */
+           HMIN, 64,
+           HLEN, 64
        }
 
         /* Fix HCT test for 0x400 pci memory:
@@ -136,7 +138,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                     /* reserve memory for pci devices */
                     DWordMemory(
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
-                        Cacheable, ReadWrite,
+                        WriteCombining, ReadWrite,
                         0x00000000,
                         0x000A0000,
                         0x000BFFFF,
@@ -145,13 +147,24 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
 
                     DWordMemory(
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
-                        Cacheable, ReadWrite,
+                        NonCacheable, ReadWrite,
                         0x00000000,
                         0xF0000000,
                         0xF4FFFFFF,
                         0x00000000,
                         0x05000000,
                         ,, _Y01)
+
+                    QWordMemory (
+                        ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                        NonCacheable, ReadWrite,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        ,, _Y02)
+
                 })
 
                 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
@@ -163,6 +176,17 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                 Add(MMIN, MLEN, MMAX)
                 Subtract(MMAX, One, MMAX)
 
+                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN)
+                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX)
+                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN)
+
+                Store(\_SB.HMIN, HMIN)
+                Store(\_SB.HLEN, HLEN)
+                Add(HMIN, HLEN, HMAX)
+                If(LOr(HMIN, HLEN)) {
+                    Subtract(HMAX, One, HMAX)
+                }
+
                 Return (PRT0)
             }
 
diff --git a/tools/firmware/hvmloader/cacheattr.c b/tools/firmware/hvmloader/cacheattr.c
index 2f6c2f6..e7c219f 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -97,8 +97,7 @@ void cacheattr_init(void)
     nr_var_ranges = (uint8_t)mtrr_cap;
     if ( nr_var_ranges != 0 )
     {
-        unsigned long base = pci_mem_start, size;
-        int i;
+        uint64_t base = pci_mem_start, size;
 
         for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ )
         {
@@ -109,8 +108,22 @@ void cacheattr_init(void)
                 size >>= 1;
 
             wrmsr(MSR_MTRRphysBase(i), base);
-            wrmsr(MSR_MTRRphysMask(i),
-                  (~(uint64_t)(size-1) & addr_mask) | (1u << 11));
+            wrmsr(MSR_MTRRphysMask(i), (~(size - 1) & addr_mask) | (1u << 11));
+
+            base += size;
+        }
+
+        for ( base = pci_hi_mem_start;
+              (base != pci_hi_mem_end) && (i < nr_var_ranges); i++ )
+        {
+            size = PAGE_SIZE;
+            while ( !(base & size) )
+                size <<= 1;
+            while ( (base + size < base) || (base + size > pci_hi_mem_end) )
+                size >>= 1;
+
+            wrmsr(MSR_MTRRphysBase(i), base);
+            wrmsr(MSR_MTRRphysMask(i), (~(size - 1) & addr_mask) | (1u << 11));
 
             base += size;
         }
diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index 6641197..80bea46 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -57,7 +57,7 @@ extern struct bios_config ovmf_config;
 #define PCI_MEM_END         0xfc000000
 
 extern unsigned long pci_mem_start, pci_mem_end;
-
+extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 
 /* Memory map. */
 #define SCRATCH_PHYSICAL_ADDRESS      0x00010000
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 627e8cb..3712988 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -32,6 +32,7 @@
 
 unsigned long pci_mem_start = PCI_MEM_START;
 unsigned long pci_mem_end = PCI_MEM_END;
+uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0;
 
 enum virtual_vga virtual_vga = VGA_none;
 unsigned long igd_opregion_pgbase = 0;
@@ -345,9 +346,8 @@ void pci_setup(void)
                 if ( high_mem_resource.base & (bar_sz - 1) )
                     high_mem_resource.base = high_mem_resource.base - 
                         (high_mem_resource.base & (bar_sz - 1)) + bar_sz;
-                else
-                    high_mem_resource.base = high_mem_resource.base - 
-                        (high_mem_resource.base & (bar_sz - 1));
+                if ( !pci_hi_mem_start )
+                    pci_hi_mem_start = high_mem_resource.base;
                 resource = &high_mem_resource;
                 bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
             } 
@@ -398,6 +398,16 @@ void pci_setup(void)
         pci_writew(devfn, PCI_COMMAND, cmd);
     }
 
+    if ( pci_hi_mem_start )
+    {
+        /*
+         * Make end address alignment match the start address one's so that
+         * fewer variable range MTRRs are needed to cover the range.
+         */
+        pci_hi_mem_end = ((high_mem_resource.base - 1) |
+                          ((pci_hi_mem_start & -pci_hi_mem_start) - 1)) + 1;
+    }
+
     if ( vga_devfn != 256 )
     {
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:35 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquhP-0003l0-74; Sun, 01 Jun 2014 01:36:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhN-0003kl-Kb
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:33 +0000
Received: from [85.158.139.211:26217] by server-17.bemta-5.messagelabs.com id
	82/C5-09046-0A38A835; Sun, 01 Jun 2014 01:36:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1401586590!7391331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19188 invoked from network); 1 Jun 2014 01:36:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhK-0001Ns-0T
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhJ-0001bb-VB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:29 +0000
Date: Sun, 01 Jun 2014 01:36:29 +0000
Message-Id: <E1WquhJ-0001bb-VB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: also cover PCI MMIO ranges
	above 4G with UC MTRR ranges
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d06886694328a31369addc1f614cf326728d65a6
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 21 18:13:36 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 21 18:13:36 2014 +0200

    hvmloader: also cover PCI MMIO ranges above 4G with UC MTRR ranges
    
    When adding support for BAR assignments to addresses above 4G, the MTRR
    side of things was left out.
    
    Additionally the MMIO ranges in the DSDT's \_SB.PCI0._CRS were having
    memory types not matching the ones put into MTRRs: The legacy VGA range
    is supposed to be WC, and the other ones should be UC.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/acpi/build.c  |    6 ++++++
 tools/firmware/hvmloader/acpi/dsdt.asl |   32 ++++++++++++++++++++++++++++----
 tools/firmware/hvmloader/cacheattr.c   |   21 +++++++++++++++++----
 tools/firmware/hvmloader/config.h      |    2 +-
 tools/firmware/hvmloader/pci.c         |   16 +++++++++++++---
 5 files changed, 65 insertions(+), 12 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/build.c b/tools/firmware/hvmloader/acpi/build.c
index f1dd3f0..5c42d89 100644
--- a/tools/firmware/hvmloader/acpi/build.c
+++ b/tools/firmware/hvmloader/acpi/build.c
@@ -51,6 +51,7 @@ struct acpi_info {
     uint32_t madt_csum_addr;    /* 12   - Address of MADT checksum */
     uint32_t madt_lapic0_addr;  /* 16   - Address of first MADT LAPIC struct */
     uint32_t vm_gid_addr;       /* 20   - Address of VM generation id buffer */
+    uint64_t pci_hi_min, pci_hi_len; /* 24, 32 - PCI I/O hole boundaries */
 };
 
 /* Number of processor objects in the chosen DSDT. */
@@ -525,6 +526,11 @@ void acpi_build_tables(struct acpi_config *config, unsigned int physical)
     acpi_info->hpet_present = hpet_exists(ACPI_HPET_ADDRESS);
     acpi_info->pci_min = pci_mem_start;
     acpi_info->pci_len = pci_mem_end - pci_mem_start;
+    if ( pci_hi_mem_end > pci_hi_mem_start )
+    {
+        acpi_info->pci_hi_min = pci_hi_mem_start;
+        acpi_info->pci_hi_len = pci_hi_mem_end - pci_hi_mem_start;
+    }
 
     return;
 
diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 247a8ad..958ebb1 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -45,7 +45,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
     Scope (\_SB)
     {
        /* ACPI_INFO_PHYSICAL_ADDRESS == 0xFC000000 */
-       OperationRegion(BIOS, SystemMemory, 0xFC000000, 24)
+       OperationRegion(BIOS, SystemMemory, 0xFC000000, 40)
        Field(BIOS, ByteAcc, NoLock, Preserve) {
            UAR1, 1,
            UAR2, 1,
@@ -56,7 +56,9 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
            PLEN, 32,
            MSUA, 32, /* MADT checksum address */
            MAPA, 32, /* MADT LAPIC0 address */
-           VGIA, 32  /* VM generation id address */
+           VGIA, 32, /* VM generation id address */
+           HMIN, 64,
+           HLEN, 64
        }
 
         /* Fix HCT test for 0x400 pci memory:
@@ -136,7 +138,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                     /* reserve memory for pci devices */
                     DWordMemory(
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
-                        Cacheable, ReadWrite,
+                        WriteCombining, ReadWrite,
                         0x00000000,
                         0x000A0000,
                         0x000BFFFF,
@@ -145,13 +147,24 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
 
                     DWordMemory(
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
-                        Cacheable, ReadWrite,
+                        NonCacheable, ReadWrite,
                         0x00000000,
                         0xF0000000,
                         0xF4FFFFFF,
                         0x00000000,
                         0x05000000,
                         ,, _Y01)
+
+                    QWordMemory (
+                        ResourceProducer, PosDecode, MinFixed, MaxFixed,
+                        NonCacheable, ReadWrite,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        0x0000000000000000,
+                        ,, _Y02)
+
                 })
 
                 CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
@@ -163,6 +176,17 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                 Add(MMIN, MLEN, MMAX)
                 Subtract(MMAX, One, MMAX)
 
+                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN)
+                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX)
+                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN)
+
+                Store(\_SB.HMIN, HMIN)
+                Store(\_SB.HLEN, HLEN)
+                Add(HMIN, HLEN, HMAX)
+                If(LOr(HMIN, HLEN)) {
+                    Subtract(HMAX, One, HMAX)
+                }
+
                 Return (PRT0)
             }
 
diff --git a/tools/firmware/hvmloader/cacheattr.c b/tools/firmware/hvmloader/cacheattr.c
index 2f6c2f6..e7c219f 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -97,8 +97,7 @@ void cacheattr_init(void)
     nr_var_ranges = (uint8_t)mtrr_cap;
     if ( nr_var_ranges != 0 )
     {
-        unsigned long base = pci_mem_start, size;
-        int i;
+        uint64_t base = pci_mem_start, size;
 
         for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ )
         {
@@ -109,8 +108,22 @@ void cacheattr_init(void)
                 size >>= 1;
 
             wrmsr(MSR_MTRRphysBase(i), base);
-            wrmsr(MSR_MTRRphysMask(i),
-                  (~(uint64_t)(size-1) & addr_mask) | (1u << 11));
+            wrmsr(MSR_MTRRphysMask(i), (~(size - 1) & addr_mask) | (1u << 11));
+
+            base += size;
+        }
+
+        for ( base = pci_hi_mem_start;
+              (base != pci_hi_mem_end) && (i < nr_var_ranges); i++ )
+        {
+            size = PAGE_SIZE;
+            while ( !(base & size) )
+                size <<= 1;
+            while ( (base + size < base) || (base + size > pci_hi_mem_end) )
+                size >>= 1;
+
+            wrmsr(MSR_MTRRphysBase(i), base);
+            wrmsr(MSR_MTRRphysMask(i), (~(size - 1) & addr_mask) | (1u << 11));
 
             base += size;
         }
diff --git a/tools/firmware/hvmloader/config.h b/tools/firmware/hvmloader/config.h
index 6641197..80bea46 100644
--- a/tools/firmware/hvmloader/config.h
+++ b/tools/firmware/hvmloader/config.h
@@ -57,7 +57,7 @@ extern struct bios_config ovmf_config;
 #define PCI_MEM_END         0xfc000000
 
 extern unsigned long pci_mem_start, pci_mem_end;
-
+extern uint64_t pci_hi_mem_start, pci_hi_mem_end;
 
 /* Memory map. */
 #define SCRATCH_PHYSICAL_ADDRESS      0x00010000
diff --git a/tools/firmware/hvmloader/pci.c b/tools/firmware/hvmloader/pci.c
index 627e8cb..3712988 100644
--- a/tools/firmware/hvmloader/pci.c
+++ b/tools/firmware/hvmloader/pci.c
@@ -32,6 +32,7 @@
 
 unsigned long pci_mem_start = PCI_MEM_START;
 unsigned long pci_mem_end = PCI_MEM_END;
+uint64_t pci_hi_mem_start = 0, pci_hi_mem_end = 0;
 
 enum virtual_vga virtual_vga = VGA_none;
 unsigned long igd_opregion_pgbase = 0;
@@ -345,9 +346,8 @@ void pci_setup(void)
                 if ( high_mem_resource.base & (bar_sz - 1) )
                     high_mem_resource.base = high_mem_resource.base - 
                         (high_mem_resource.base & (bar_sz - 1)) + bar_sz;
-                else
-                    high_mem_resource.base = high_mem_resource.base - 
-                        (high_mem_resource.base & (bar_sz - 1));
+                if ( !pci_hi_mem_start )
+                    pci_hi_mem_start = high_mem_resource.base;
                 resource = &high_mem_resource;
                 bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
             } 
@@ -398,6 +398,16 @@ void pci_setup(void)
         pci_writew(devfn, PCI_COMMAND, cmd);
     }
 
+    if ( pci_hi_mem_start )
+    {
+        /*
+         * Make end address alignment match the start address one's so that
+         * fewer variable range MTRRs are needed to cover the range.
+         */
+        pci_hi_mem_end = ((high_mem_resource.base - 1) |
+                          ((pci_hi_mem_start & -pci_hi_mem_start) - 1)) + 1;
+    }
+
     if ( vga_devfn != 256 )
     {
         /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:46 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquha-0003mb-A3; Sun, 01 Jun 2014 01:36:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhY-0003mN-Ph
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:44 +0000
Received: from [85.158.143.35:13406] by server-1.bemta-4.messagelabs.com id
	4A/28-09853-CA38A835; Sun, 01 Jun 2014 01:36:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1401586600!8450467!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 484 invoked from network); 1 Jun 2014 01:36:41 -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;
	1 Jun 2014 01:36:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhU-0001Ny-5t
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhU-0001cD-4v
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:40 +0000
Date: Sun, 01 Jun 2014 01:36:40 +0000
Message-Id: <E1WquhU-0001cD-4v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: PA range
	0xfc000000-0xffffffff should be UC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c22bd567ce22f6ad9bd93318ad0d7fd1c2eadb0d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 21 18:14:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 21 18:14:04 2014 +0200

    hvmloader: PA range 0xfc000000-0xffffffff should be UC
    
    Rather than leaving the range from PCI_MEM_END (0xfc000000) to 4G
    uncovered, we should include this in the UC range created for the (low)
    PCI range. Besides being more correct, this also has the advantage that
    with the way pci_setup() currently works the range will always be
    mappable with a single variable range MTRR (rather than from 2 to 5
    depending on how much the lower boundary gets shifted down to
    accommodate all devices).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/cacheattr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/cacheattr.c b/tools/firmware/hvmloader/cacheattr.c
index e7c219f..de8d39c 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -99,12 +99,12 @@ void cacheattr_init(void)
     {
         uint64_t base = pci_mem_start, size;
 
-        for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ )
+        for ( i = 0; !(base >> 32) && (i < nr_var_ranges); i++ )
         {
             size = PAGE_SIZE;
             while ( !(base & size) )
                 size <<= 1;
-            while ( ((base + size) < base) || ((base + size) > pci_mem_end) )
+            while ( ((base + size) < base) || ((base + size - 1) >> 32) )
                 size >>= 1;
 
             wrmsr(MSR_MTRRphysBase(i), base);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:46 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquha-0003mb-A3; Sun, 01 Jun 2014 01:36:46 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhY-0003mN-Ph
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:44 +0000
Received: from [85.158.143.35:13406] by server-1.bemta-4.messagelabs.com id
	4A/28-09853-CA38A835; Sun, 01 Jun 2014 01:36:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1401586600!8450467!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 484 invoked from network); 1 Jun 2014 01:36:41 -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;
	1 Jun 2014 01:36:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhU-0001Ny-5t
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquhU-0001cD-4v
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:40 +0000
Date: Sun, 01 Jun 2014 01:36:40 +0000
Message-Id: <E1WquhU-0001cD-4v@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: PA range
	0xfc000000-0xffffffff should be UC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c22bd567ce22f6ad9bd93318ad0d7fd1c2eadb0d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 21 18:14:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 21 18:14:04 2014 +0200

    hvmloader: PA range 0xfc000000-0xffffffff should be UC
    
    Rather than leaving the range from PCI_MEM_END (0xfc000000) to 4G
    uncovered, we should include this in the UC range created for the (low)
    PCI range. Besides being more correct, this also has the advantage that
    with the way pci_setup() currently works the range will always be
    mappable with a single variable range MTRR (rather than from 2 to 5
    depending on how much the lower boundary gets shifted down to
    accommodate all devices).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/cacheattr.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/firmware/hvmloader/cacheattr.c b/tools/firmware/hvmloader/cacheattr.c
index e7c219f..de8d39c 100644
--- a/tools/firmware/hvmloader/cacheattr.c
+++ b/tools/firmware/hvmloader/cacheattr.c
@@ -99,12 +99,12 @@ void cacheattr_init(void)
     {
         uint64_t base = pci_mem_start, size;
 
-        for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ )
+        for ( i = 0; !(base >> 32) && (i < nr_var_ranges); i++ )
         {
             size = PAGE_SIZE;
             while ( !(base & size) )
                 size <<= 1;
-            while ( ((base + size) < base) || ((base + size) > pci_mem_end) )
+            while ( ((base + size) < base) || ((base + size - 1) >> 32) )
                 size >>= 1;
 
             wrmsr(MSR_MTRRphysBase(i), base);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquhi-0003nw-Cd; Sun, 01 Jun 2014 01:36:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhh-0003ni-2v
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:53 +0000
Received: from [85.158.143.35:13540] by server-1.bemta-4.messagelabs.com id
	6F/28-09853-4B38A835; Sun, 01 Jun 2014 01:36:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1401586610!8393512!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3089 invoked from network); 1 Jun 2014 01:36:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhe-0001O4-BE
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhe-0001cZ-9V
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:50 +0000
Date: Sun, 01 Jun 2014 01:36:50 +0000
Message-Id: <E1Wquhe-0001cZ-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: fix build with certain iasl
	versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 119d8a42d3bfe6ebc1785720e1a7260e5c698632
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 22 14:20:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 22 14:20:19 2014 +0200

    hvmloader: fix build with certain iasl versions
    
    While most of them support what we have now, Wheezy's dislikes the
    empty range. Put a fake one in place - it's getting overwritten upon
    evaluation of _CRS anyway.
    
    The range could be grown (downwards) if necessary; the way it is now
    it is
    - the highest possible one below the 36-bit boundary (with 36 bits
      being the lowest common denominator for all supported systems),
    - the smallest possible one that said iasl accepts.
    
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/acpi/dsdt.asl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 958ebb1..415c63e 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -159,10 +159,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
                         NonCacheable, ReadWrite,
                         0x0000000000000000,
+                        0x0000000FFFFFFFF0,
+                        0x0000000FFFFFFFFF,
                         0x0000000000000000,
-                        0x0000000000000000,
-                        0x0000000000000000,
-                        0x0000000000000000,
+                        0x0000000000000010,
                         ,, _Y02)
 
                 })
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:36:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:36:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquhi-0003nw-Cd; Sun, 01 Jun 2014 01:36:54 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhh-0003ni-2v
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:53 +0000
Received: from [85.158.143.35:13540] by server-1.bemta-4.messagelabs.com id
	6F/28-09853-4B38A835; Sun, 01 Jun 2014 01:36:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1401586610!8393512!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3089 invoked from network); 1 Jun 2014 01:36:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:36:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhe-0001O4-BE
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhe-0001cZ-9V
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:36:50 +0000
Date: Sun, 01 Jun 2014 01:36:50 +0000
Message-Id: <E1Wquhe-0001cZ-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: fix build with certain iasl
	versions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 119d8a42d3bfe6ebc1785720e1a7260e5c698632
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu May 22 14:20:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu May 22 14:20:19 2014 +0200

    hvmloader: fix build with certain iasl versions
    
    While most of them support what we have now, Wheezy's dislikes the
    empty range. Put a fake one in place - it's getting overwritten upon
    evaluation of _CRS anyway.
    
    The range could be grown (downwards) if necessary; the way it is now
    it is
    - the highest possible one below the 36-bit boundary (with 36 bits
      being the lowest common denominator for all supported systems),
    - the smallest possible one that said iasl accepts.
    
    Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/acpi/dsdt.asl |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 958ebb1..415c63e 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -159,10 +159,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                         ResourceProducer, PosDecode, MinFixed, MaxFixed,
                         NonCacheable, ReadWrite,
                         0x0000000000000000,
+                        0x0000000FFFFFFFF0,
+                        0x0000000FFFFFFFFF,
                         0x0000000000000000,
-                        0x0000000000000000,
-                        0x0000000000000000,
-                        0x0000000000000000,
+                        0x0000000000000010,
                         ,, _Y02)
 
                 })
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquhs-0003pW-FD; Sun, 01 Jun 2014 01:37:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhr-0003pI-5k
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:03 +0000
Received: from [193.109.254.147:2877] by server-13.bemta-14.messagelabs.com id
	D9/55-23211-EB38A835; Sun, 01 Jun 2014 01:37:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1401586620!8246315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6800 invoked from network); 1 Jun 2014 01:37:01 -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;
	1 Jun 2014 01:37:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquho-0001OD-Gg
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquho-0001cw-Ea
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:00 +0000
Date: Sun, 01 Jun 2014 01:37:00 +0000
Message-Id: <E1Wquho-0001cw-Ea@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Reset toolstack_save file
	position in libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b327a3f421bb57d262b7d1fb3c43b710852b103b
Author:     Jason Andryuk <andryuk@aero.org>
AuthorDate: Mon May 19 14:36:37 2014 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:35:22 2014 +0100

    libxl: Reset toolstack_save file position in libxl
    
    toolstack_save data is written to a temporary file in libxl and read
    back in libxl-save-helper.  The file position must be reset prior to
    reading the file, which is done in libxl-save-helper with lseek.
    
    lseek is unsupported for pipes and sockets, so a wrapper passing such an
    fd to libxl-save-helper fails the lseek.  Moving the lseek to libxl
    avoids the error, allowing the save to continue.
    
    Signed-off-by: Jason Andryuk <andryuk@aero.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_save_callout.c |    4 ++++
 tools/libxl/libxl_save_helper.c  |    5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index e3bda8f..c35da4d 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -105,6 +105,10 @@ void libxl__xc_domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss,
                                 toolstack_data_buf, toolstack_data_len,
                                 "toolstack data tmpfile", 0);
         if (r) { rc = ERROR_FAIL; goto out; }
+
+        /* file position must be reset before passing to libxl-save-helper. */
+        r = lseek(toolstack_data_fd, 0, SEEK_SET);
+        if (r) { rc = ERROR_FAIL; goto out; }
     }
 
     const unsigned long argnums[] = {
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index c36314c..b259bd0 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -163,10 +163,9 @@ static uint32_t toolstack_save_len;
 static int toolstack_save_cb(uint32_t domid, uint8_t **buf,
                              uint32_t *len, void *data)
 {
-    assert(toolstack_save_fd > 0);
+    int r;
 
-    int r = lseek(toolstack_save_fd, 0, SEEK_SET);
-    if (r) fail(errno,"rewind toolstack data tmpfile");
+    assert(toolstack_save_fd > 0);
 
     *buf = xmalloc(toolstack_save_len);
     r = read_exactly(toolstack_save_fd, *buf, toolstack_save_len);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquhs-0003pW-FD; Sun, 01 Jun 2014 01:37:04 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhr-0003pI-5k
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:03 +0000
Received: from [193.109.254.147:2877] by server-13.bemta-14.messagelabs.com id
	D9/55-23211-EB38A835; Sun, 01 Jun 2014 01:37:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1401586620!8246315!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6800 invoked from network); 1 Jun 2014 01:37:01 -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;
	1 Jun 2014 01:37:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquho-0001OD-Gg
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquho-0001cw-Ea
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:00 +0000
Date: Sun, 01 Jun 2014 01:37:00 +0000
Message-Id: <E1Wquho-0001cw-Ea@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Reset toolstack_save file
	position in libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b327a3f421bb57d262b7d1fb3c43b710852b103b
Author:     Jason Andryuk <andryuk@aero.org>
AuthorDate: Mon May 19 14:36:37 2014 -0400
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:35:22 2014 +0100

    libxl: Reset toolstack_save file position in libxl
    
    toolstack_save data is written to a temporary file in libxl and read
    back in libxl-save-helper.  The file position must be reset prior to
    reading the file, which is done in libxl-save-helper with lseek.
    
    lseek is unsupported for pipes and sockets, so a wrapper passing such an
    fd to libxl-save-helper fails the lseek.  Moving the lseek to libxl
    avoids the error, allowing the save to continue.
    
    Signed-off-by: Jason Andryuk <andryuk@aero.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_save_callout.c |    4 ++++
 tools/libxl/libxl_save_helper.c  |    5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/libxl_save_callout.c b/tools/libxl/libxl_save_callout.c
index e3bda8f..c35da4d 100644
--- a/tools/libxl/libxl_save_callout.c
+++ b/tools/libxl/libxl_save_callout.c
@@ -105,6 +105,10 @@ void libxl__xc_domain_save(libxl__egc *egc, libxl__domain_suspend_state *dss,
                                 toolstack_data_buf, toolstack_data_len,
                                 "toolstack data tmpfile", 0);
         if (r) { rc = ERROR_FAIL; goto out; }
+
+        /* file position must be reset before passing to libxl-save-helper. */
+        r = lseek(toolstack_data_fd, 0, SEEK_SET);
+        if (r) { rc = ERROR_FAIL; goto out; }
     }
 
     const unsigned long argnums[] = {
diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index c36314c..b259bd0 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -163,10 +163,9 @@ static uint32_t toolstack_save_len;
 static int toolstack_save_cb(uint32_t domid, uint8_t **buf,
                              uint32_t *len, void *data)
 {
-    assert(toolstack_save_fd > 0);
+    int r;
 
-    int r = lseek(toolstack_save_fd, 0, SEEK_SET);
-    if (r) fail(errno,"rewind toolstack data tmpfile");
+    assert(toolstack_save_fd > 0);
 
     *buf = xmalloc(toolstack_save_len);
     r = read_exactly(toolstack_save_fd, *buf, toolstack_save_len);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqui2-0003rD-Ht; Sun, 01 Jun 2014 01:37:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqui1-0003qw-4M
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:13 +0000
Received: from [193.109.254.147:48847] by server-8.bemta-14.messagelabs.com id
	2C/99-01877-8C38A835; Sun, 01 Jun 2014 01:37:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1401586630!3662301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2608 invoked from network); 1 Jun 2014 01:37:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhy-0001Om-MB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhy-0001dT-KK
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:10 +0000
Date: Sun, 01 Jun 2014 01:37:10 +0000
Message-Id: <E1Wquhy-0001dT-KK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fca69b1fc606ece62430076ca4a157e4bed749a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 26 12:25:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 26 12:25:01 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/acpi/apei/erst.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 2fafe7f..21593cf 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -383,6 +383,8 @@ static int erst_get_erange(struct erst_erange *range)
 	return 0;
 }
 
+#ifndef NDEBUG /* currently dead code */
+
 static ssize_t __erst_get_record_count(void)
 {
 	struct apei_exec_context ctx;
@@ -447,6 +449,8 @@ int erst_get_next_record_id(u64 *record_id)
 	return rc;
 }
 
+#endif /* currently dead code */
+
 static int __erst_write_to_storage(u64 offset)
 {
 	struct apei_exec_context ctx;
@@ -777,21 +781,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wqui2-0003rD-Ht; Sun, 01 Jun 2014 01:37:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqui1-0003qw-4M
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:13 +0000
Received: from [193.109.254.147:48847] by server-8.bemta-14.messagelabs.com id
	2C/99-01877-8C38A835; Sun, 01 Jun 2014 01:37:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1401586630!3662301!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2608 invoked from network); 1 Jun 2014 01:37:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhy-0001Om-MB
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquhy-0001dT-KK
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:10 +0000
Date: Sun, 01 Jun 2014 01:37:10 +0000
Message-Id: <E1Wquhy-0001dT-KK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fca69b1fc606ece62430076ca4a157e4bed749a8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 26 12:25:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 26 12:25:01 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/acpi/apei/erst.c |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 2fafe7f..21593cf 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -383,6 +383,8 @@ static int erst_get_erange(struct erst_erange *range)
 	return 0;
 }
 
+#ifndef NDEBUG /* currently dead code */
+
 static ssize_t __erst_get_record_count(void)
 {
 	struct apei_exec_context ctx;
@@ -447,6 +449,8 @@ int erst_get_next_record_id(u64 *record_id)
 	return rc;
 }
 
+#endif /* currently dead code */
+
 static int __erst_write_to_storage(u64 offset)
 {
 	struct apei_exec_context ctx;
@@ -777,21 +781,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquiD-0003t4-Kc; Sun, 01 Jun 2014 01:37:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiC-0003sp-CP
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:24 +0000
Received: from [85.158.139.211:15312] by server-13.bemta-5.messagelabs.com id
	01/C9-16341-3D38A835; Sun, 01 Jun 2014 01:37:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1401586641!7363346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25478 invoked from network); 1 Jun 2014 01:37:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqui8-0001Os-S3
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqui8-0001eL-QH
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:20 +0000
Date: Sun, 01 Jun 2014 01:37:20 +0000
Message-Id: <E1Wqui8-0001eL-QH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Coverity ID: 1215178
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 16591db3765a228916335de7a2885d650f9dc79d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon May 26 12:27:51 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 26 12:27:51 2014 +0200

    Coverity ID: 1215178
    
    There are two problems with initializetion of the ioreq_t in hvmemul_do_io():
    
    - vp_eport is uninitialized (because it doesn't need to be) but because the
      struct is the subject of a copy in hvm_send_assist_req(), this is flagged
      as a problem.
    - dir, addr, data_is_ptr, and data may be uninitialized when the struct is
      passed to hvmtrace_io_assist(). This is clearly a bug, so the initializ-
      ation of at least those fields needs to be moved earlier.
    
    This patch fixes both these problems.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 904c71a..eac159f 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -53,11 +53,17 @@ static int hvmemul_do_io(
     int is_mmio, paddr_t addr, unsigned long *reps, int size,
     paddr_t ram_gpa, int dir, int df, void *p_data)
 {
-    paddr_t value = ram_gpa;
-    int value_is_ptr = (p_data == NULL);
     struct vcpu *curr = current;
     struct hvm_vcpu_io *vio;
-    ioreq_t p;
+    ioreq_t p = {
+        .type = is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO,
+        .addr = addr,
+        .size = size,
+        .dir = dir,
+        .df = df,
+        .data = ram_gpa,
+        .data_is_ptr = (p_data == NULL),
+    };
     unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
     p2m_type_t p2mt;
     struct page_info *ram_page;
@@ -94,15 +100,15 @@ static int hvmemul_do_io(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    if ( (p_data != NULL) && (dir == IOREQ_WRITE) )
+    if ( !p.data_is_ptr && (dir == IOREQ_WRITE) )
     {
-        memcpy(&value, p_data, size);
+        memcpy(&p.data, p_data, size);
         p_data = NULL;
     }
 
     vio = &curr->arch.hvm_vcpu.hvm_io;
 
-    if ( is_mmio && !value_is_ptr )
+    if ( is_mmio && !p.data_is_ptr )
     {
         /* Part of a multi-cycle read or write? */
         if ( dir == IOREQ_WRITE )
@@ -146,7 +152,7 @@ static int hvmemul_do_io(
         goto finish_access;
     case HVMIO_dispatched:
         /* May have to wait for previous cycle of a multi-write to complete. */
-        if ( is_mmio && !value_is_ptr && (dir == IOREQ_WRITE) &&
+        if ( is_mmio && !p.data_is_ptr && (dir == IOREQ_WRITE) &&
              (addr == (vio->mmio_large_write_pa +
                        vio->mmio_large_write_bytes)) )
         {
@@ -179,14 +185,7 @@ static int hvmemul_do_io(
     if ( vio->mmio_retrying )
         *reps = 1;
 
-    p.dir = dir;
-    p.data_is_ptr = value_is_ptr;
-    p.type = is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO;
-    p.size = size;
-    p.addr = addr;
     p.count = *reps;
-    p.df = df;
-    p.data = value;
 
     if ( dir == IOREQ_WRITE )
         hvmtrace_io_assist(is_mmio, &p);
@@ -251,7 +250,7 @@ static int hvmemul_do_io(
     if ( p_data != NULL )
         memcpy(p_data, &vio->io_data, size);
 
-    if ( is_mmio && !value_is_ptr )
+    if ( is_mmio && !p.data_is_ptr )
     {
         /* Part of a multi-cycle read or write? */
         if ( dir == IOREQ_WRITE )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquiD-0003t4-Kc; Sun, 01 Jun 2014 01:37:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiC-0003sp-CP
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:24 +0000
Received: from [85.158.139.211:15312] by server-13.bemta-5.messagelabs.com id
	01/C9-16341-3D38A835; Sun, 01 Jun 2014 01:37:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1401586641!7363346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.9 required=7.0 tests=SUBJ_HAS_UNIQ_ID
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25478 invoked from network); 1 Jun 2014 01:37:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqui8-0001Os-S3
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wqui8-0001eL-QH
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:20 +0000
Date: Sun, 01 Jun 2014 01:37:20 +0000
Message-Id: <E1Wqui8-0001eL-QH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Coverity ID: 1215178
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 16591db3765a228916335de7a2885d650f9dc79d
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon May 26 12:27:51 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 26 12:27:51 2014 +0200

    Coverity ID: 1215178
    
    There are two problems with initializetion of the ioreq_t in hvmemul_do_io():
    
    - vp_eport is uninitialized (because it doesn't need to be) but because the
      struct is the subject of a copy in hvm_send_assist_req(), this is flagged
      as a problem.
    - dir, addr, data_is_ptr, and data may be uninitialized when the struct is
      passed to hvmtrace_io_assist(). This is clearly a bug, so the initializ-
      ation of at least those fields needs to be moved earlier.
    
    This patch fixes both these problems.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/emulate.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/hvm/emulate.c b/xen/arch/x86/hvm/emulate.c
index 904c71a..eac159f 100644
--- a/xen/arch/x86/hvm/emulate.c
+++ b/xen/arch/x86/hvm/emulate.c
@@ -53,11 +53,17 @@ static int hvmemul_do_io(
     int is_mmio, paddr_t addr, unsigned long *reps, int size,
     paddr_t ram_gpa, int dir, int df, void *p_data)
 {
-    paddr_t value = ram_gpa;
-    int value_is_ptr = (p_data == NULL);
     struct vcpu *curr = current;
     struct hvm_vcpu_io *vio;
-    ioreq_t p;
+    ioreq_t p = {
+        .type = is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO,
+        .addr = addr,
+        .size = size,
+        .dir = dir,
+        .df = df,
+        .data = ram_gpa,
+        .data_is_ptr = (p_data == NULL),
+    };
     unsigned long ram_gfn = paddr_to_pfn(ram_gpa);
     p2m_type_t p2mt;
     struct page_info *ram_page;
@@ -94,15 +100,15 @@ static int hvmemul_do_io(
         return X86EMUL_UNHANDLEABLE;
     }
 
-    if ( (p_data != NULL) && (dir == IOREQ_WRITE) )
+    if ( !p.data_is_ptr && (dir == IOREQ_WRITE) )
     {
-        memcpy(&value, p_data, size);
+        memcpy(&p.data, p_data, size);
         p_data = NULL;
     }
 
     vio = &curr->arch.hvm_vcpu.hvm_io;
 
-    if ( is_mmio && !value_is_ptr )
+    if ( is_mmio && !p.data_is_ptr )
     {
         /* Part of a multi-cycle read or write? */
         if ( dir == IOREQ_WRITE )
@@ -146,7 +152,7 @@ static int hvmemul_do_io(
         goto finish_access;
     case HVMIO_dispatched:
         /* May have to wait for previous cycle of a multi-write to complete. */
-        if ( is_mmio && !value_is_ptr && (dir == IOREQ_WRITE) &&
+        if ( is_mmio && !p.data_is_ptr && (dir == IOREQ_WRITE) &&
              (addr == (vio->mmio_large_write_pa +
                        vio->mmio_large_write_bytes)) )
         {
@@ -179,14 +185,7 @@ static int hvmemul_do_io(
     if ( vio->mmio_retrying )
         *reps = 1;
 
-    p.dir = dir;
-    p.data_is_ptr = value_is_ptr;
-    p.type = is_mmio ? IOREQ_TYPE_COPY : IOREQ_TYPE_PIO;
-    p.size = size;
-    p.addr = addr;
     p.count = *reps;
-    p.df = df;
-    p.data = value;
 
     if ( dir == IOREQ_WRITE )
         hvmtrace_io_assist(is_mmio, &p);
@@ -251,7 +250,7 @@ static int hvmemul_do_io(
     if ( p_data != NULL )
         memcpy(p_data, &vio->io_data, size);
 
-    if ( is_mmio && !value_is_ptr )
+    if ( is_mmio && !p.data_is_ptr )
     {
         /* Part of a multi-cycle read or write? */
         if ( dir == IOREQ_WRITE )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquiM-0003us-PN; Sun, 01 Jun 2014 01:37:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiL-0003ub-JD
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:33 +0000
Received: from [85.158.137.68:11133] by server-2.bemta-3.messagelabs.com id
	74/18-23530-CD38A835; Sun, 01 Jun 2014 01:37:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1401586651!7159947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20481 invoked from network); 1 Jun 2014 01:37:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiJ-0001P0-23
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiJ-0001ei-0O
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:31 +0000
Date: Sun, 01 Jun 2014 01:37:31 +0000
Message-Id: <E1WquiJ-0001ei-0O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: fix mask applied to DMIBAR in
	desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f8ecf31c31906552522c2a1b0d1cada07d78876e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 26 12:28:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 26 12:28:46 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index d917b2f..33f3942 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000UL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquiM-0003us-PN; Sun, 01 Jun 2014 01:37:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiL-0003ub-JD
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:33 +0000
Received: from [85.158.137.68:11133] by server-2.bemta-3.messagelabs.com id
	74/18-23530-CD38A835; Sun, 01 Jun 2014 01:37:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1401586651!7159947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20481 invoked from network); 1 Jun 2014 01:37:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiJ-0001P0-23
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiJ-0001ei-0O
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:31 +0000
Date: Sun, 01 Jun 2014 01:37:31 +0000
Message-Id: <E1WquiJ-0001ei-0O@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: fix mask applied to DMIBAR in
	desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f8ecf31c31906552522c2a1b0d1cada07d78876e
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon May 26 12:28:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon May 26 12:28:46 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index d917b2f..33f3942 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000UL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquiW-0003wd-S8; Sun, 01 Jun 2014 01:37:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiV-0003wK-T1
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:44 +0000
Received: from [85.158.143.35:21685] by server-1.bemta-4.messagelabs.com id
	27/58-09853-7E38A835; Sun, 01 Jun 2014 01:37:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1401586661!8441389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21979 invoked from network); 1 Jun 2014 01:37:42 -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;
	1 Jun 2014 01:37:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiT-0001P6-73
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiT-0001f7-5h
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:41 +0000
Date: Sun, 01 Jun 2014 01:37:41 +0000
Message-Id: <E1WquiT-0001f7-5h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix setup of PVH Dom0 memory map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6174884470393878359=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit af06d66ee32b6298f326b130664bfe066fbc1d89
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed May 28 09:48:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:48:56 2014 +0200

    x86: fix setup of PVH Dom0 memory map
    
    This patch adds the holes removed by MMIO regions to the end of the
    memory map for PVH Dom0, so the guest OS doesn't have to manually
    populate this memory.
    
    Also, provide a suitable e820 memory map for PVH Dom0, that matches
    the underlying p2m map. This means that PVH guests should always use
    XENMEM_memory_map in order to obtain the e820, even when running as
    Dom0.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain_build.c |  115 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 112 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 38ed9f6..ba42fc9 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -315,9 +315,13 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
     int rc;
 
     for ( i = 0; i < nr_mfns; i++ )
+    {
         if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i))) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
                   gfn, mfn, i, rc);
+        if ( !(i & 0xfffff) )
+                process_pending_softirqs();
+    }
 }
 
 /*
@@ -327,11 +331,14 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
  * pvh fixme: The following doesn't map MMIO ranges when they sit above the
  *            highest E820 covered address.
  */
-static __init void pvh_map_all_iomem(struct domain *d)
+static __init void pvh_map_all_iomem(struct domain *d, unsigned long nr_pages)
 {
     unsigned long start_pfn, end_pfn, end = 0, start = 0;
     const struct e820entry *entry;
-    unsigned int i, nump;
+    unsigned long nump, nmap, navail, mfn, nr_holes = 0;
+    unsigned int i;
+    struct page_info *page;
+    int rc;
 
     for ( i = 0, entry = e820.map; i < e820.nr_map; i++, entry++ )
     {
@@ -353,6 +360,9 @@ static __init void pvh_map_all_iomem(struct domain *d)
                 nump = end_pfn - start_pfn;
                 /* Add pages to the mapping */
                 pvh_add_mem_mapping(d, start_pfn, start_pfn, nump);
+                if ( start_pfn < nr_pages )
+                    nr_holes += (end_pfn < nr_pages) ?
+                                    nump : (nr_pages - start_pfn);
             }
             start = end;
         }
@@ -369,6 +379,104 @@ static __init void pvh_map_all_iomem(struct domain *d)
         nump = end_pfn - start_pfn;
         pvh_add_mem_mapping(d, start_pfn, start_pfn, nump);
     }
+
+    /*
+     * Add the memory removed by the holes at the end of the
+     * memory map.
+     */
+    page = page_list_first(&d->page_list);
+    for ( i = 0, entry = e820.map; i < e820.nr_map && nr_holes > 0;
+          i++, entry++ )
+    {
+        if ( entry->type != E820_RAM )
+            continue;
+
+        end_pfn = PFN_UP(entry->addr + entry->size);
+        if ( end_pfn <= nr_pages )
+            continue;
+
+        navail = end_pfn - nr_pages;
+        nmap = min(navail, nr_holes);
+        nr_holes -= nmap;
+        start_pfn = max_t(unsigned long, nr_pages, PFN_DOWN(entry->addr));
+        /*
+         * Populate this memory region using the pages
+         * previously removed by the MMIO holes.
+         */
+        do
+        {
+            mfn = page_to_mfn(page);
+            if ( get_gpfn_from_mfn(mfn) != INVALID_M2P_ENTRY )
+                continue;
+
+            rc = guest_physmap_add_page(d, start_pfn, mfn, 0);
+            if ( rc != 0 )
+                panic("Unable to add gpfn %#lx mfn %#lx to Dom0 physmap: %d",
+                      start_pfn, mfn, rc);
+            start_pfn++;
+            nmap--;
+            if ( !(nmap & 0xfffff) )
+                process_pending_softirqs();
+        } while ( ((page = page_list_next(page, &d->page_list)) != NULL)
+                  && nmap );
+        ASSERT(nmap == 0);
+        if ( page == NULL )
+            break;
+    }
+
+    ASSERT(nr_holes == 0);
+}
+
+static __init void pvh_setup_e820(struct domain *d, unsigned long nr_pages)
+{
+    struct e820entry *entry, *entry_guest;
+    unsigned int i;
+    unsigned long pages, cur_pages = 0;
+
+    /*
+     * Craft the e820 memory map for Dom0 based on the hardware e820 map.
+     */
+    d->arch.e820 = xzalloc_array(struct e820entry, e820.nr_map);
+    if ( !d->arch.e820 )
+        panic("Unable to allocate memory for Dom0 e820 map");
+    entry_guest = d->arch.e820;
+
+    /* Clamp e820 memory map to match the memory assigned to Dom0 */
+    for ( i = 0, entry = e820.map; i < e820.nr_map; i++, entry++ )
+    {
+        if ( entry->type != E820_RAM )
+        {
+            *entry_guest = *entry;
+            goto next;
+        }
+
+        if ( nr_pages == cur_pages )
+        {
+            /*
+             * We already have all the assigned memory,
+             * skip this entry
+             */
+            continue;
+        }
+
+        *entry_guest = *entry;
+        pages = PFN_UP(entry_guest->size);
+        if ( (cur_pages + pages) > nr_pages )
+        {
+            /* Truncate region */
+            entry_guest->size = (nr_pages - cur_pages) << PAGE_SHIFT;
+            cur_pages = nr_pages;
+        }
+        else
+        {
+            cur_pages += pages;
+        }
+ next:
+        d->arch.nr_e820++;
+        entry_guest++;
+    }
+    ASSERT(cur_pages == nr_pages);
+    ASSERT(d->arch.nr_e820 <= e820.nr_map);
 }
 
 static __init void dom0_update_physmap(struct domain *d, unsigned long pfn,
@@ -1391,7 +1499,8 @@ int __init construct_dom0(
         pfn = shared_info_paddr >> PAGE_SHIFT;
         dom0_update_physmap(d, pfn, mfn, 0);
 
-        pvh_map_all_iomem(d);
+        pvh_map_all_iomem(d, nr_pages);
+        pvh_setup_e820(d, nr_pages);
     }
 
     if ( d->domain_id == hardware_domid )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WquiW-0003wd-S8; Sun, 01 Jun 2014 01:37:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiV-0003wK-T1
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:44 +0000
Received: from [85.158.143.35:21685] by server-1.bemta-4.messagelabs.com id
	27/58-09853-7E38A835; Sun, 01 Jun 2014 01:37:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1401586661!8441389!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21979 invoked from network); 1 Jun 2014 01:37:42 -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;
	1 Jun 2014 01:37:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiT-0001P6-73
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WquiT-0001f7-5h
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:41 +0000
Date: Sun, 01 Jun 2014 01:37:41 +0000
Message-Id: <E1WquiT-0001f7-5h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix setup of PVH Dom0 memory map
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6174884470393878359=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit af06d66ee32b6298f326b130664bfe066fbc1d89
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Wed May 28 09:48:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:48:56 2014 +0200

    x86: fix setup of PVH Dom0 memory map
    
    This patch adds the holes removed by MMIO regions to the end of the
    memory map for PVH Dom0, so the guest OS doesn't have to manually
    populate this memory.
    
    Also, provide a suitable e820 memory map for PVH Dom0, that matches
    the underlying p2m map. This means that PVH guests should always use
    XENMEM_memory_map in order to obtain the e820, even when running as
    Dom0.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domain_build.c |  115 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 112 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 38ed9f6..ba42fc9 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -315,9 +315,13 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
     int rc;
 
     for ( i = 0; i < nr_mfns; i++ )
+    {
         if ( (rc = set_mmio_p2m_entry(d, gfn + i, _mfn(mfn + i))) )
             panic("pvh_add_mem_mapping: gfn:%lx mfn:%lx i:%ld rc:%d\n",
                   gfn, mfn, i, rc);
+        if ( !(i & 0xfffff) )
+                process_pending_softirqs();
+    }
 }
 
 /*
@@ -327,11 +331,14 @@ static __init void pvh_add_mem_mapping(struct domain *d, unsigned long gfn,
  * pvh fixme: The following doesn't map MMIO ranges when they sit above the
  *            highest E820 covered address.
  */
-static __init void pvh_map_all_iomem(struct domain *d)
+static __init void pvh_map_all_iomem(struct domain *d, unsigned long nr_pages)
 {
     unsigned long start_pfn, end_pfn, end = 0, start = 0;
     const struct e820entry *entry;
-    unsigned int i, nump;
+    unsigned long nump, nmap, navail, mfn, nr_holes = 0;
+    unsigned int i;
+    struct page_info *page;
+    int rc;
 
     for ( i = 0, entry = e820.map; i < e820.nr_map; i++, entry++ )
     {
@@ -353,6 +360,9 @@ static __init void pvh_map_all_iomem(struct domain *d)
                 nump = end_pfn - start_pfn;
                 /* Add pages to the mapping */
                 pvh_add_mem_mapping(d, start_pfn, start_pfn, nump);
+                if ( start_pfn < nr_pages )
+                    nr_holes += (end_pfn < nr_pages) ?
+                                    nump : (nr_pages - start_pfn);
             }
             start = end;
         }
@@ -369,6 +379,104 @@ static __init void pvh_map_all_iomem(struct domain *d)
         nump = end_pfn - start_pfn;
         pvh_add_mem_mapping(d, start_pfn, start_pfn, nump);
     }
+
+    /*
+     * Add the memory removed by the holes at the end of the
+     * memory map.
+     */
+    page = page_list_first(&d->page_list);
+    for ( i = 0, entry = e820.map; i < e820.nr_map && nr_holes > 0;
+          i++, entry++ )
+    {
+        if ( entry->type != E820_RAM )
+            continue;
+
+        end_pfn = PFN_UP(entry->addr + entry->size);
+        if ( end_pfn <= nr_pages )
+            continue;
+
+        navail = end_pfn - nr_pages;
+        nmap = min(navail, nr_holes);
+        nr_holes -= nmap;
+        start_pfn = max_t(unsigned long, nr_pages, PFN_DOWN(entry->addr));
+        /*
+         * Populate this memory region using the pages
+         * previously removed by the MMIO holes.
+         */
+        do
+        {
+            mfn = page_to_mfn(page);
+            if ( get_gpfn_from_mfn(mfn) != INVALID_M2P_ENTRY )
+                continue;
+
+            rc = guest_physmap_add_page(d, start_pfn, mfn, 0);
+            if ( rc != 0 )
+                panic("Unable to add gpfn %#lx mfn %#lx to Dom0 physmap: %d",
+                      start_pfn, mfn, rc);
+            start_pfn++;
+            nmap--;
+            if ( !(nmap & 0xfffff) )
+                process_pending_softirqs();
+        } while ( ((page = page_list_next(page, &d->page_list)) != NULL)
+                  && nmap );
+        ASSERT(nmap == 0);
+        if ( page == NULL )
+            break;
+    }
+
+    ASSERT(nr_holes == 0);
+}
+
+static __init void pvh_setup_e820(struct domain *d, unsigned long nr_pages)
+{
+    struct e820entry *entry, *entry_guest;
+    unsigned int i;
+    unsigned long pages, cur_pages = 0;
+
+    /*
+     * Craft the e820 memory map for Dom0 based on the hardware e820 map.
+     */
+    d->arch.e820 = xzalloc_array(struct e820entry, e820.nr_map);
+    if ( !d->arch.e820 )
+        panic("Unable to allocate memory for Dom0 e820 map");
+    entry_guest = d->arch.e820;
+
+    /* Clamp e820 memory map to match the memory assigned to Dom0 */
+    for ( i = 0, entry = e820.map; i < e820.nr_map; i++, entry++ )
+    {
+        if ( entry->type != E820_RAM )
+        {
+            *entry_guest = *entry;
+            goto next;
+        }
+
+        if ( nr_pages == cur_pages )
+        {
+            /*
+             * We already have all the assigned memory,
+             * skip this entry
+             */
+            continue;
+        }
+
+        *entry_guest = *entry;
+        pages = PFN_UP(entry_guest->size);
+        if ( (cur_pages + pages) > nr_pages )
+        {
+            /* Truncate region */
+            entry_guest->size = (nr_pages - cur_pages) << PAGE_SHIFT;
+            cur_pages = nr_pages;
+        }
+        else
+        {
+            cur_pages += pages;
+        }
+ next:
+        d->arch.nr_e820++;
+        entry_guest++;
+    }
+    ASSERT(cur_pages == nr_pages);
+    ASSERT(d->arch.nr_e820 <= e820.nr_map);
 }
 
 static __init void dom0_update_physmap(struct domain *d, unsigned long pfn,
@@ -1391,7 +1499,8 @@ int __init construct_dom0(
         pfn = shared_info_paddr >> PAGE_SHIFT;
         dom0_update_physmap(d, pfn, mfn, 0);
 
-        pvh_map_all_iomem(d);
+        pvh_map_all_iomem(d, nr_pages);
+        pvh_setup_e820(d, nr_pages);
     }
 
     if ( d->domain_id == hardware_domid )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquig-0003y2-Uv; Sun, 01 Jun 2014 01:37:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquif-0003xs-Tg
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:54 +0000
Received: from [85.158.139.211:19876] by server-13.bemta-5.messagelabs.com id
	5D/D9-16341-1F38A835; Sun, 01 Jun 2014 01:37:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1401586671!4024956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11385 invoked from network); 1 Jun 2014 01:37:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquid-0001PC-BQ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquid-0001fe-A9
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:51 +0000
Date: Sun, 01 Jun 2014 01:37:51 +0000
Message-Id: <E1Wquid-0001fe-A9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b4d71d028f445cba7426a144751fddc8bfdd67b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 28 09:50:33 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:50:33 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index ceb1c28..a8c60ec 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:37:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:37:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquig-0003y2-Uv; Sun, 01 Jun 2014 01:37:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquif-0003xs-Tg
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:54 +0000
Received: from [85.158.139.211:19876] by server-13.bemta-5.messagelabs.com id
	5D/D9-16341-1F38A835; Sun, 01 Jun 2014 01:37:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1401586671!4024956!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11385 invoked from network); 1 Jun 2014 01:37:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:37:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquid-0001PC-BQ
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquid-0001fe-A9
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:37:51 +0000
Date: Sun, 01 Jun 2014 01:37:51 +0000
Message-Id: <E1Wquid-0001fe-A9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b4d71d028f445cba7426a144751fddc8bfdd67b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 28 09:50:33 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:50:33 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index ceb1c28..a8c60ec 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquir-0003zW-1v; Sun, 01 Jun 2014 01:38:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquiq-0003zJ-5S
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:04 +0000
Received: from [85.158.137.68:11741] by server-14.bemta-3.messagelabs.com id
	E0/FE-30903-BF38A835; Sun, 01 Jun 2014 01:38:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1401586681!7285958!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13520 invoked from network); 1 Jun 2014 01:38:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:38:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquin-0001Po-Fn
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquin-0001g1-EW
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:01 +0000
Date: Sun, 01 Jun 2014 01:38:01 +0000
Message-Id: <E1Wquin-0001g1-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't use VA for cache flush when
	also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50df6f7429f73364bbddb0970a3a34faa01a7790
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 28 09:51:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:51:07 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquir-0003zW-1v; Sun, 01 Jun 2014 01:38:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquiq-0003zJ-5S
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:04 +0000
Received: from [85.158.137.68:11741] by server-14.bemta-3.messagelabs.com id
	E0/FE-30903-BF38A835; Sun, 01 Jun 2014 01:38:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1401586681!7285958!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13520 invoked from network); 1 Jun 2014 01:38:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:38:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquin-0001Po-Fn
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquin-0001g1-EW
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:01 +0000
Date: Sun, 01 Jun 2014 01:38:01 +0000
Message-Id: <E1Wquin-0001g1-EW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: don't use VA for cache flush when
	also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50df6f7429f73364bbddb0970a3a34faa01a7790
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 28 09:51:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:51:07 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquj2-00041E-4n; Sun, 01 Jun 2014 01:38:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquj0-00040w-Fm
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:14 +0000
Received: from [85.158.139.211:33809] by server-2.bemta-5.messagelabs.com id
	C2/E6-12074-5048A835; Sun, 01 Jun 2014 01:38:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1401586692!4024968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12119 invoked from network); 1 Jun 2014 01:38:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:38:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquix-0001Pu-Oz
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquix-0001gY-MK
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:11 +0000
Date: Sun, 01 Jun 2014 01:38:11 +0000
Message-Id: <E1Wquix-0001gY-MK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/domain: do not rely on the
	assumption that guest_type_pv has the value 0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84c4a1f62b0505026e9846bf707ba3de15109834
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 28 09:51:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:51:46 2014 +0200

    common/domain: do not rely on the assumption that guest_type_pv has the value 0
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index dc18139..bc57174 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -286,6 +286,8 @@ struct domain *domain_create(
         d->guest_type = guest_type_hvm;
     else if ( domcr_flags & DOMCRF_pvh )
         d->guest_type = guest_type_pvh;
+    else
+        d->guest_type = guest_type_pv;
 
     if ( domid == 0 || domid == hardware_domid )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wquj2-00041E-4n; Sun, 01 Jun 2014 01:38:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquj0-00040w-Fm
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:14 +0000
Received: from [85.158.139.211:33809] by server-2.bemta-5.messagelabs.com id
	C2/E6-12074-5048A835; Sun, 01 Jun 2014 01:38:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1401586692!4024968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12119 invoked from network); 1 Jun 2014 01:38:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:38:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquix-0001Pu-Oz
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquix-0001gY-MK
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:11 +0000
Date: Sun, 01 Jun 2014 01:38:11 +0000
Message-Id: <E1Wquix-0001gY-MK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/domain: do not rely on the
	assumption that guest_type_pv has the value 0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84c4a1f62b0505026e9846bf707ba3de15109834
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed May 28 09:51:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 09:51:46 2014 +0200

    common/domain: do not rely on the assumption that guest_type_pv has the value 0
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/domain.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index dc18139..bc57174 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -286,6 +286,8 @@ struct domain *domain_create(
         d->guest_type = guest_type_hvm;
     else if ( domcr_flags & DOMCRF_pvh )
         d->guest_type = guest_type_pvh;
+    else
+        d->guest_type = guest_type_pv;
 
     if ( domid == 0 || domid == hardware_domid )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqujB-00042a-7O; Sun, 01 Jun 2014 01:38:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujA-00042Q-72
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:24 +0000
Received: from [85.158.143.35:17234] by server-1.bemta-4.messagelabs.com id
	57/98-09853-F048A835; Sun, 01 Jun 2014 01:38:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1401586702!8452378!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7334 invoked from network); 1 Jun 2014 01:38:23 -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;
	1 Jun 2014 01:38:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquj7-0001Q0-UM
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquj7-0001hd-Rk
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:21 +0000
Date: Sun, 01 Jun 2014 01:38:21 +0000
Message-Id: <E1Wquj7-0001hd-Rk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Wed May 28 10:07:50 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 10:07:50 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 1895a78..f36aebc 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqujB-00042a-7O; Sun, 01 Jun 2014 01:38:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujA-00042Q-72
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:24 +0000
Received: from [85.158.143.35:17234] by server-1.bemta-4.messagelabs.com id
	57/98-09853-F048A835; Sun, 01 Jun 2014 01:38:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1401586702!8452378!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7334 invoked from network); 1 Jun 2014 01:38:23 -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;
	1 Jun 2014 01:38:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquj7-0001Q0-UM
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wquj7-0001hd-Rk
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:21 +0000
Date: Sun, 01 Jun 2014 01:38:21 +0000
Message-Id: <E1Wquj7-0001hd-Rk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Wed May 28 10:07:50 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 10:07:50 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 1895a78..f36aebc 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqujM-00044A-AE; Sun, 01 Jun 2014 01:38:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujK-00043v-S3
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:35 +0000
Received: from [85.158.137.68:29500] by server-8.bemta-3.messagelabs.com id
	A6/E9-21547-A148A835; Sun, 01 Jun 2014 01:38:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1401586712!7286202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24389 invoked from network); 1 Jun 2014 01:38:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:38:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujI-0001Q8-5s
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujI-0001i0-2d
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:32 +0000
Date: Sun, 01 Jun 2014 01:38:32 +0000
Message-Id: <E1WqujI-0001i0-2d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: don't use AML operations on
	64-bit fields
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f8d8abcf6dfb85fae591a547b24f9b27d92272c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 28 10:57:18 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 10:57:18 2014 +0200

    hvmloader: don't use AML operations on 64-bit fields
    
    WinXP and Win2K3, while having no problem with the QWordMemory resource
    (there was another one there before), don't like operations on 64-bit
    fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO
    ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling
    carry over explicitly.
    
    Sadly the constructs needed to create the sub-fields - nominally
    
        CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL)
        CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH)
    
    - can't be used: The former gets warned upon by newer iasl, i.e. would
    need to be replaced by the latter just with the addend changed to 0,
    and the latter doesn't translate properly with recent iasl). Hence,
    short of having an ASL/iasl expert at hand, we need to work around the
    shortcomings of various iasl versions. See the code comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/acpi/dsdt.asl |   50 +++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 415c63e..5610385 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
            MSUA, 32, /* MADT checksum address */
            MAPA, 32, /* MADT LAPIC0 address */
            VGIA, 32, /* VM generation id address */
-           HMIN, 64,
-           HLEN, 64
+           LMIN, 32,
+           HMIN, 32,
+           LLEN, 32,
+           HLEN, 32
        }
 
         /* Fix HCT test for 0x400 pci memory:
@@ -176,15 +178,41 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                 Add(MMIN, MLEN, MMAX)
                 Subtract(MMAX, One, MMAX)
 
-                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN)
-                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX)
-                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN)
-
-                Store(\_SB.HMIN, HMIN)
-                Store(\_SB.HLEN, HLEN)
-                Add(HMIN, HLEN, HMAX)
-                If(LOr(HMIN, HLEN)) {
-                    Subtract(HMAX, One, HMAX)
+                /*
+                 * WinXP / Win2K3 blue-screen for operations on 64-bit values.
+                 * Therefore we need to split the 64-bit calculations needed
+                 * here, but different iasl versions evaluate name references
+                 * to integers differently:
+                 * Year (approximate)          2006    2008    2012
+                 * \_SB.PCI0._CRS._Y02         zero   valid   valid
+                 * \_SB.PCI0._CRS._Y02._MIN   valid   valid    huge
+                 */
+                If(LEqual(Zero, \_SB.PCI0._CRS._Y02)) {
+                    Subtract(\_SB.PCI0._CRS._Y02._MIN, 14, Local0)
+                } Else {
+                    Store(\_SB.PCI0._CRS._Y02, Local0)
+                }
+                CreateDWordField(PRT0, Add(Local0, 14), MINL)
+                CreateDWordField(PRT0, Add(Local0, 18), MINH)
+                CreateDWordField(PRT0, Add(Local0, 22), MAXL)
+                CreateDWordField(PRT0, Add(Local0, 26), MAXH)
+                CreateDWordField(PRT0, Add(Local0, 38), LENL)
+                CreateDWordField(PRT0, Add(Local0, 42), LENH)
+
+                Store(\_SB.LMIN, MINL)
+                Store(\_SB.HMIN, MINH)
+                Store(\_SB.LLEN, LENL)
+                Store(\_SB.HLEN, LENH)
+                Add(MINL, LENL, MAXL)
+                Add(MINH, LENH, MAXH)
+                If(LLess(MAXL, MINL)) {
+                    Add(MAXH, One, MAXH)
+                }
+                If(LOr(MINH, LENL)) {
+                    If(LEqual(MAXL, 0)) {
+                        Subtract(MAXH, One, MAXH)
+                    }
+                    Subtract(MAXL, One, MAXL)
                 }
 
                 Return (PRT0)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 01 01:38:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 01 Jun 2014 01:38:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WqujM-00044A-AE; Sun, 01 Jun 2014 01:38:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujK-00043v-S3
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:35 +0000
Received: from [85.158.137.68:29500] by server-8.bemta-3.messagelabs.com id
	A6/E9-21547-A148A835; Sun, 01 Jun 2014 01:38:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1401586712!7286202!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24389 invoked from network); 1 Jun 2014 01:38:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Jun 2014 01:38:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujI-0001Q8-5s
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WqujI-0001i0-2d
	for xen-changelog@lists.xensource.com; Sun, 01 Jun 2014 01:38:32 +0000
Date: Sun, 01 Jun 2014 01:38:32 +0000
Message-Id: <E1WqujI-0001i0-2d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: don't use AML operations on
	64-bit fields
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7f8d8abcf6dfb85fae591a547b24f9b27d92272c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed May 28 10:57:18 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed May 28 10:57:18 2014 +0200

    hvmloader: don't use AML operations on 64-bit fields
    
    WinXP and Win2K3, while having no problem with the QWordMemory resource
    (there was another one there before), don't like operations on 64-bit
    fields. Split the fields d0688669 ("hvmloader: also cover PCI MMIO
    ranges above 4G with UC MTRR ranges") added to 32-bit ones, handling
    carry over explicitly.
    
    Sadly the constructs needed to create the sub-fields - nominally
    
        CreateDWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, MINL)
        CreateDWordField(PRT0, Add(\_SB.PCI0._CRS._Y02._MIN, 4), MINH)
    
    - can't be used: The former gets warned upon by newer iasl, i.e. would
    need to be replaced by the latter just with the addend changed to 0,
    and the latter doesn't translate properly with recent iasl). Hence,
    short of having an ASL/iasl expert at hand, we need to work around the
    shortcomings of various iasl versions. See the code comment.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/acpi/dsdt.asl |   50 +++++++++++++++++++++++++-------
 1 files changed, 39 insertions(+), 11 deletions(-)

diff --git a/tools/firmware/hvmloader/acpi/dsdt.asl b/tools/firmware/hvmloader/acpi/dsdt.asl
index 415c63e..5610385 100644
--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -57,8 +57,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
            MSUA, 32, /* MADT checksum address */
            MAPA, 32, /* MADT LAPIC0 address */
            VGIA, 32, /* VM generation id address */
-           HMIN, 64,
-           HLEN, 64
+           LMIN, 32,
+           HMIN, 32,
+           LLEN, 32,
+           HLEN, 32
        }
 
         /* Fix HCT test for 0x400 pci memory:
@@ -176,15 +178,41 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, "Xen", "HVM", 0)
                 Add(MMIN, MLEN, MMAX)
                 Subtract(MMAX, One, MMAX)
 
-                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MIN, HMIN)
-                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._MAX, HMAX)
-                CreateQWordField(PRT0, \_SB.PCI0._CRS._Y02._LEN, HLEN)
-
-                Store(\_SB.HMIN, HMIN)
-                Store(\_SB.HLEN, HLEN)
-                Add(HMIN, HLEN, HMAX)
-                If(LOr(HMIN, HLEN)) {
-                    Subtract(HMAX, One, HMAX)
+                /*
+                 * WinXP / Win2K3 blue-screen for operations on 64-bit values.
+                 * Therefore we need to split the 64-bit calculations needed
+                 * here, but different iasl versions evaluate name references
+                 * to integers differently:
+                 * Year (approximate)          2006    2008    2012
+                 * \_SB.PCI0._CRS._Y02         zero   valid   valid
+                 * \_SB.PCI0._CRS._Y02._MIN   valid   valid    huge
+                 */
+                If(LEqual(Zero, \_SB.PCI0._CRS._Y02)) {
+                    Subtract(\_SB.PCI0._CRS._Y02._MIN, 14, Local0)
+                } Else {
+                    Store(\_SB.PCI0._CRS._Y02, Local0)
+                }
+                CreateDWordField(PRT0, Add(Local0, 14), MINL)
+                CreateDWordField(PRT0, Add(Local0, 18), MINH)
+                CreateDWordField(PRT0, Add(Local0, 22), MAXL)
+                CreateDWordField(PRT0, Add(Local0, 26), MAXH)
+                CreateDWordField(PRT0, Add(Local0, 38), LENL)
+                CreateDWordField(PRT0, Add(Local0, 42), LENH)
+
+                Store(\_SB.LMIN, MINL)
+                Store(\_SB.HMIN, MINH)
+                Store(\_SB.LLEN, LENL)
+                Store(\_SB.HLEN, LENH)
+                Add(MINL, LENL, MAXL)
+                Add(MINH, LENH, MAXH)
+                If(LLess(MAXL, MINL)) {
+                    Add(MAXH, One, MAXH)
+                }
+                If(LOr(MINH, LENL)) {
+                    If(LEqual(MAXL, 0)) {
+                        Subtract(MAXH, One, MAXH)
+                    }
+                    Subtract(MAXL, One, MAXL)
                 }
 
                 Return (PRT0)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jun 04 23:44:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jun 2014 23:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WsKrY-0007JA-9m; Wed, 04 Jun 2014 23:44:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WsKrX-0007J0-7E
	for xen-changelog@lists.xensource.com; Wed, 04 Jun 2014 23:44:55 +0000
Received: from [85.158.143.35:22451] by server-3.bemta-4.messagelabs.com id
	66/C2-13602-67FAF835; Wed, 04 Jun 2014 23:44:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1401925488!9333716!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9956 invoked from network); 4 Jun 2014 23:44:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jun 2014 23:44:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WsKrQ-0008F9-E4
	for xen-changelog@lists.xensource.com; Wed, 04 Jun 2014 23:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WsKrP-0003rL-Sc
	for xen-changelog@lists.xensource.com; Wed, 04 Jun 2014 23:44:48 +0000
Date: Wed, 04 Jun 2014 23:44:47 +0000
Message-Id: <E1WsKrP-0003rL-Sc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'xen-staging/master' into xen-for-4.5-temp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3323743706982268757=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

commit 2addb502cdb50bab00514b9723bf6e09c88ff75e
Merge: 1e1a3289f473a460bee7a8745574f61c9e2f8506 65fc9b78ba3d868a26952db0d8e51cecf01d47b4
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 3 17:52:59 2014 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Jun 3 17:52:59 2014 +0000

    Merge remote-tracking branch 'xen-staging/master' into xen-for-4.5-temp

 .gitignore                                         |  153 +-
 .gitmodules                                        |   17 +-
 .mailmap                                           |    3 +-
 .travis.yml                                        |   81 +
 CODING_STYLE                                       |    7 +
 Changelog                                          |    2 +-
 MAINTAINERS                                        |  182 +-
 Makefile                                           |   70 +-
 Makefile.objs                                      |   28 +-
 Makefile.target                                    |   37 +-
 QMP/README                                         |   88 -
 QMP/qemu-ga-client                                 |  299 -
 QMP/qmp                                            |  126 -
 QMP/qmp-events.txt                                 |  480 -
 QMP/qmp-shell                                      |  286 -
 QMP/qmp-spec.txt                                   |  282 -
 QMP/qmp.py                                         |  190 -
 QMP/qom-fuse                                       |  138 -
 QMP/qom-get                                        |   67 -
 QMP/qom-list                                       |   64 -
 QMP/qom-set                                        |   64 -
 README                                             |    2 +-
 VERSION                                            |    2 +-
 aio-posix.c                                        |   55 +-
 aio-win32.c                                        |   58 +-
 arch_init.c                                        |  285 +-
 async.c                                            |   42 +-
 audio/audio.c                                      |   10 +-
 audio/mixeng.c                                     |    6 -
 audio/mixeng_template.h                            |    4 +-
 audio/noaudio.c                                    |    4 +-
 audio/ossaudio.c                                   |    4 +
 audio/paaudio.c                                    |    8 +-
 audio/spiceaudio.c                                 |   31 +-
 audio/wavaudio.c                                   |    2 +-
 backends/baum.c                                    |   24 +-
 backends/rng-egd.c                                 |    1 -
 backends/rng-random.c                              |    4 +-
 backends/rng.c                                     |   17 +-
 block-migration.c                                  |   29 +-
 block.c                                            | 2550 +-
 block/Makefile.objs                                |   21 +-
 block/backup.c                                     |   28 +-
 block/blkdebug.c                                   |  133 +-
 block/blkverify.c                                  |  168 +-
 block/bochs.c                                      |  125 +-
 block/cloop.c                                      |   84 +-
 block/commit.c                                     |   22 +-
 block/cow.c                                        |  185 +-
 block/curl.c                                       |  137 +-
 block/dmg.c                                        |  278 +-
 block/gluster.c                                    |  543 +-
 block/iscsi.c                                      | 1117 +-
 block/linux-aio.c                                  |   18 +-
 block/mirror.c                                     |  212 +-
 block/nbd-client.c                                 |  388 +
 block/nbd-client.h                                 |   50 +
 block/nbd.c                                        |  431 +-
 block/nfs.c                                        |  442 +
 block/parallels.c                                  |   20 +-
 block/qapi.c                                       |  225 +-
 block/qcow.c                                       |   41 +-
 block/qcow2-cache.c                                |   33 +
 block/qcow2-cluster.c                              |  377 +-
 block/qcow2-refcount.c                             |  716 +-
 block/qcow2-snapshot.c                             |  160 +-
 block/qcow2.c                                      |  873 +-
 block/qcow2.h                                      |  156 +-
 block/qed.c                                        |  122 +-
 block/qed.h                                        |    2 +-
 block/quorum.c                                     |  877 +
 block/raw-aio.h                                    |    3 +-
 block/raw-posix.c                                  |  472 +-
 block/raw-win32.c                                  |  106 +-
 block/raw.c                                        |  192 -
 block/raw_bsd.c                                    |  206 +
 block/rbd.c                                        |  174 +-
 block/sheepdog.c                                   |  586 +-
 block/snapshot.c                                   |  210 +-
 block/ssh.c                                        |   18 +-
 block/stream.c                                     |   36 +-
 block/vdi.c                                        |   90 +-
 block/vhdx-endian.c                                |  216 +
 block/vhdx-log.c                                   | 1021 +
 block/vhdx.c                                       | 1287 +-
 block/vhdx.h                                       |  181 +-
 block/vmdk.c                                       |  651 +-
 block/vpc.c                                        |  100 +-
 block/vvfat.c                                      |   96 +-
 block/win32-aio.c                                  |   10 +-
 blockdev-nbd.c                                     |   10 +-
 blockdev.c                                         | 1492 +-
 blockjob.c                                         |   31 +-
 bsd-user/main.c                                    |    2 +-
 bsd-user/qemu.h                                    |    6 +-
 configure                                          | 1307 +-
 cpu-exec.c                                         |  179 +-
 cpus.c                                             |  430 +-
 cputlb.c                                           |   76 +-
 default-configs/aarch64-linux-user.mak             |    3 +
 default-configs/aarch64-softmmu.mak                |    6 +
 default-configs/arm-linux-user.mak                 |    2 -
 default-configs/arm-softmmu.mak                    |   14 +-
 default-configs/armeb-linux-user.mak               |    2 -
 default-configs/m68k-linux-user.mak                |    2 -
 default-configs/m68k-softmmu.mak                   |    1 -
 default-configs/ppc-linux-user.mak                 |    2 -
 default-configs/ppc-softmmu.mak                    |    4 +-
 default-configs/ppc64-linux-user.mak               |    2 -
 default-configs/ppc64-softmmu.mak                  |    4 +-
 default-configs/ppc64abi32-linux-user.mak          |    2 -
 default-configs/ppcemb-softmmu.mak                 |   26 -
 default-configs/s390x-softmmu.mak                  |    1 +
 default-configs/sparc-softmmu.mak                  |    1 +
 device-hotplug.c                                   |    4 +-
 device_tree.c                                      |   68 +-
 disas.c                                            |   61 +-
 disas/Makefile.objs                                |    5 +
 disas/arm-a64.cc                                   |   87 +
 disas/i386.c                                       |  154 +-
 disas/libvixl/LICENCE                              |   30 +
 disas/libvixl/Makefile.objs                        |    8 +
 disas/libvixl/README                               |   12 +
 disas/libvixl/a64/assembler-a64.h                  | 1784 +
 disas/libvixl/a64/constants-a64.h                  | 1104 +
 disas/libvixl/a64/cpu-a64.h                        |   56 +
 disas/libvixl/a64/decoder-a64.cc                   |  712 +
 disas/libvixl/a64/decoder-a64.h                    |  198 +
 disas/libvixl/a64/disasm-a64.cc                    | 1678 +
 disas/libvixl/a64/disasm-a64.h                     |  109 +
 disas/libvixl/a64/instructions-a64.cc              |  238 +
 disas/libvixl/a64/instructions-a64.h               |  344 +
 disas/libvixl/globals.h                            |   65 +
 disas/libvixl/platform.h                           |   43 +
 disas/libvixl/utils.cc                             |  126 +
 disas/libvixl/utils.h                              |  126 +
 disas/ppc.c                                        |    3 +-
 dma-helpers.c                                      |    2 +
 docs/ccid.txt                                      |    2 +-
 docs/memory.txt                                    |   68 +-
 docs/q35-chipset.cfg                               |   23 +
 docs/qapi-code-gen.txt                             |   24 +-
 docs/qemupciserial.inf                             |  167 +-
 docs/qmp/README                                    |   87 +
 docs/qmp/qmp-events.txt                            |  541 +
 docs/qmp/qmp-spec.txt                              |  273 +
 docs/rdma.txt                                      |   26 +-
 docs/specs/acpi_cpu_hotplug.txt                    |    4 +-
 docs/specs/qcow2.txt                               |   10 +-
 docs/tracing.txt                                   |   36 +
 dump.c                                             |  974 +-
 exec.c                                             | 1081 +-
 fpu/softfloat.c                                    | 1155 +-
 fsdev/Makefile.objs                                |    4 +-
 fsdev/virtfs-proxy-helper.c                        |    2 +-
 gdb-xml/aarch64-core.xml                           |   46 +
 gdb-xml/aarch64-fpu.xml                            |   86 +
 gdbstub.c                                          |   71 +-
 hmp-commands.hx                                    |   93 +-
 hmp.c                                              |  175 +-
 hmp.h                                              |    5 +
 hw/9pfs/cofile.c                                   |    4 -
 hw/9pfs/cofs.c                                     |   48 +-
 hw/9pfs/virtio-9p-device.c                         |   43 +-
 hw/9pfs/virtio-9p-handle.c                         |   17 +-
 hw/9pfs/virtio-9p-local.c                          |  298 +-
 hw/9pfs/virtio-9p-posix-acl.c                      |   52 +-
 hw/9pfs/virtio-9p-proxy.c                          |    3 +-
 hw/9pfs/virtio-9p-xattr-user.c                     |   27 +-
 hw/9pfs/virtio-9p-xattr.c                          |   15 +-
 hw/9pfs/virtio-9p-xattr.h                          |   27 +-
 hw/9pfs/virtio-9p.c                                |   12 +-
 hw/9pfs/virtio-9p.h                                |    6 +-
 hw/Makefile.objs                                   |    4 +-
 hw/acpi/Makefile.objs                              |    3 +-
 hw/acpi/core.c                                     |   69 +-
 hw/acpi/cpu_hotplug.c                              |   65 +
 hw/acpi/ich9.c                                     |   62 +-
 hw/acpi/pcihp.c                                    |  331 +
 hw/acpi/piix4.c                                    |  478 +-
 hw/alpha/dp264.c                                   |    6 +-
 hw/alpha/typhoon.c                                 |  206 +-
 hw/arm/Makefile.objs                               |    7 +-
 hw/arm/allwinner-a10.c                             |  119 +
 hw/arm/armv7m.c                                    |   30 +-
 hw/arm/boot.c                                      |  274 +-
 hw/arm/collie.c                                    |    1 -
 hw/arm/cubieboard.c                                |   76 +
 hw/arm/digic.c                                     |  115 +
 hw/arm/digic_boards.c                              |  162 +
 hw/arm/exynos4210.c                                |   34 +-
 hw/arm/exynos4_boards.c                            |    5 +-
 hw/arm/gumstix.c                                   |   13 +-
 hw/arm/highbank.c                                  |   55 +-
 hw/arm/integratorcp.c                              |   24 +-
 hw/arm/kzm.c                                       |    9 +-
 hw/arm/mainstone.c                                 |   21 +-
 hw/arm/musicpal.c                                  |   21 +-
 hw/arm/nseries.c                                   |    8 +-
 hw/arm/omap1.c                                     |   84 +-
 hw/arm/omap2.c                                     |    8 +-
 hw/arm/omap_sx1.c                                  |   15 +-
 hw/arm/palm.c                                      |   14 +-
 hw/arm/pic_cpu.c                                   |   68 -
 hw/arm/pxa2xx.c                                    |  151 +-
 hw/arm/pxa2xx_gpio.c                               |    2 +-
 hw/arm/pxa2xx_pic.c                                |   15 +-
 hw/arm/realview.c                                  |   49 +-
 hw/arm/spitz.c                                     |   25 +-
 hw/arm/stellaris.c                                 |   20 +-
 hw/arm/strongarm.c                                 |   40 +-
 hw/arm/tosa.c                                      |   19 +-
 hw/arm/versatilepb.c                               |   14 +-
 hw/arm/vexpress.c                                  |  190 +-
 hw/arm/virt.c                                      |  458 +
 hw/arm/xilinx_zynq.c                               |   53 +-
 hw/arm/z2.c                                        |   42 +-
 hw/audio/ac97.c                                    |    4 +-
 hw/audio/adlib.c                                   |    8 +-
 hw/audio/cs4231a.c                                 |    2 +-
 hw/audio/es1370.c                                  |    4 +-
 hw/audio/fmopl.c                                   |    6 +-
 hw/audio/gus.c                                     |    2 +-
 hw/audio/hda-codec-common.h                        |  456 +
 hw/audio/hda-codec.c                               |  520 +-
 hw/audio/intel-hda.c                               |   17 +-
 hw/audio/intel-hda.h                               |    2 +-
 hw/audio/marvell_88w8618.c                         |    2 +
 hw/audio/pcspk.c                                   |    5 +-
 hw/audio/pl041.c                                   |    1 -
 hw/audio/sb16.c                                    |   10 +-
 hw/audio/wm8750.c                                  |   33 +-
 hw/block/cdrom.c                                   |   10 +-
 hw/block/dataplane/virtio-blk.c                    |  231 +-
 hw/block/dataplane/virtio-blk.h                    |    5 +-
 hw/block/fdc.c                                     |    9 +-
 hw/block/m25p80.c                                  |   14 +-
 hw/block/nand.c                                    |    2 +-
 hw/block/nvme.c                                    |   26 +-
 hw/block/pflash_cfi01.c                            |  262 +-
 hw/block/pflash_cfi02.c                            |   12 +-
 hw/block/tc58128.c                                 |   10 +-
 hw/block/virtio-blk.c                              |   50 +-
 hw/block/xen_blkif.h                               |   12 +
 hw/block/xen_disk.c                                |   73 +-
 hw/bt/core.c                                       |   23 +
 hw/bt/hci-csr.c                                    |    4 +-
 hw/bt/hci.c                                        |   86 +-
 hw/bt/l2cap.c                                      |    8 +-
 hw/char/Makefile.objs                              |    5 +-
 hw/char/cadence_uart.c                             |  161 +-
 hw/char/debugcon.c                                 |    4 +-
 hw/char/digic-uart.c                               |  195 +
 hw/char/exynos4210_uart.c                          |    6 +-
 hw/char/ipack.c                                    |  116 -
 hw/char/ipack.h                                    |   79 -
 hw/char/ipoctal232.c                               |   20 +-
 hw/char/lm32_juart.c                               |    2 +-
 hw/char/lm32_uart.c                                |    2 +-
 hw/char/milkymist-uart.c                           |   26 +-
 hw/char/parallel.c                                 |    2 +-
 hw/char/pl011.c                                    |   24 +-
 hw/char/sclpconsole-lm.c                           |  379 +
 hw/char/sclpconsole.c                              |  114 +-
 hw/char/serial-isa.c                               |    2 +-
 hw/char/serial-pci.c                               |    5 +-
 hw/char/serial.c                                   |   33 +-
 hw/char/sh_serial.c                                |    2 -
 hw/char/spapr_vty.c                                |    1 +
 hw/char/tpci200.c                                  |  672 -
 hw/char/virtio-console.c                           |   69 +-
 hw/char/virtio-serial-bus.c                        |   96 +-
 hw/core/Makefile.objs                              |    4 +-
 hw/core/fw-path-provider.c                         |   52 +
 hw/core/hotplug.c                                  |   48 +
 hw/core/irq.c                                      |   16 +
 hw/core/loader.c                                   |  126 +-
 hw/core/machine.c                                  |   28 +
 hw/core/null-machine.c                             |    1 -
 hw/core/ptimer.c                                   |   18 +-
 hw/core/qdev-properties-system.c                   |   99 +-
 hw/core/qdev-properties.c                          |  254 +-
 hw/core/qdev.c                                     |  300 +-
 hw/core/sysbus.c                                   |   15 +-
 hw/cpu/Makefile.objs                               |    5 +-
 hw/cpu/a15mpcore.c                                 |   92 +-
 hw/cpu/a9mpcore.c                                  |  148 +-
 hw/cpu/arm11mpcore.c                               |  251 +-
 hw/cpu/icc_bus.c                                   |   17 +-
 hw/cpu/realview_mpcore.c                           |  139 +
 hw/cris/Makefile.objs                              |    1 -
 hw/cris/axis_dev88.c                               |   19 +-
 hw/cris/pic_cpu.c                                  |   47 -
 hw/display/Makefile.objs                           |    4 +-
 hw/display/ads7846.c                               |    7 +-
 hw/display/blizzard.c                              |    2 +-
 hw/display/blizzard_template.h                     |   40 +-
 hw/display/cg3.c                                   |  385 +
 hw/display/cirrus_vga.c                            |    9 +-
 hw/display/exynos4210_fimd.c                       |    2 +-
 hw/display/g364fb.c                                |    4 +-
 hw/display/jazz_led.c                              |    2 +-
 hw/display/milkymist-vgafb.c                       |    2 +-
 hw/display/milkymist-vgafb_template.h              |    2 +-
 hw/display/omap_lcdc.c                             |    2 +-
 hw/display/pl110.c                                 |   21 +-
 hw/display/pl110_template.h                        |   12 +-
 hw/display/pxa2xx_lcd.c                            |    2 +-
 hw/display/pxa2xx_template.h                       |   22 +-
 hw/display/qxl-logger.c                            |    2 +-
 hw/display/qxl-render.c                            |    1 +
 hw/display/qxl.c                                   |  114 +-
 hw/display/qxl.h                                   |    6 +-
 hw/display/sm501.c                                 |    3 +-
 hw/display/sm501_template.h                        |    2 +-
 hw/display/ssd0303.c                               |   20 +-
 hw/display/ssd0323.c                               |   11 +-
 hw/display/tc6393xb.c                              |    2 +-
 hw/display/tc6393xb_template.h                     |   14 +-
 hw/display/tcx.c                                   |   32 +-
 hw/display/vga-isa-mm.c                            |    2 +-
 hw/display/vga-isa.c                               |    2 +-
 hw/display/vga-pci.c                               |    4 +-
 hw/display/vga.c                                   |   12 +-
 hw/display/vga_template.h                          |   14 +-
 hw/display/vmware_vga.c                            |    8 +-
 hw/display/xenfb.c                                 |    9 +-
 hw/dma/i82374.c                                    |    2 +-
 hw/dma/pl080.c                                     |   10 +-
 hw/dma/pl330.c                                     |   61 +-
 hw/dma/rc4030.c                                    |    4 +-
 hw/dma/soc_dma.c                                   |    8 +-
 hw/dma/sparc32_dma.c                               |    2 +
 hw/dma/sun4m_iommu.c                               |    5 +-
 hw/dma/xilinx_axidma.c                             |   38 +-
 hw/gpio/max7310.c                                  |   23 +-
 hw/gpio/omap_gpio.c                                |    4 +
 hw/i2c/bitbang_i2c.c                               |    6 +-
 hw/i2c/bitbang_i2c.h                               |    2 +-
 hw/i2c/core.c                                      |   32 +-
 hw/i2c/exynos4210_i2c.c                            |    2 +-
 hw/i2c/omap_i2c.c                                  |    6 +-
 hw/i2c/pm_smbus.c                                  |    2 +-
 hw/i2c/smbus.c                                     |   18 +-
 hw/i2c/smbus_eeprom.c                              |    4 +-
 hw/i2c/smbus_ich9.c                                |    8 +-
 hw/i2c/versatile_i2c.c                             |    2 +-
 hw/i386/Makefile.objs                              |   29 +-
 hw/i386/acpi-build.c                               | 1558 +
 hw/i386/acpi-build.h                               |    9 +
 hw/i386/acpi-defs.h                                |  317 +
 hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |  104 +
 hw/i386/acpi-dsdt-dbug.dsl                         |   41 +
 hw/i386/acpi-dsdt-hpet.dsl                         |   48 +
 hw/i386/acpi-dsdt-isa.dsl                          |  128 +
 hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 +
 hw/i386/acpi-dsdt.dsl                              |  360 +
 hw/i386/acpi-dsdt.hex.generated                    | 4485 ++
 hw/i386/bios-linker-loader.c                       |  157 +
 hw/i386/bios-linker-loader.h                       |   27 +
 hw/i386/kvm/apic.c                                 |   16 +-
 hw/i386/kvm/clock.c                                |    5 +-
 hw/i386/kvm/i8254.c                                |   14 +-
 hw/i386/kvm/ioapic.c                               |    8 +-
 hw/i386/kvm/pci-assign.c                           |  102 +-
 hw/i386/kvmvapic.c                                 |   20 +-
 hw/i386/pc.c                                       |  159 +-
 hw/i386/pc_piix.c                                  |  328 +-
 hw/i386/pc_q35.c                                   |  160 +-
 hw/i386/pc_sysfw.c                                 |  110 +-
 hw/i386/q35-acpi-dsdt.dsl                          |  452 +
 hw/i386/q35-acpi-dsdt.hex.generated                | 7383 +++
 hw/i386/smbios.c                                   |  353 +-
 hw/i386/ssdt-misc.dsl                              |  119 +
 hw/i386/ssdt-misc.hex.generated                    |  386 +
 hw/i386/ssdt-pcihp.dsl                             |  100 +
 hw/i386/ssdt-pcihp.hex.generated                   |  251 +
 hw/i386/ssdt-proc.dsl                              |   63 +
 hw/i386/ssdt-proc.hex.generated                    |  134 +
 hw/i386/xen/Makefile.objs                          |    1 +
 hw/i386/xen/xen_apic.c                             |   97 +
 hw/i386/xen/xen_platform.c                         |  450 +
 hw/i386/xen/xen_pvdevice.c                         |  135 +
 hw/i386/xen_domainbuild.c                          |  299 -
 hw/i386/xen_domainbuild.h                          |   13 -
 hw/i386/xen_machine_pv.c                           |  110 -
 hw/ide/ahci.c                                      |   28 +-
 hw/ide/ahci.h                                      |   10 +-
 hw/ide/atapi.c                                     |   16 +-
 hw/ide/cmd646.c                                    |    4 +-
 hw/ide/core.c                                      |   60 +-
 hw/ide/ich.c                                       |    3 +-
 hw/ide/internal.h                                  |    5 +-
 hw/ide/isa.c                                       |    6 +-
 hw/ide/macio.c                                     |    2 +-
 hw/ide/microdrive.c                                |  226 +-
 hw/ide/mmio.c                                      |    2 +-
 hw/ide/pci.c                                       |    2 +-
 hw/ide/piix.c                                      |   12 +-
 hw/ide/qdev.c                                      |    7 +-
 hw/ide/via.c                                       |    3 +-
 hw/input/hid.c                                     |   10 +-
 hw/input/lm832x.c                                  |   30 +-
 hw/input/pckbd.c                                   |    3 +-
 hw/input/pxa2xx_keypad.c                           |    6 +-
 hw/input/tsc2005.c                                 |   16 +-
 hw/input/tsc210x.c                                 |   32 +-
 hw/input/vmmouse.c                                 |    3 +-
 hw/intc/Makefile.objs                              |    3 +
 hw/intc/allwinner-a10-pic.c                        |  200 +
 hw/intc/apic.c                                     |   73 +-
 hw/intc/apic_common.c                              |   88 +-
 hw/intc/arm_gic.c                                  |  224 +-
 hw/intc/arm_gic_common.c                           |   31 +-
 hw/intc/arm_gic_kvm.c                              |  447 +-
 hw/intc/armv7m_nvic.c                              |   16 +-
 hw/intc/etraxfs_pic.c                              |    4 +
 hw/intc/exynos4210_combiner.c                      |    2 +-
 hw/intc/gic_internal.h                             |  105 +-
 hw/intc/grlib_irqmp.c                              |    2 +
 hw/intc/i8259.c                                    |    4 +-
 hw/intc/i8259_common.c                             |   14 +-
 hw/intc/ioapic.c                                   |   16 +-
 hw/intc/ioapic_common.c                            |   16 +-
 hw/intc/omap_intc.c                                |    4 +
 hw/intc/openpic.c                                  |   14 +-
 hw/intc/openpic_kvm.c                              |   14 +-
 hw/intc/pl190.c                                    |    1 -
 hw/intc/realview_gic.c                             |   58 +-
 hw/intc/s390_flic.c                                |  322 +
 hw/intc/slavio_intctl.c                            |    2 +-
 hw/intc/xics.c                                     |  387 +-
 hw/intc/xics_kvm.c                                 |  503 +
 hw/intc/xilinx_intc.c                              |    3 +-
 hw/ipack/Makefile.objs                             |    2 +
 hw/ipack/ipack.c                                   |  120 +
 hw/ipack/tpci200.c                                 |  672 +
 hw/isa/isa-bus.c                                   |    1 -
 hw/isa/lpc_ich9.c                                  |   47 +-
 hw/isa/pc87312.c                                   |    2 +-
 hw/isa/piix4.c                                     |    8 +-
 hw/isa/vt82c686.c                                  |   12 +-
 hw/lm32/lm32_boards.c                              |   12 +-
 hw/lm32/lm32_hwsetup.h                             |    2 +-
 hw/lm32/milkymist.c                                |    9 +-
 hw/m68k/an5206.c                                   |    5 +-
 hw/m68k/dummy_m68k.c                               |    1 -
 hw/m68k/mcf5208.c                                  |    5 +-
 hw/microblaze/Makefile.objs                        |    1 -
 hw/microblaze/boot.c                               |   54 +-
 hw/microblaze/boot.h                               |    4 +-
 hw/microblaze/petalogix_ml605_mmu.c                |   74 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c           |   45 +-
 hw/microblaze/pic_cpu.c                            |   47 -
 hw/microblaze/pic_cpu.h                            |    8 -
 hw/mips/cputimer.c                                 |   16 +-
 hw/mips/gt64xxx_pci.c                              |    6 +
 hw/mips/mips_fulong2e.c                            |    3 +-
 hw/mips/mips_jazz.c                                |   26 +-
 hw/mips/mips_malta.c                               |   39 +-
 hw/mips/mips_mipssim.c                             |    5 +-
 hw/mips/mips_r4k.c                                 |    1 -
 hw/misc/Makefile.objs                              |    5 +-
 hw/misc/a9scu.c                                    |   25 +-
 hw/misc/applesmc.c                                 |    3 +-
 hw/misc/arm11scu.c                                 |  100 +
 hw/misc/arm_integrator_debug.c                     |   99 +
 hw/misc/arm_l2x0.c                                 |    1 -
 hw/misc/arm_sysctl.c                               |    6 +-
 hw/misc/debugexit.c                                |    4 +-
 hw/misc/eccmemctl.c                                |    2 +-
 hw/misc/exynos4210_pmu.c                           |    3 +-
 hw/misc/ivshmem.c                                  |    2 +-
 hw/misc/lm32_sys.c                                 |    8 +-
 hw/misc/macio/cuda.c                               |   38 +-
 hw/misc/macio/macio.c                              |   17 +-
 hw/misc/max111x.c                                  |   54 +-
 hw/misc/pvpanic.c                                  |   12 +-
 hw/misc/pxa2xx_pcmcia.c                            |  207 -
 hw/misc/tmp105.c                                   |    8 +-
 hw/misc/vfio.c                                     |  945 +-
 hw/misc/vmport.c                                   |    3 +-
 hw/misc/zynq_slcr.c                                |    5 +
 hw/moxie/moxiesim.c                                |    2 +-
 hw/net/Makefile.objs                               |    4 +
 hw/net/allwinner_emac.c                            |  539 +
 hw/net/cadence_gem.c                               |  278 +-
 hw/net/dp8393x.c                                   |   20 +-
 hw/net/e1000.c                                     |  244 +-
 hw/net/eepro100.c                                  |    4 +-
 hw/net/etraxfs_eth.c                               |    2 +
 hw/net/fsl_etsec/etsec.c                           |  465 +
 hw/net/fsl_etsec/etsec.h                           |  174 +
 hw/net/fsl_etsec/miim.c                            |  146 +
 hw/net/fsl_etsec/registers.c                       |  295 +
 hw/net/fsl_etsec/registers.h                       |  320 +
 hw/net/fsl_etsec/rings.c                           |  650 +
 hw/net/lan9118.c                                   |   10 +-
 hw/net/lance.c                                     |    2 +
 hw/net/ne2000-isa.c                                |    2 +-
 hw/net/ne2000.c                                    |    7 +-
 hw/net/opencores_eth.c                             |   33 +-
 hw/net/pcnet-pci.c                                 |    7 +-
 hw/net/pcnet.c                                     |   10 +-
 hw/net/rtl8139.c                                   |   37 +-
 hw/net/smc91c111.c                                 |    1 +
 hw/net/spapr_llan.c                                |    6 +
 hw/net/stellaris_enet.c                            |    3 +-
 hw/net/vhost_net.c                                 |    8 +-
 hw/net/virtio-net.c                                |  164 +-
 hw/net/vmware_utils.h                              |   16 +-
 hw/net/vmxnet3.c                                   |   93 +-
 hw/net/vmxnet3.h                                   |    2 -
 hw/net/xilinx_axienet.c                            |   37 +-
 hw/nvram/eeprom93xx.c                              |   62 +-
 hw/nvram/fw_cfg.c                                  |   40 +-
 hw/nvram/spapr_nvram.c                             |   17 +-
 hw/openrisc/cputimer.c                             |   35 +-
 hw/openrisc/openrisc_sim.c                         |    4 +-
 hw/openrisc/pic_cpu.c                              |   17 +-
 hw/pci-bridge/dec.c                                |    6 +
 hw/pci-bridge/pci_bridge_dev.c                     |   11 +-
 hw/pci-host/apb.c                                  |   16 +-
 hw/pci-host/bonito.c                               |    8 +-
 hw/pci-host/grackle.c                              |   10 +-
 hw/pci-host/pam.c                                  |    2 +-
 hw/pci-host/piix.c                                 |   84 +-
 hw/pci-host/ppce500.c                              |    5 +
 hw/pci-host/prep.c                                 |  248 +-
 hw/pci-host/q35.c                                  |   96 +-
 hw/pci-host/uninorth.c                             |   28 +-
 hw/pci-host/versatile.c                            |   10 +-
 hw/pci/Makefile.objs                               |    2 +-
 hw/pci/msi.c                                       |    2 +-
 hw/pci/msix.c                                      |    2 +-
 hw/pci/pci-hotplug-old.c                           |    6 +-
 hw/pci/pci.c                                       |  303 +-
 hw/pci/pci_bridge.c                                |    9 +-
 hw/pci/pci_host.c                                  |   14 +-
 hw/pci/pcie.c                                      |   75 +-
 hw/pci/pcie_aer.c                                  |    8 +-
 hw/pci/pcie_host.c                                 |   24 -
 hw/pci/pcie_port.c                                 |    8 +
 hw/pci/shpc.c                                      |  128 +-
 hw/pcmcia/Makefile.objs                            |    2 +
 hw/pcmcia/pcmcia.c                                 |   24 +
 hw/pcmcia/pxa2xx.c                                 |  285 +
 hw/ppc/Makefile.objs                               |    6 +-
 hw/ppc/e500.c                                      |  306 +-
 hw/ppc/e500.h                                      |   13 +-
 hw/ppc/e500plat.c                                  |   21 +-
 hw/ppc/mac.h                                       |    1 -
 hw/ppc/mac_newworld.c                              |    4 +-
 hw/ppc/mac_oldworld.c                              |    4 +-
 hw/ppc/mpc8544ds.c                                 |   21 +-
 hw/ppc/ppc.c                                       |  186 +-
 hw/ppc/ppc405_boards.c                             |   41 +-
 hw/ppc/ppc405_uc.c                                 |   71 +-
 hw/ppc/ppc440_bamboo.c                             |   32 +-
 hw/ppc/ppc4xx_devs.c                               |    4 +-
 hw/ppc/ppc4xx_pci.c                                |    5 +
 hw/ppc/ppc_booke.c                                 |   87 +-
 hw/ppc/ppce500_spin.c                              |    8 +-
 hw/ppc/prep.c                                      |  155 +-
 hw/ppc/spapr.c                                     |  331 +-
 hw/ppc/spapr_events.c                              |    6 +-
 hw/ppc/spapr_hcall.c                               |  221 +-
 hw/ppc/spapr_iommu.c                               |  108 +-
 hw/ppc/spapr_pci.c                                 |  232 +-
 hw/ppc/spapr_rtas.c                                |  134 +-
 hw/ppc/spapr_vio.c                                 |   17 +-
 hw/ppc/virtex_ml507.c                              |   97 +-
 hw/s390x/Makefile.objs                             |    1 +
 hw/s390x/css.c                                     |   23 +-
 hw/s390x/css.h                                     |    2 +
 hw/s390x/event-facility.c                          |  112 +-
 hw/s390x/ipl.c                                     |   39 +-
 hw/s390x/s390-virtio-bus.c                         |   66 +-
 hw/s390x/s390-virtio-ccw.c                         |   22 +-
 hw/s390x/s390-virtio-hcall.c                       |   14 +-
 hw/s390x/s390-virtio.c                             |   13 +-
 hw/s390x/sclp.c                                    |  122 +-
 hw/s390x/sclpcpu.c                                 |  112 +
 hw/s390x/sclpquiesce.c                             |   29 +-
 hw/s390x/virtio-ccw.c                              |  260 +-
 hw/s390x/virtio-ccw.h                              |    5 +-
 hw/scsi/esp-pci.c                                  |    5 +-
 hw/scsi/esp.c                                      |    2 +-
 hw/scsi/lsi53c895a.c                               |   55 +-
 hw/scsi/megasas.c                                  |   33 +-
 hw/scsi/scsi-bus.c                                 |   78 +-
 hw/scsi/scsi-disk.c                                |  239 +-
 hw/scsi/scsi-generic.c                             |    4 +-
 hw/scsi/spapr_vscsi.c                              |  266 +-
 hw/scsi/srp.h                                      |    7 +
 hw/scsi/vhost-scsi.c                               |   45 +-
 hw/scsi/virtio-scsi.c                              |   69 +-
 hw/scsi/vmw_pvscsi.c                               |   14 +-
 hw/sd/milkymist-memcard.c                          |    4 +
 hw/sd/omap_mmc.c                                   |    6 +
 hw/sd/pl181.c                                      |    5 +-
 hw/sd/pxa2xx_mmci.c                                |    3 +
 hw/sd/sd.c                                         |    5 +
 hw/sd/sdhci.c                                      |   36 +-
 hw/sd/ssi-sd.c                                     |   10 +-
 hw/sh4/r2d.c                                       |    5 +-
 hw/sh4/sh7750.c                                    |    2 +-
 hw/sh4/sh_pci.c                                    |    6 +
 hw/sh4/shix.c                                      |   17 +-
 hw/sparc/leon3.c                                   |    7 +-
 hw/sparc/sun4m.c                                   |  213 +-
 hw/sparc64/sun4u.c                                 |   82 +-
 hw/ssi/ssi.c                                       |   11 +-
 hw/ssi/xilinx_spips.c                              |    4 +-
 hw/timer/Makefile.objs                             |    4 +
 hw/timer/a9gtimer.c                                |  369 +
 hw/timer/allwinner-a10-pit.c                       |  254 +
 hw/timer/arm_mptimer.c                             |   73 +-
 hw/timer/arm_timer.c                               |    3 +
 hw/timer/cadence_ttc.c                             |    6 +-
 hw/timer/digic-timer.c                             |  163 +
 hw/timer/ds1338.c                                  |   21 +-
 hw/timer/etraxfs_timer.c                           |    2 +-
 hw/timer/exynos4210_mct.c                          |    3 +-
 hw/timer/exynos4210_pwm.c                          |    1 +
 hw/timer/exynos4210_rtc.c                          |    4 +-
 hw/timer/grlib_gptimer.c                           |    7 +-
 hw/timer/hpet.c                                    |   51 +-
 hw/timer/i8254.c                                   |   28 +-
 hw/timer/i8254_common.c                            |   11 +-
 hw/timer/imx_epit.c                                |   95 +-
 hw/timer/imx_gpt.c                                 |    1 +
 hw/timer/lm32_timer.c                              |    1 +
 hw/timer/m48t59.c                                  |   29 +-
 hw/timer/mc146818rtc.c                             |   76 +-
 hw/timer/omap_gptimer.c                            |   24 +-
 hw/timer/omap_synctimer.c                          |    2 +-
 hw/timer/pl031.c                                   |   20 +-
 hw/timer/puv3_ost.c                                |    1 +
 hw/timer/pxa2xx_timer.c                            |   34 +-
 hw/timer/sh_timer.c                                |    1 +
 hw/timer/slavio_timer.c                            |   26 +-
 hw/timer/tusb6010.c                                |   12 +-
 hw/timer/twl92230.c                                |   49 +-
 hw/timer/xilinx_timer.c                            |    1 +
 hw/tpm/tpm_tis.c                                   |    1 +
 hw/unicore32/puv3.c                                |    7 +-
 hw/usb/Makefile.objs                               |    5 +-
 hw/usb/bus.c                                       |   36 +-
 hw/usb/ccid-card-emulated.c                        |    8 +-
 hw/usb/combined-packet.c                           |    1 +
 hw/usb/core.c                                      |   25 +
 hw/usb/desc-msos.c                                 |  234 +
 hw/usb/desc.c                                      |   51 +-
 hw/usb/desc.h                                      |   22 +-
 hw/usb/dev-audio.c                                 |    2 +-
 hw/usb/dev-bluetooth.c                             |   12 +-
 hw/usb/dev-hid.c                                   |   16 +-
 hw/usb/dev-hub.c                                   |    4 +-
 hw/usb/dev-network.c                               |    7 +-
 hw/usb/dev-serial.c                                |    2 +-
 hw/usb/dev-smartcard-reader.c                      |    6 +-
 hw/usb/dev-storage.c                               |   14 +-
 hw/usb/dev-uas.c                                   |  178 +-
 hw/usb/dev-wacom.c                                 |    2 +-
 hw/usb/hcd-ehci-pci.c                              |    4 +-
 hw/usb/hcd-ehci.c                                  |   31 +-
 hw/usb/hcd-ehci.h                                  |    1 -
 hw/usb/hcd-musb.c                                  |    8 +-
 hw/usb/hcd-ohci.c                                  |   52 +-
 hw/usb/hcd-uhci.c                                  |   27 +-
 hw/usb/hcd-xhci.c                                  |  391 +-
 hw/usb/host-bsd.c                                  |  639 -
 hw/usb/host-legacy.c                               |    2 +-
 hw/usb/host-libusb.c                               |   36 +-
 hw/usb/host-linux.c                                | 1911 -
 hw/usb/redirect.c                                  |   16 +-
 hw/virtio/dataplane/Makefile.objs                  |    2 +-
 hw/virtio/dataplane/hostmem.c                      |  183 -
 hw/virtio/dataplane/vring.c                        |  253 +-
 hw/virtio/virtio-balloon.c                         |   47 +-
 hw/virtio/virtio-bus.c                             |   82 +-
 hw/virtio/virtio-mmio.c                            |   19 +-
 hw/virtio/virtio-pci.c                             |  162 +-
 hw/virtio/virtio-pci.h                             |    1 -
 hw/virtio/virtio-rng.c                             |   75 +-
 hw/virtio/virtio.c                                 |   73 +-
 hw/watchdog/watchdog.c                             |    3 +-
 hw/watchdog/wdt_i6300esb.c                         |    6 +-
 hw/watchdog/wdt_ib700.c                            |   10 +-
 hw/xen/Makefile.objs                               |    1 -
 hw/xen/xen_apic.c                                  |   95 -
 hw/xen/xen_backend.c                               |   19 +-
 hw/xen/xen_platform.c                              |  449 -
 hw/xen/xen_pt.c                                    |    7 +-
 hw/xen/xen_pt_config_init.c                        |    6 +-
 hw/xen/xen_pt_msi.c                                |    6 +-
 hw/xen/xen_pvdevice.c                              |  131 -
 hw/xenpv/Makefile.objs                             |    2 +
 hw/xenpv/xen_domainbuild.c                         |  299 +
 hw/xenpv/xen_domainbuild.h                         |   13 +
 hw/xenpv/xen_machine_pv.c                          |  109 +
 hw/xtensa/pic_cpu.c                                |   10 +-
 hw/xtensa/xtensa_lx60.c                            |   53 +-
 hw/xtensa/xtensa_sim.c                             |    1 -
 include/block/aio.h                                |   82 +-
 include/block/block.h                              |  148 +-
 include/block/block_int.h                          |  169 +-
 include/block/blockjob.h                           |   16 +-
 include/block/coroutine.h                          |   19 +-
 include/block/nbd.h                                |    6 -
 include/block/qapi.h                               |    3 +
 include/block/snapshot.h                           |   29 +-
 include/disas/bfd.h                                |    1 +
 include/elf.h                                      |   76 +
 include/exec/cpu-all.h                             |   29 +-
 include/exec/cpu-common.h                          |   45 +-
 include/exec/cpu-defs.h                            |   64 +-
 include/exec/cputlb.h                              |    6 +-
 include/exec/def-helper.h                          |    3 +-
 include/exec/exec-all.h                            |  153 +-
 include/exec/gen-icount.h                          |   14 +-
 include/exec/ioport.h                              |    2 +
 include/exec/memory-internal.h                     |   90 -
 include/exec/memory.h                              |   24 +-
 include/exec/ram_addr.h                            |  150 +
 include/exec/softmmu_defs.h                        |   37 -
 include/exec/softmmu_exec.h                        |    3 +-
 include/exec/softmmu_template.h                    |  609 +-
 include/exec/user/abitypes.h                       |    4 -
 include/fpu/softfloat.h                            |  111 +-
 include/hw/acpi/acpi.h                             |   15 +-
 include/hw/acpi/cpu_hotplug.h                      |   27 +
 include/hw/acpi/cpu_hotplug_defs.h                 |   32 +
 include/hw/acpi/ich9.h                             |    6 +
 include/hw/acpi/pcihp.h                            |   75 +
 include/hw/acpi/piix4.h                            |    8 +
 include/hw/arm/allwinner-a10.h                     |   38 +
 include/hw/arm/arm.h                               |   12 +-
 include/hw/arm/digic.h                             |   43 +
 include/hw/arm/exynos4210.h                        |    2 +-
 include/hw/arm/omap.h                              |    2 +-
 include/hw/arm/pxa.h                               |   12 +-
 include/hw/block/block.h                           |    6 -
 include/hw/boards.h                                |   71 +-
 include/hw/bt.h                                    |   11 +-
 include/hw/char/digic-uart.h                       |   47 +
 include/hw/char/serial.h                           |    4 +-
 include/hw/cpu/a15mpcore.h                         |   44 +
 include/hw/cpu/a9mpcore.h                          |   39 +
 include/hw/cpu/arm11mpcore.h                       |   35 +
 include/hw/cpu/icc_bus.h                           |    2 +-
 include/hw/cris/etraxfs.h                          |    2 -
 include/hw/elf_ops.h                               |   19 +-
 include/hw/fw-path-provider.h                      |   48 +
 include/hw/hotplug.h                               |   78 +
 include/hw/i2c/i2c.h                               |   20 +-
 include/hw/i2c/pm_smbus.h                          |    2 +-
 include/hw/i2c/smbus.h                             |   20 +-
 include/hw/i386/apic_internal.h                    |    2 +-
 include/hw/i386/ich9.h                             |    6 +-
 include/hw/i386/ioapic_internal.h                  |    3 +-
 include/hw/i386/pc.h                               |  114 +-
 include/hw/i386/smbios.h                           |    7 +-
 include/hw/ide.h                                   |    1 +
 include/hw/intc/allwinner-a10-pic.h                |   40 +
 include/hw/intc/arm_gic.h                          |   42 +
 include/hw/intc/arm_gic_common.h                   |  127 +
 include/hw/intc/realview_gic.h                     |   28 +
 include/hw/ipack/ipack.h                           |   87 +
 include/hw/irq.h                                   |    7 +
 include/hw/isa/isa.h                               |    9 +-
 include/hw/isa/vt82c686.h                          |    4 +-
 include/hw/loader.h                                |   28 +-
 include/hw/misc/a9scu.h                            |   31 +
 include/hw/misc/arm11scu.h                         |   29 +
 include/hw/misc/arm_integrator_debug.h             |   18 +
 include/hw/net/allwinner_emac.h                    |  210 +
 include/hw/nvram/fw_cfg.h                          |    8 +-
 include/hw/nvram/openbios_firmware_abi.h           |    2 +
 include/hw/pci-host/q35.h                          |   30 +-
 include/hw/pci-host/spapr.h                        |    8 +-
 include/hw/pci/pci.h                               |   66 +-
 include/hw/pci/pci_bus.h                           |    2 -
 include/hw/pci/pci_ids.h                           |    2 +-
 include/hw/pci/pcie.h                              |   23 +-
 include/hw/pci/pcie_host.h                         |   27 +
 include/hw/pci/shpc.h                              |    8 +
 include/hw/pcmcia.h                                |   46 +-
 include/hw/ppc/ppc.h                               |    7 +-
 include/hw/ppc/spapr.h                             |   46 +-
 include/hw/ppc/xics.h                              |   57 +
 include/hw/ptimer.h                                |   14 +-
 include/hw/qdev-core.h                             |   73 +-
 include/hw/qdev-dma.h                              |    2 +-
 include/hw/qdev-properties.h                       |   42 +-
 include/hw/s390x/ebcdic.h                          |  104 +
 include/hw/s390x/event-facility.h                  |  112 +-
 include/hw/s390x/s390_flic.h                       |   33 +
 include/hw/s390x/sclp.h                            |   99 +-
 include/hw/scsi/scsi.h                             |   13 +-
 include/hw/ssi.h                                   |    3 +-
 include/hw/sysbus.h                                |    2 +-
 include/hw/timer/a9gtimer.h                        |   97 +
 include/hw/timer/allwinner-a10-pit.h               |   58 +
 include/hw/timer/arm_mptimer.h                     |   54 +
 include/hw/timer/digic-timer.h                     |   46 +
 include/hw/timer/hpet.h                            |   10 +
 include/hw/usb.h                                   |   46 +-
 include/hw/virtio/dataplane/hostmem.h              |   58 -
 include/hw/virtio/dataplane/vring.h                |   10 +-
 include/hw/virtio/virtio-blk.h                     |    8 +-
 include/hw/virtio/virtio-bus.h                     |   22 +-
 include/hw/virtio/virtio-rng.h                     |    2 +
 include/hw/virtio/virtio-scsi.h                    |    4 +-
 include/hw/virtio/virtio-serial.h                  |    8 +-
 include/hw/virtio/virtio.h                         |    8 +-
 include/hw/xen/xen.h                               |    2 +-
 include/hw/xen/xen_common.h                        |    7 +
 include/hw/xilinx.h                                |   96 -
 include/migration/migration.h                      |   12 +
 include/migration/page_cache.h                     |    4 +-
 include/migration/qemu-file.h                      |    4 +
 include/migration/vmstate.h                        |   40 +-
 include/monitor/monitor.h                          |    8 +-
 include/monitor/readline.h                         |   55 -
 include/net/checksum.h                             |    1 +
 include/net/eth.h                                  |    6 +-
 include/net/net.h                                  |   21 +-
 include/net/tap.h                                  |    6 -
 include/qapi/error.h                               |   19 +
 include/qapi/opts-visitor.h                        |    6 +
 include/qapi/qmp/dispatch.h                        |    7 +-
 include/qapi/qmp/qdict.h                           |    3 +
 include/qapi/qmp/qerror.h                          |    5 +-
 include/qapi/qmp/qjson.h                           |    2 +-
 include/qapi/string-output-visitor.h               |    2 +-
 include/qapi/visitor.h                             |    3 +-
 include/qemu-common.h                              |   17 +-
 include/qemu-io.h                                  |    5 +
 include/qemu/atomic.h                              |    6 +-
 include/qemu/bitmap.h                              |   86 +-
 include/qemu/bitops.h                              |   14 +-
 include/qemu/bswap.h                               |   59 +-
 include/qemu/cache-utils.h                         |    4 +-
 include/qemu/config-file.h                         |    7 +
 include/qemu/crc32c.h                              |    4 +-
 include/qemu/fifo8.h                               |   61 +
 include/qemu/host-utils.h                          |   62 +-
 include/qemu/module.h                              |   23 +-
 include/qemu/option.h                              |    5 +-
 include/qemu/osdep.h                               |   36 +
 include/qemu/range.h                               |   20 +-
 include/qemu/ratelimit.h                           |    2 +-
 include/qemu/readline.h                            |   63 +
 include/qemu/rfifolock.h                           |   54 +
 include/qemu/seqlock.h                             |   72 +
 include/qemu/sockets.h                             |    1 +
 include/qemu/thread-posix.h                        |    8 +
 include/qemu/thread-win32.h                        |    4 +
 include/qemu/thread.h                              |   10 +-
 include/qemu/throttle.h                            |  110 +
 include/qemu/timer.h                               |  727 +-
 include/qemu/typedefs.h                            |   10 +-
 include/qom/cpu.h                                  |  153 +-
 include/qom/object.h                               |  161 +-
 include/qom/object_interfaces.h                    |   62 +
 include/sysemu/arch_init.h                         |    2 +-
 include/sysemu/blockdev.h                          |    3 +-
 include/sysemu/char.h                              |   10 +
 include/sysemu/device_tree.h                       |   80 +-
 include/sysemu/dump.h                              |  138 +
 include/sysemu/iothread.h                          |   40 +
 include/sysemu/kvm.h                               |   73 +-
 include/sysemu/qtest.h                             |   28 +-
 include/sysemu/rng.h                               |   11 -
 include/sysemu/sysemu.h                            |   17 +-
 include/ui/console.h                               |   36 +-
 include/ui/input.h                                 |   56 +
 include/ui/qemu-spice.h                            |    7 +-
 ioport.c                                           |    9 +
 iothread.c                                         |  167 +
 kvm-all.c                                          |  285 +-
 kvm-stub.c                                         |    6 +-
 libcacard/Makefile                                 |    5 +-
 libcacard/cac.c                                    |    1 -
 libcacard/card_7816.c                              |    2 +-
 libcacard/card_7816t.h                             |    2 +-
 libcacard/vcard_emul_nss.c                         |    1 -
 libcacard/vscclient.c                              |   19 +-
 linux-headers/asm-arm/kvm.h                        |   31 +-
 linux-headers/asm-arm64/kvm.h                      |  196 +
 linux-headers/asm-arm64/kvm_para.h                 |    1 +
 linux-headers/asm-mips/kvm.h                       |   81 +-
 linux-headers/asm-powerpc/kvm.h                    |   89 +-
 linux-headers/asm-s390/kvm.h                       |   19 +
 linux-headers/asm-x86/hyperv.h                     |   32 +
 linux-headers/asm-x86/kvm.h                        |    6 +-
 linux-headers/asm-x86/kvm_para.h                   |    1 +
 linux-headers/linux/kvm.h                          |   83 +
 linux-headers/linux/kvm_para.h                     |    1 +
 linux-headers/linux/vfio.h                         |   80 +-
 linux-headers/linux/virtio_config.h                |    3 +
 linux-user/aarch64/syscall.h                       |   10 +
 linux-user/aarch64/syscall_nr.h                    |  323 +
 linux-user/aarch64/target_cpu.h                    |   38 +
 linux-user/aarch64/target_signal.h                 |   29 +
 linux-user/aarch64/target_structs.h                |   58 +
 linux-user/aarch64/termbits.h                      |  220 +
 linux-user/alpha/syscall.h                         |    1 +
 linux-user/alpha/syscall_nr.h                      |   11 +-
 linux-user/alpha/target_structs.h                  |   48 +
 linux-user/arm/syscall.h                           |    1 +
 linux-user/arm/syscall_nr.h                        |    6 +
 linux-user/arm/target_cpu.h                        |    2 +-
 linux-user/arm/target_structs.h                    |   52 +
 linux-user/cpu-uname.c                             |    3 +-
 linux-user/cris/syscall.h                          |    2 +-
 linux-user/cris/syscall_nr.h                       |    1 +
 linux-user/cris/target_structs.h                   |   58 +
 linux-user/elfload.c                               |   53 +-
 linux-user/flatload.c                              |    5 +-
 linux-user/i386/syscall.h                          |    1 +
 linux-user/i386/syscall_nr.h                       |    6 +
 linux-user/i386/target_structs.h                   |   58 +
 linux-user/ioctls.h                                |    2 +
 linux-user/linuxload.c                             |   15 +-
 linux-user/m68k-sim.c                              |    3 +-
 linux-user/m68k/syscall.h                          |    2 +-
 linux-user/m68k/syscall_nr.h                       |    5 +
 linux-user/m68k/target_cpu.h                       |    4 +-
 linux-user/m68k/target_structs.h                   |   58 +
 linux-user/main.c                                  |  478 +-
 linux-user/microblaze/syscall.h                    |    2 +-
 linux-user/microblaze/syscall_nr.h                 |    7 +-
 linux-user/microblaze/target_structs.h             |   58 +
 linux-user/mips/syscall.h                          |    1 +
 linux-user/mips/syscall_nr.h                       |    6 +
 linux-user/mips/target_structs.h                   |   48 +
 linux-user/mips64/syscall.h                        |    1 +
 linux-user/mips64/syscall_nr.h                     |   13 +
 linux-user/mips64/target_cpu.h                     |   18 +
 linux-user/mips64/target_structs.h                 |    2 +
 linux-user/openrisc/syscall.h                      |    1 +
 linux-user/openrisc/syscall_nr.h                   |    6 +-
 linux-user/openrisc/target_structs.h               |   58 +
 linux-user/ppc/syscall.h                           |    1 +
 linux-user/ppc/syscall_nr.h                        |    6 +
 linux-user/ppc/target_structs.h                    |   60 +
 linux-user/qemu.h                                  |   22 +-
 linux-user/s390x/syscall.h                         |    3 +-
 linux-user/s390x/syscall_nr.h                      |    7 +-
 linux-user/s390x/target_structs.h                  |   63 +
 linux-user/sh4/syscall.h                           |    1 +
 linux-user/sh4/syscall_nr.h                        |    6 +
 linux-user/sh4/target_structs.h                    |   58 +
 linux-user/signal.c                                |  435 +-
 linux-user/sparc/syscall.h                         |    1 +
 linux-user/sparc/syscall_nr.h                      |    7 +
 linux-user/sparc/target_structs.h                  |   63 +
 linux-user/sparc64/syscall.h                       |    1 +
 linux-user/sparc64/syscall_nr.h                    |    7 +
 linux-user/sparc64/target_structs.h                |   58 +
 linux-user/strace.list                             |    9 +-
 linux-user/syscall.c                               | 1163 +-
 linux-user/syscall_defs.h                          |   92 +-
 linux-user/syscall_types.h                         |   13 +
 linux-user/unicore32/syscall.h                     |    1 +
 linux-user/unicore32/target_structs.h              |   58 +
 linux-user/vm86.c                                  |   27 +-
 linux-user/x86_64/syscall.h                        |    1 +
 linux-user/x86_64/syscall_nr.h                     |    7 +
 linux-user/x86_64/target_structs.h                 |   58 +
 main-loop.c                                        |   72 +-
 memory.c                                           |   24 +-
 memory_mapping.c                                   |    5 +-
 migration-exec.c                                   |    1 +
 migration-fd.c                                     |    1 +
 migration-rdma.c                                   |   25 +-
 migration-tcp.c                                    |    1 +
 migration-unix.c                                   |    1 +
 migration.c                                        |  115 +-
 module-common.c                                    |   10 +
 monitor.c                                          |  659 +-
 nbd.c                                              |   74 +-
 net/Makefile.objs                                  |    1 +
 net/clients.h                                      |    5 +
 net/dump.c                                         |    2 +-
 net/hub.c                                          |    2 +-
 net/net.c                                          |  128 +-
 net/netmap.c                                       |  472 +
 net/slirp.c                                        |    6 +-
 net/socket.c                                       |   20 +-
 net/tap-linux.c                                    |   14 +-
 net/tap-win32.c                                    |   92 +-
 net/tap.c                                          |   27 +-
 os-posix.c                                         |   46 +-
 os-win32.c                                         |   21 +-
 page_cache.c                                       |   34 +-
 pc-bios/QEMU,cgthree.bin                           |  Bin 0 -> 850 bytes
 pc-bios/QEMU,tcx.bin                               |  Bin 0 -> 1410 bytes
 pc-bios/README                                     |   10 +-
 pc-bios/acpi-dsdt.aml                              |  Bin 4407 -> 4407 bytes
 pc-bios/bios-256k.bin                              |  Bin 0 -> 262144 bytes
 pc-bios/bios.bin                                   |  Bin 131072 -> 131072 bytes
 pc-bios/keymaps/cz                                 |   94 +
 pc-bios/kvmvapic.bin                               |  Bin 9216 -> 9216 bytes
 pc-bios/multiboot.bin                              |  Bin 1024 -> 1024 bytes
 pc-bios/ohw.diff                                   | 1843 -
 pc-bios/openbios-ppc                               |  Bin 733976 -> 734008 bytes
 pc-bios/openbios-sparc32                           |  Bin 381484 -> 381512 bytes
 pc-bios/openbios-sparc64                           |  Bin 1598328 -> 1598376 bytes
 pc-bios/optionrom/Makefile                         |    3 +-
 pc-bios/ppc_rom.bin                                |  Bin 524288 -> 1048576 bytes
 pc-bios/q35-acpi-dsdt.aml                          |  Bin 7344 -> 7344 bytes
 pc-bios/s390-ccw.img                               |  Bin 9432 -> 9336 bytes
 pc-bios/s390-ccw/main.c                            |    3 +-
 pc-bios/s390-ccw/virtio.c                          |    8 +-
 pc-bios/s390-ccw/virtio.h                          |    1 +
 pc-bios/sgabios.bin                                |  Bin 4096 -> 4096 bytes
 pc-bios/slof.bin                                   |  Bin 909720 -> 921720 bytes
 pc-bios/vgabios-cirrus.bin                         |  Bin 35840 -> 36864 bytes
 pc-bios/vgabios-qxl.bin                            |  Bin 40448 -> 37376 bytes
 pc-bios/vgabios-stdvga.bin                         |  Bin 40448 -> 37376 bytes
 pc-bios/vgabios-vmware.bin                         |  Bin 40448 -> 37376 bytes
 pc-bios/vgabios.bin                                |  Bin 40448 -> 36864 bytes
 qapi-schema.json                                   |  982 +-
 qapi/opts-visitor.c                                |  188 +-
 qapi/qapi-dealloc-visitor.c                        |    4 +-
 qapi/qmp-registry.c                                |   33 +-
 qapi/string-input-visitor.c                        |   24 +
 qapi/string-output-visitor.c                       |   56 +-
 qdev-monitor.c                                     |  178 +-
 qemu-char.c                                        |   63 +-
 qemu-coroutine-io.c                                |    1 +
 qemu-coroutine-lock.c                              |    8 -
 qemu-coroutine-sleep.c                             |   24 +-
 qemu-doc.texi                                      |   57 +-
 qemu-file.c                                        |  835 +
 qemu-img-cmds.hx                                   |   16 +-
 qemu-img.c                                         |  739 +-
 qemu-img.texi                                      |  139 +-
 qemu-io-cmds.c                                     |   95 +-
 qemu-io.c                                          |  192 +-
 qemu-nbd.c                                         |  124 +-
 qemu-nbd.texi                                      |   10 +-
 qemu-options.hx                                    |   49 +-
 qemu-seccomp.c                                     |    9 +-
 qemu-timer.c                                       |  931 +-
 qemu.nsi                                           |    8 +-
 qemu.sasl                                          |    4 +-
 qga/Makefile.objs                                  |    3 +
 qga/channel-win32.c                                |   20 +-
 qga/commands-posix.c                               |   67 +-
 qga/commands-win32.c                               |  120 +-
 qga/commands.c                                     |   39 +-
 qga/guest-agent-core.h                             |    2 +-
 qga/main.c                                         |  103 +-
 qga/qapi-schema.json                               |   14 +-
 qga/vss-win32.c                                    |  166 +
 qga/vss-win32.h                                    |   27 +
 qga/vss-win32/Makefile.objs                        |   23 +
 qga/vss-win32/install.cpp                          |  465 +
 qga/vss-win32/provider.cpp                         |  534 +
 qga/vss-win32/qga-vss.def                          |   13 +
 qga/vss-win32/qga-vss.idl                          |   20 +
 qga/vss-win32/qga-vss.tlb                          |  Bin 0 -> 1528 bytes
 qga/vss-win32/requester.cpp                        |  503 +
 qga/vss-win32/requester.h                          |   43 +
 qga/vss-win32/vss-common.h                         |  129 +
 qmp-commands.hx                                    |  494 +-
 qmp.c                                              |   99 +-
 qobject/qdict.c                                    |  158 +-
 qobject/qerror.c                                   |   12 +-
 qom/Makefile.objs                                  |    1 +
 qom/cpu.c                                          |  114 +-
 qom/object.c                                       |  350 +-
 qom/object_interfaces.c                            |   32 +
 qtest.c                                            |   47 +-
 readline.c                                         |  494 -
 roms/Makefile                                      |  102 +-
 roms/SLOF                                          |    2 +-
 roms/config.seabios                                |    1 -
 roms/config.seabios-128k                           |    6 +
 roms/config.seabios-256k                           |    3 +
 roms/config.vga-cirrus                             |    3 +
 roms/config.vga-isavga                             |    3 +
 roms/config.vga-qxl                                |    6 +
 roms/config.vga-stdvga                             |    3 +
 roms/config.vga-vmware                             |    6 +
 roms/config.vga.cirrus                             |    3 -
 roms/config.vga.isavga                             |    3 -
 roms/config.vga.qxl                                |    6 -
 roms/config.vga.stdvga                             |    3 -
 roms/config.vga.vmware                             |    6 -
 roms/openbios                                      |    2 +-
 roms/openhackware                                  |    1 +
 roms/seabios                                       |    2 +-
 rules.mak                                          |  129 +-
 savevm.c                                           | 1643 +-
 scripts/acpi_extract.py                            |  362 +
 scripts/acpi_extract_preprocess.py                 |   51 +
 scripts/checkpatch.pl                              |   34 +-
 scripts/create_config                              |    7 +
 scripts/disas-objdump.pl                           |   99 +
 scripts/dump-guest-memory.py                       |  339 +
 scripts/extract-vsssdk-headers                     |   35 +
 scripts/get_maintainer.pl                          |    2 +-
 scripts/make-release                               |    3 +-
 scripts/qapi-commands.py                           |   24 +-
 scripts/qapi-types.py                              |   70 +-
 scripts/qapi-visit.py                              |   84 +-
 scripts/qapi.py                                    |  197 +-
 scripts/qemu-binfmt-conf.sh                        |    3 +
 scripts/qmp/qemu-ga-client                         |  301 +
 scripts/qmp/qmp                                    |  126 +
 scripts/qmp/qmp-shell                              |  305 +
 scripts/qmp/qmp.py                                 |  201 +
 scripts/qmp/qom-fuse                               |  138 +
 scripts/qmp/qom-get                                |   67 +
 scripts/qmp/qom-list                               |   64 +
 scripts/qmp/qom-set                                |   64 +
 scripts/refresh-pxe-roms.sh                        |   80 +-
 scripts/switch-timer-api                           |  178 +
 scripts/tracetool/backend/simple.py                |    6 +-
 scripts/tracetool/backend/ust.py                   |  101 +-
 scripts/tracetool/format/ust_events_c.py           |   30 +
 scripts/tracetool/format/ust_events_h.py           |   57 +
 scripts/update-acpi.sh                             |    4 +
 slirp/arp_table.c                                  |    4 +-
 slirp/if.c                                         |    4 +-
 slirp/libslirp.h                                   |    3 +-
 slirp/misc.c                                       |    4 +-
 slirp/slirp.c                                      |   65 +-
 slirp/slirp.h                                      |    3 +
 slirp/socket.c                                     |    2 +-
 slirp/tcp_subr.c                                   |    6 +-
 slirp/tftp.c                                       |    2 +-
 slirp/udp.c                                        |    4 +-
 spice-qemu-char.c                                  |   36 +-
 stubs/Makefile.objs                                |    4 +
 stubs/clock-warp.c                                 |    2 +-
 stubs/gdbstub.c                                    |    4 +-
 stubs/kvm.c                                        |    7 +
 stubs/qtest.c                                      |   14 +
 stubs/runstate-check.c                             |    6 +
 stubs/slirp.c                                      |    6 +-
 stubs/uuid.c                                       |   12 +
 target-alpha/cpu-qom.h                             |    2 +-
 target-alpha/cpu.c                                 |   26 +-
 target-alpha/cpu.h                                 |   20 +-
 target-alpha/helper.c                              |   45 +-
 target-alpha/helper.h                              |   12 +-
 target-alpha/mem_helper.c                          |   52 +-
 target-alpha/sys_helper.c                          |   33 +-
 target-alpha/translate.c                           |  156 +-
 target-arm/Makefile.objs                           |    6 +-
 target-arm/arm-semi.c                              |    9 +-
 target-arm/cpu-qom.h                               |   50 +
 target-arm/cpu.c                                   |  240 +-
 target-arm/cpu.h                                   |  583 +-
 target-arm/cpu64.c                                 |  133 +
 target-arm/crypto_helper.c                         |  281 +
 target-arm/gdbstub64.c                             |   73 +
 target-arm/helper-a64.c                            |  438 +
 target-arm/helper-a64.h                            |   48 +
 target-arm/helper.c                                | 2440 +-
 target-arm/helper.h                                |  105 +-
 target-arm/kvm-consts.h                            |  115 +
 target-arm/kvm.c                                   |  527 +-
 target-arm/kvm32.c                                 |  515 +
 target-arm/kvm64.c                                 |  204 +
 target-arm/kvm_arm.h                               |   72 +-
 target-arm/machine.c                               |   24 +-
 target-arm/neon_helper.c                           |  217 +-
 target-arm/op_helper.c                             |  113 +-
 target-arm/translate-a64.c                         |10448 ++++
 target-arm/translate.c                             | 1272 +-
 target-arm/translate.h                             |   80 +
 target-cris/cpu.c                                  |   53 +-
 target-cris/cpu.h                                  |   16 +-
 target-cris/helper.c                               |   51 +-
 target-cris/helper.h                               |    8 +-
 target-cris/mmu.c                                  |    3 +-
 target-cris/op_helper.c                            |   28 +-
 target-cris/translate.c                            |   55 +-
 target-cris/translate_v10.c                        |   16 +-
 target-i386/Makefile.objs                          |    4 +-
 target-i386/arch_memory_mapping.c                  |   48 +-
 target-i386/cc_helper.c                            |    2 +-
 target-i386/cpu-qom.h                              |   29 +
 target-i386/cpu.c                                  |  834 +-
 target-i386/cpu.h                                  |  579 +-
 target-i386/excp_helper.c                          |    6 +-
 target-i386/fpu_helper.c                           |   15 +-
 target-i386/gdbstub.c                              |    2 +-
 target-i386/helper.c                               |  159 +-
 target-i386/helper.h                               |    1 +
 target-i386/hyperv.c                               |   64 -
 target-i386/hyperv.h                               |   45 -
 target-i386/kvm-stub.c                             |   12 +
 target-i386/kvm.c                                  |  377 +-
 target-i386/machine.c                              |  197 +-
 target-i386/mem_helper.c                           |   16 +-
 target-i386/misc_helper.c                          |   46 +-
 target-i386/seg_helper.c                           |   32 +-
 target-i386/smm_helper.c                           |  300 +-
 target-i386/svm_helper.c                           |  326 +-
 target-i386/translate.c                            | 2815 +-
 target-lm32/TODO                                   |    2 -
 target-lm32/cpu-qom.h                              |    6 +
 target-lm32/cpu.c                                  |  202 +-
 target-lm32/cpu.h                                  |   43 +-
 target-lm32/helper.c                               |  256 +-
 target-lm32/helper.h                               |    4 +
 target-lm32/op_helper.c                            |   98 +-
 target-lm32/translate.c                            |  200 +-
 target-m68k/cpu.c                                  |   14 +-
 target-m68k/cpu.h                                  |    9 +-
 target-m68k/helper.c                               |   26 +-
 target-m68k/helper.h                               |   54 +
 target-m68k/helpers.h                              |   54 -
 target-m68k/m68k-semi.c                            |    5 +-
 target-m68k/op_helper.c                            |   36 +-
 target-m68k/qregs.def                              |    1 -
 target-m68k/translate.c                            |   56 +-
 target-microblaze/cpu.c                            |   35 +-
 target-microblaze/cpu.h                            |   13 +-
 target-microblaze/helper.c                         |   34 +-
 target-microblaze/mmu.c                            |    6 +-
 target-microblaze/op_helper.c                      |   19 +-
 target-microblaze/translate.c                      |  292 +-
 target-mips/cpu.c                                  |   38 +-
 target-mips/cpu.h                                  |   51 +-
 target-mips/dsp_helper.c                           |   30 +-
 target-mips/helper.c                               |   66 +-
 target-mips/helper.h                               |   16 +-
 target-mips/machine.c                              |    3 +-
 target-mips/mips-defs.h                            |    8 +
 target-mips/op_helper.c                            |   99 +-
 target-mips/translate.c                            |  252 +-
 target-mips/translate_init.c                       |   65 +-
 target-moxie/cpu.c                                 |   28 +-
 target-moxie/cpu.h                                 |    7 +-
 target-moxie/helper.c                              |   52 +-
 target-moxie/translate.c                           |    6 +-
 target-openrisc/cpu.c                              |   35 +-
 target-openrisc/cpu.h                              |   13 +-
 target-openrisc/exception.c                        |    6 +-
 target-openrisc/interrupt.c                        |   37 +-
 target-openrisc/interrupt_helper.c                 |    2 +-
 target-openrisc/mmu.c                              |   30 +-
 target-openrisc/mmu_helper.c                       |    8 +-
 target-openrisc/sys_helper.c                       |   60 +-
 target-openrisc/translate.c                        |  205 +-
 target-ppc/Makefile.objs                           |    4 +-
 target-ppc/STATUS                                  |    9 -
 target-ppc/arch_dump.c                             |  253 +
 target-ppc/cpu-models.c                            |    5 +-
 target-ppc/cpu-models.h                            |    8 +-
 target-ppc/cpu-qom.h                               |   17 +-
 target-ppc/cpu.h                                   |   87 +-
 target-ppc/excp_helper.c                           |   99 +-
 target-ppc/fpu_helper.c                            | 1312 +-
 target-ppc/helper.h                                |  217 +-
 target-ppc/helper_regs.h                           |    6 +-
 target-ppc/int_helper.c                            | 1411 +-
 target-ppc/kvm.c                                   |  202 +-
 target-ppc/kvm_ppc.c                               |    7 +-
 target-ppc/kvm_ppc.h                               |   36 +-
 target-ppc/machine.c                               |   17 +-
 target-ppc/mem_helper.c                            |    2 +
 target-ppc/misc_helper.c                           |    8 +-
 target-ppc/mmu-hash32.c                            |   35 +-
 target-ppc/mmu-hash32.h                            |   18 +-
 target-ppc/mmu-hash64.c                            |  145 +-
 target-ppc/mmu-hash64.h                            |   47 +-
 target-ppc/mmu_helper.c                            |  215 +-
 target-ppc/translate.c                             | 1834 +-
 target-ppc/translate_init.c                        |  503 +-
 target-ppc/user_only_helper.c                      |    8 +-
 target-s390x/arch_dump.c                           |    7 +-
 target-s390x/cc_helper.c                           |    5 +-
 target-s390x/cpu-qom.h                             |    6 +
 target-s390x/cpu.c                                 |   89 +-
 target-s390x/cpu.h                                 |   70 +-
 target-s390x/fpu_helper.c                          |    4 +-
 target-s390x/helper.c                              |   96 +-
 target-s390x/int_helper.c                          |    3 +-
 target-s390x/ioinst.c                              |  111 +-
 target-s390x/ioinst.h                              |   28 +-
 target-s390x/kvm.c                                 |  564 +-
 target-s390x/mem_helper.c                          |   61 +-
 target-s390x/misc_helper.c                         |  218 +-
 target-s390x/translate.c                           |   16 +-
 target-sh4/cpu.c                                   |   30 +-
 target-sh4/cpu.h                                   |   17 +-
 target-sh4/helper.c                                |  108 +-
 target-sh4/op_helper.c                             |   20 +-
 target-sh4/translate.c                             |  177 +-
 target-sparc/cpu.c                                 |  118 +-
 target-sparc/cpu.h                                 |   19 +-
 target-sparc/helper.c                              |   53 +-
 target-sparc/helper.h                              |   22 +-
 target-sparc/int32_helper.c                        |   10 +-
 target-sparc/int64_helper.c                        |    8 +-
 target-sparc/ldst_helper.c                         |  145 +-
 target-sparc/machine.c                             |    3 +-
 target-sparc/mmu_helper.c                          |   60 +-
 target-sparc/translate.c                           |   61 +-
 target-unicore32/cpu.c                             |   13 +-
 target-unicore32/cpu.h                             |   11 +-
 target-unicore32/helper.c                          |   31 +-
 target-unicore32/op_helper.c                       |   16 +-
 target-unicore32/softmmu.c                         |   32 +-
 target-unicore32/translate.c                       |   37 +-
 target-unicore32/ucf64_helper.c                    |    3 +-
 target-xtensa/core-dc232b.c                        |    8 +-
 target-xtensa/core-dc233c.c                        |    7 +-
 target-xtensa/core-fsf.c                           |    8 +-
 target-xtensa/cpu.c                                |   10 +
 target-xtensa/cpu.h                                |   17 +-
 target-xtensa/helper.c                             |   33 +-
 target-xtensa/helper.h                             |    1 +
 target-xtensa/op_helper.c                          |   62 +-
 target-xtensa/overlay_tool.h                       |   17 +
 target-xtensa/translate.c                          |  100 +-
 tcg/README                                         |   43 +-
 tcg/aarch64/tcg-target.c                           | 1060 +-
 tcg/aarch64/tcg-target.h                           |   53 +-
 tcg/arm/tcg-target.c                               |  843 +-
 tcg/arm/tcg-target.h                               |   13 +-
 tcg/hppa/tcg-target.c                              | 1829 -
 tcg/hppa/tcg-target.h                              |  126 -
 tcg/i386/tcg-target.c                              | 1121 +-
 tcg/i386/tcg-target.h                              |   28 +-
 tcg/ia64/tcg-target.c                              |  778 +-
 tcg/ia64/tcg-target.h                              |   13 +-
 tcg/mips/tcg-target.c                              |  259 +-
 tcg/mips/tcg-target.h                              |   59 +-
 tcg/optimize.c                                     |  208 +-
 tcg/ppc/tcg-target.c                               |  696 +-
 tcg/ppc/tcg-target.h                               |    6 +-
 tcg/ppc64/tcg-target.c                             | 1206 +-
 tcg/ppc64/tcg-target.h                             |   10 +-
 tcg/s390/tcg-target.c                              |  129 +-
 tcg/s390/tcg-target.h                              |    9 +-
 tcg/sparc/tcg-target.c                             |  613 +-
 tcg/sparc/tcg-target.h                             |   30 +-
 tcg/tcg-be-ldst.h                                  |   90 +
 tcg/tcg-be-null.h                                  |   43 +
 tcg/tcg-op.h                                       |  281 +-
 tcg/tcg-opc.h                                      |  100 +-
 tcg/tcg.c                                          |  481 +-
 tcg/tcg.h                                          |  254 +-
 tcg/tci/tcg-target.c                               |   15 +-
 tcg/tci/tcg-target.h                               |   20 +-
 tci.c                                              |    4 +-
 tests/.gitignore                                   |    4 +
 tests/Makefile                                     |  164 +-
 tests/acpi-test-data/pc/APIC                       |  Bin 0 -> 120 bytes
 tests/acpi-test-data/pc/DSDT                       |  Bin 0 -> 4480 bytes
 tests/acpi-test-data/pc/FACP                       |  Bin 0 -> 116 bytes
 tests/acpi-test-data/pc/FACS                       |  Bin 0 -> 64 bytes
 tests/acpi-test-data/pc/HPET                       |  Bin 0 -> 56 bytes
 tests/acpi-test-data/pc/SSDT                       |  Bin 0 -> 2269 bytes
 tests/acpi-test-data/q35/APIC                      |  Bin 0 -> 120 bytes
 tests/acpi-test-data/q35/DSDT                      |  Bin 0 -> 7378 bytes
 tests/acpi-test-data/q35/FACP                      |  Bin 0 -> 116 bytes
 tests/acpi-test-data/q35/FACS                      |  Bin 0 -> 64 bytes
 tests/acpi-test-data/q35/HPET                      |  Bin 0 -> 56 bytes
 tests/acpi-test-data/q35/MCFG                      |  Bin 0 -> 60 bytes
 tests/acpi-test-data/q35/SSDT                      |  Bin 0 -> 550 bytes
 tests/acpi-test-data/rebuild-expected-aml.sh       |   36 +
 tests/acpi-test.c                                  |  674 +
 tests/blockdev-test.c                              |   59 +
 tests/boot-order-test.c                            |    6 +-
 tests/check-qdict.c                                |  219 +
 tests/check-qom-interface.c                        |  105 +
 tests/e1000-test.c                                 |   33 +
 tests/eepro100-test.c                              |   63 +
 tests/endianness-test.c                            |   11 +-
 tests/fdc-test.c                                   |   20 +-
 tests/fw_cfg-test.c                                |   10 +-
 tests/hd-geo-test.c                                |    2 +-
 tests/i440fx-test.c                                |  176 +-
 tests/i82801b11-test.c                             |   33 +
 tests/ide-test.c                                   |   39 +-
 tests/ipoctal232-test.c                            |   33 +
 tests/libqos/pci-pc.c                              |   12 +-
 tests/libqtest.c                                   |  222 +-
 tests/libqtest.h                                   |   85 +-
 tests/m48t59-test.c                                |    5 +-
 tests/multiboot/Makefile                           |   18 +
 tests/multiboot/libc.c                             |  139 +
 tests/multiboot/libc.h                             |   61 +
 tests/multiboot/link.ld                            |   19 +
 tests/multiboot/mmap.c                             |   56 +
 tests/multiboot/mmap.out                           |   93 +
 tests/multiboot/multiboot.h                        |   66 +
 tests/multiboot/run_test.sh                        |   81 +
 tests/multiboot/start.S                            |   51 +
 tests/ne2000-test.c                                |   33 +
 tests/nvme-test.c                                  |   34 +
 tests/pcnet-test.c                                 |   33 +
 tests/pvpanic-test.c                               |   47 +
 tests/qapi-schema/comments.out                     |    2 +-
 tests/qapi-schema/duplicate-key.err                |    1 +
 tests/qapi-schema/duplicate-key.exit               |    1 +
 tests/qapi-schema/duplicate-key.json               |    2 +
 .../qapi-schema/flat-union-invalid-branch-key.err  |    1 +
 .../qapi-schema/flat-union-invalid-branch-key.exit |    1 +
 .../qapi-schema/flat-union-invalid-branch-key.json |   17 +
 .../flat-union-invalid-discriminator.err           |    1 +
 .../flat-union-invalid-discriminator.exit          |    1 +
 .../flat-union-invalid-discriminator.json          |   17 +
 tests/qapi-schema/flat-union-no-base.err           |    1 +
 tests/qapi-schema/flat-union-no-base.exit          |    1 +
 tests/qapi-schema/flat-union-no-base.json          |   10 +
 tests/qapi-schema/flat-union-reverse-define.exit   |    1 +
 tests/qapi-schema/flat-union-reverse-define.json   |   17 +
 tests/qapi-schema/flat-union-reverse-define.out    |    9 +
 .../flat-union-string-discriminator.err            |    1 +
 .../flat-union-string-discriminator.exit           |    1 +
 .../flat-union-string-discriminator.json           |   17 +
 tests/qapi-schema/qapi-schema-test.json            |   42 +-
 tests/qapi-schema/qapi-schema-test.out             |   24 +-
 tests/qapi-schema/union-invalid-base.err           |    1 +
 tests/qapi-schema/union-invalid-base.exit          |    1 +
 tests/qapi-schema/union-invalid-base.json          |   10 +
 tests/qdev-monitor-test.c                          |   77 +
 tests/qemu-iotests-quick.sh                        |    1 +
 tests/qemu-iotests/.gitignore                      |    1 +
 tests/qemu-iotests/001                             |    6 +-
 tests/qemu-iotests/002                             |   36 +-
 tests/qemu-iotests/003                             |   10 +-
 tests/qemu-iotests/004                             |   24 +-
 tests/qemu-iotests/005                             |    6 +-
 tests/qemu-iotests/007                             |    4 +-
 tests/qemu-iotests/008                             |    6 +-
 tests/qemu-iotests/009                             |    2 +-
 tests/qemu-iotests/010                             |    2 +-
 tests/qemu-iotests/011                             |    2 +-
 tests/qemu-iotests/012                             |    4 +-
 tests/qemu-iotests/013                             |    6 +-
 tests/qemu-iotests/013.out                         |44080 +++++++-------
 tests/qemu-iotests/014                             |    4 +-
 tests/qemu-iotests/014.out                         |64204 ++++++++++----------
 tests/qemu-iotests/015                             |   16 +-
 tests/qemu-iotests/016                             |   14 +-
 tests/qemu-iotests/017                             |    3 +-
 tests/qemu-iotests/017.out                         | 1080 +-
 tests/qemu-iotests/018                             |    9 +-
 tests/qemu-iotests/018.out                         | 1080 +-
 tests/qemu-iotests/019                             |   21 +-
 tests/qemu-iotests/019.out                         | 1636 +-
 tests/qemu-iotests/020                             |   20 +-
 tests/qemu-iotests/020.out                         | 1080 +-
 tests/qemu-iotests/021                             |    2 +-
 tests/qemu-iotests/022.out                         | 8816 ++--
 tests/qemu-iotests/023                             |    6 +-
 tests/qemu-iotests/023.out                         |26800 ++++----
 tests/qemu-iotests/024                             |   14 +-
 tests/qemu-iotests/024.out                         |  164 +-
 tests/qemu-iotests/025                             |    6 +-
 tests/qemu-iotests/025.out                         |   18 +-
 tests/qemu-iotests/026                             |   25 +-
 tests/qemu-iotests/026.out                         |   50 +-
 tests/qemu-iotests/026.out.nocache                 |  610 +
 tests/qemu-iotests/027                             |   10 +-
 tests/qemu-iotests/028                             |    8 +-
 tests/qemu-iotests/028.out                         |  458 +-
 tests/qemu-iotests/029                             |   52 +-
 tests/qemu-iotests/029.out                         |   17 +
 tests/qemu-iotests/030                             |   20 +-
 tests/qemu-iotests/031                             |   14 +-
 tests/qemu-iotests/031.out                         |   12 +-
 tests/qemu-iotests/032                             |    4 +-
 tests/qemu-iotests/032.out                         |   68 +-
 tests/qemu-iotests/033                             |   18 +-
 tests/qemu-iotests/034                             |   69 +-
 tests/qemu-iotests/035                             |    2 +-
 tests/qemu-iotests/035.out                         |    2 +-
 tests/qemu-iotests/036                             |    8 +-
 tests/qemu-iotests/036.out                         |    2 +-
 tests/qemu-iotests/037                             |   67 +-
 tests/qemu-iotests/037.out                         |  616 +-
 tests/qemu-iotests/038                             |   15 +-
 tests/qemu-iotests/038.out                         |  724 +-
 tests/qemu-iotests/039                             |   53 +-
 tests/qemu-iotests/039.out                         |   15 +-
 tests/qemu-iotests/040                             |  119 +-
 tests/qemu-iotests/041                             |   41 +
 tests/qemu-iotests/041.out                         |    4 +-
 tests/qemu-iotests/042                             |   10 +-
 tests/qemu-iotests/043                             |   34 +-
 tests/qemu-iotests/044.out                         |    2 +-
 tests/qemu-iotests/045                             |   51 +-
 tests/qemu-iotests/045.out                         |    4 +-
 tests/qemu-iotests/046                             |   30 +-
 tests/qemu-iotests/046.out                         |  232 +-
 tests/qemu-iotests/047                             |    2 +-
 tests/qemu-iotests/047.out                         |   20 +-
 tests/qemu-iotests/048                             |   15 +-
 tests/qemu-iotests/048.out                         |   29 +-
 tests/qemu-iotests/049                             |   36 +-
 tests/qemu-iotests/049.out                         |   18 +-
 tests/qemu-iotests/050                             |   20 +-
 tests/qemu-iotests/051                             |  124 +-
 tests/qemu-iotests/051.out                         |  296 +-
 tests/qemu-iotests/052                             |   11 +-
 tests/qemu-iotests/053                             |   10 +-
 tests/qemu-iotests/054                             |    4 +-
 tests/qemu-iotests/054.out                         |    4 +-
 tests/qemu-iotests/055                             |   14 +-
 tests/qemu-iotests/057                             |  259 +
 tests/qemu-iotests/057.out                         |    5 +
 tests/qemu-iotests/058                             |  138 +
 tests/qemu-iotests/058.out                         |   44 +
 tests/qemu-iotests/059                             |   58 +-
 tests/qemu-iotests/059.out                         |  100 +-
 tests/qemu-iotests/060                             |  170 +
 tests/qemu-iotests/060.out                         |   96 +
 tests/qemu-iotests/061                             |  215 +
 tests/qemu-iotests/061.out                         |  387 +
 tests/qemu-iotests/062                             |   64 +
 tests/qemu-iotests/062.out                         |    9 +
 tests/qemu-iotests/063                             |  100 +
 tests/qemu-iotests/063.out                         |   10 +
 tests/qemu-iotests/064                             |   73 +
 tests/qemu-iotests/064.out                         |   28 +
 tests/qemu-iotests/065                             |  125 +
 tests/qemu-iotests/065.out                         |    5 +
 tests/qemu-iotests/066                             |   63 +
 tests/qemu-iotests/066.out                         |   13 +
 tests/qemu-iotests/067                             |  133 +
 tests/qemu-iotests/067.out                         |   80 +
 tests/qemu-iotests/068                             |   65 +
 tests/qemu-iotests/068.out                         |   11 +
 tests/qemu-iotests/069                             |   60 +
 tests/qemu-iotests/069.out                         |    8 +
 tests/qemu-iotests/070                             |   78 +
 tests/qemu-iotests/070.out                         |   21 +
 tests/qemu-iotests/071                             |  239 +
 tests/qemu-iotests/071.out                         |   90 +
 tests/qemu-iotests/072                             |   69 +
 tests/qemu-iotests/072.out                         |   21 +
 tests/qemu-iotests/073                             |  166 +
 tests/qemu-iotests/073.out                         |  118 +
 tests/qemu-iotests/074                             |   86 +
 tests/qemu-iotests/074.out                         |   18 +
 tests/qemu-iotests/075                             |  106 +
 tests/qemu-iotests/075.out                         |   38 +
 tests/qemu-iotests/076                             |   76 +
 tests/qemu-iotests/076.out                         |   18 +
 tests/qemu-iotests/077                             |  278 +
 tests/qemu-iotests/077.out                         |  202 +
 tests/qemu-iotests/078                             |   91 +
 tests/qemu-iotests/078.out                         |   28 +
 tests/qemu-iotests/079                             |   63 +
 tests/qemu-iotests/079.out                         |   32 +
 tests/qemu-iotests/080                             |  180 +
 tests/qemu-iotests/080.out                         |   83 +
 tests/qemu-iotests/081                             |  149 +
 tests/qemu-iotests/081.out                         |   49 +
 tests/qemu-iotests/082                             |  208 +
 tests/qemu-iotests/082.out                         |  529 +
 tests/qemu-iotests/083                             |  129 +
 tests/qemu-iotests/083.out                         |  163 +
 tests/qemu-iotests/084                             |  104 +
 tests/qemu-iotests/084.out                         |   33 +
 tests/qemu-iotests/085                             |  192 +
 tests/qemu-iotests/085.out                         |   55 +
 tests/qemu-iotests/086                             |   65 +
 tests/qemu-iotests/086.out                         |   18 +
 tests/qemu-iotests/087                             |  139 +
 tests/qemu-iotests/087.out                         |   49 +
 tests/qemu-iotests/088                             |   64 +
 tests/qemu-iotests/088.out                         |   17 +
 tests/qemu-iotests/check                           |  242 +-
 tests/qemu-iotests/common                          |  497 +-
 tests/qemu-iotests/common.config                   |   17 +-
 tests/qemu-iotests/common.filter                   |   56 +-
 tests/qemu-iotests/common.pattern                  |   16 +-
 tests/qemu-iotests/common.rc                       |  214 +-
 tests/qemu-iotests/group                           |   43 +-
 tests/qemu-iotests/iotests.py                      |   50 +-
 tests/qemu-iotests/nbd-fault-injector.py           |  264 +
 tests/qemu-iotests/sample_images/README            |    8 +
 tests/qemu-iotests/sample_images/empty.bochs.bz2   |  Bin 0 -> 118 bytes
 .../qemu-iotests/sample_images/fake.parallels.bz2  |  Bin 0 -> 141 bytes
 .../sample_images/iotest-dirtylog-10G-4M.vhdx.bz2  |  Bin 0 -> 4490 bytes
 .../sample_images/iotest-dynamic-1G.vhdx.bz2       |  Bin 0 -> 874 bytes
 .../sample_images/iotest-version3.vmdk.bz2         |  Bin 0 -> 414 bytes
 .../sample_images/simple-pattern.cloop.bz2         |  Bin 0 -> 488 bytes
 tests/qemu-iotests/socket_scm_helper.c             |  135 +
 tests/qom-test.c                                   |  138 +
 tests/rtc-test.c                                   |    7 +-
 tests/rtl8139-test.c                               |   33 +
 tests/spapr-phb-test.c                             |   35 +
 tests/tcg/lm32/Makefile                            |    8 +-
 tests/tcg/openrisc/test_addc.c                     |    8 +-
 tests/tcg/openrisc/test_addic.c                    |   10 +-
 tests/tcg/test_path.c                              |   13 +-
 tests/tcg/xtensa/Makefile                          |   12 +-
 tests/tcg/xtensa/macros.inc                        |    6 +
 tests/tcg/xtensa/test_b.S                          |    2 +-
 tests/tcg/xtensa/test_bi.S                         |    2 +-
 tests/tcg/xtensa/test_boolean.S                    |    2 +-
 tests/tcg/xtensa/test_break.S                      |    2 +-
 tests/tcg/xtensa/test_bz.S                         |    2 +-
 tests/tcg/xtensa/test_cache.S                      |   97 +
 tests/tcg/xtensa/test_clamps.S                     |    2 +-
 tests/tcg/xtensa/test_extui.S                      |    2 +-
 tests/tcg/xtensa/test_fail.S                       |    2 +-
 tests/tcg/xtensa/test_interrupt.S                  |    2 +-
 tests/tcg/xtensa/test_loop.S                       |    2 +-
 tests/tcg/xtensa/test_mac16.S                      |    2 +-
 tests/tcg/xtensa/test_max.S                        |    2 +-
 tests/tcg/xtensa/test_min.S                        |    2 +-
 tests/tcg/xtensa/test_mmu.S                        |    6 +-
 tests/tcg/xtensa/test_mul16.S                      |    2 +-
 tests/tcg/xtensa/test_mul32.S                      |    2 +-
 tests/tcg/xtensa/test_nsa.S                        |    2 +-
 tests/tcg/xtensa/test_pipeline.S                   |    2 +-
 tests/tcg/xtensa/test_quo.S                        |    2 +-
 tests/tcg/xtensa/test_rem.S                        |    2 +-
 tests/tcg/xtensa/test_rst0.S                       |    2 +-
 tests/tcg/xtensa/test_s32c1i.S                     |    2 +-
 tests/tcg/xtensa/test_sar.S                        |    2 +-
 tests/tcg/xtensa/test_sext.S                       |    2 +-
 tests/tcg/xtensa/test_shift.S                      |    2 +-
 tests/tcg/xtensa/test_sr.S                         |    2 +-
 tests/tcg/xtensa/test_timer.S                      |    2 +-
 tests/tcg/xtensa/test_windowed.S                   |    2 +-
 tests/test-aio.c                                   |  297 +-
 tests/test-bitops.c                                |    4 +-
 tests/test-coroutine.c                             |   99 +-
 tests/test-int128.c                                |   15 +-
 tests/test-opts-visitor.c                          |  275 +
 tests/test-qdev-global-props.c                     |  180 +
 tests/test-qmp-commands.c                          |   78 +-
 tests/test-qmp-input-strict.c                      |   88 +-
 tests/test-qmp-input-visitor.c                     |   69 +-
 tests/test-qmp-output-visitor.c                    |   91 +-
 tests/test-rfifolock.c                             |   91 +
 tests/test-string-input-visitor.c                  |   20 +-
 tests/test-string-output-visitor.c                 |   16 +-
 tests/test-thread-pool.c                           |   27 +-
 tests/test-throttle.c                              |  481 +
 tests/test-visitor-serialization.c                 |   16 +-
 tests/test-vmstate.c                               |  357 +
 tests/tmp105-test.c                                |  141 +-
 tests/tpci200-test.c                               |   33 +
 tests/virtio-9p-test.c                             |   46 +
 tests/virtio-balloon-test.c                        |   33 +
 tests/virtio-blk-test.c                            |   34 +
 tests/virtio-console-test.c                        |   41 +
 tests/virtio-net-test.c                            |   33 +
 tests/virtio-rng-test.c                            |   33 +
 tests/virtio-scsi-test.c                           |   35 +
 tests/virtio-serial-test.c                         |   33 +
 tests/vmxnet3-test.c                               |   33 +
 thread-pool.c                                      |   14 +-
 tpm.c                                              |    2 +-
 trace-events                                       |  102 +-
 trace/Makefile.objs                                |   25 +
 trace/control-internal.h                           |   10 +-
 trace/simple.c                                     |   33 +-
 translate-all.c                                    |  173 +-
 translate-all.h                                    |    9 +-
 ui/Makefile.objs                                   |    8 +-
 ui/cocoa.m                                         |  182 +-
 ui/console.c                                       |  151 +-
 ui/curses.c                                        |   91 +-
 ui/gtk.c                                           |  228 +-
 ui/input-legacy.c                                  |  468 +
 ui/input.c                                         |  697 +-
 ui/keymaps.c                                       |    6 +
 ui/sdl.c                                           |  151 +-
 ui/sdl2-keymap.h                                   |  266 +
 ui/sdl2.c                                          |  834 +
 ui/sdl_keysym.h                                    |    3 +-
 ui/spice-core.c                                    |  100 +-
 ui/spice-display.c                                 |  116 +-
 ui/spice-input.c                                   |   84 +-
 ui/vnc-auth-sasl.h                                 |    1 +
 ui/vnc-auth-vencrypt.c                             |    2 +-
 ui/vnc-enc-tight.c                                 |    2 +-
 ui/vnc-enc-zywrle.h                                |    2 +-
 ui/vnc-jobs.c                                      |    8 +-
 ui/vnc-ws.c                                        |    1 +
 ui/vnc.c                                           |  300 +-
 ui/vnc.h                                           |   11 +-
 ui/vnc_keysym.h                                    |  373 +
 user-exec.c                                        |   28 +-
 util/Makefile.objs                                 |    4 +
 util/bitmap.c                                      |   60 +-
 util/cache-utils.c                                 |   51 +-
 util/compatfd.c                                    |   17 +-
 util/cutils.c                                      |   14 +
 util/error.c                                       |   63 +-
 util/fifo8.c                                       |   47 +
 util/getauxval.c                                   |   74 +
 util/host-utils.c                                  |   75 +
 util/iov.c                                         |  115 +-
 util/module.c                                      |  147 +-
 util/osdep.c                                       |   26 +-
 util/oslib-posix.c                                 |   97 +-
 util/oslib-win32.c                                 |   64 +-
 util/path.c                                        |    4 +-
 util/qemu-config.c                                 |  191 +-
 util/qemu-option.c                                 |   95 +-
 util/qemu-progress.c                               |   11 +-
 util/qemu-sockets.c                                |   24 +-
 util/qemu-thread-posix.c                           |  145 +-
 util/qemu-thread-win32.c                           |   38 +-
 util/readline.c                                    |  495 +
 util/rfifolock.c                                   |   78 +
 util/throttle.c                                    |  396 +
 version.rc                                         |    4 +-
 vl.c                                               |  650 +-
 vmstate.c                                          |  653 +
 xen-all.c                                          | 1228 -
 xen-common-stub.c                                  |   19 +
 xen-common.c                                       |  123 +
 xen-hvm-stub.c                                     |   61 +
 xen-hvm.c                                          | 1129 +
 xen-stub.c                                         |   70 -
 1729 files changed, 218601 insertions(+), 122912 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0fe114d..de90463 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,65 +1,75 @@
-config-devices.*
-config-all-devices.*
-config-all-disas.*
-config-host.*
-config-target.*
-trace/generated-tracers.h
-trace/generated-tracers.c
-trace/generated-tracers-dtrace.h
-trace/generated-tracers.dtrace
-trace/generated-events.h
-trace/generated-events.c
-libcacard/trace/generated-tracers.c
+/config-devices.*
+/config-all-devices.*
+/config-all-disas.*
+/config-host.*
+/config-target.*
+/config.status
+/trace/generated-tracers.h
+/trace/generated-tracers.c
+/trace/generated-tracers-dtrace.h
+/trace/generated-tracers.dtrace
+/trace/generated-events.h
+/trace/generated-events.c
+/trace/generated-ust-provider.h
+/trace/generated-ust.c
+/libcacard/trace/generated-tracers.c
 *-timestamp
-*-softmmu
-*-darwin-user
-*-linux-user
-*-bsd-user
+/*-softmmu
+/*-darwin-user
+/*-linux-user
+/*-bsd-user
 libdis*
 libuser
-linux-headers/asm
-qapi-generated
-qapi-types.[ch]
-qapi-visit.[ch]
-qmp-commands.h
-qmp-marshal.c
-qemu-doc.html
-qemu-tech.html
-qemu-doc.info
-qemu-tech.info
-qemu.1
-qemu.pod
-qemu-img.1
-qemu-img.pod
-qemu-img
-qemu-nbd
-qemu-nbd.8
-qemu-nbd.pod
-qemu-options.def
-qemu-options.texi
-qemu-img-cmds.texi
-qemu-img-cmds.h
-qemu-io
-qemu-ga
-qemu-bridge-helper
-qemu-monitor.texi
-vscclient
-QMP/qmp-commands.txt
-test-coroutine
-test-qmp-input-visitor
-test-qmp-output-visitor
-test-string-input-visitor
-test-string-output-visitor
-test-visitor-serialization
-fsdev/virtfs-proxy-helper
-fsdev/virtfs-proxy-helper.1
-fsdev/virtfs-proxy-helper.pod
-.gdbinit
+/linux-headers/asm
+/qga/qapi-generated
+/qapi-generated
+/qapi-types.[ch]
+/qapi-visit.[ch]
+/qmp-commands.h
+/qmp-marshal.c
+/qemu-doc.html
+/qemu-tech.html
+/qemu-doc.info
+/qemu-tech.info
+/qemu.1
+/qemu.pod
+/qemu-img.1
+/qemu-img.pod
+/qemu-img
+/qemu-nbd
+/qemu-nbd.8
+/qemu-nbd.pod
+/qemu-options.def
+/qemu-options.texi
+/qemu-img-cmds.texi
+/qemu-img-cmds.h
+/qemu-io
+/qemu-ga
+/qemu-bridge-helper
+/qemu-monitor.texi
+/qmp-commands.txt
+/vscclient
+/test-bitops
+/test-coroutine
+/test-int128
+/test-opts-visitor
+/test-qmp-input-visitor
+/test-qmp-output-visitor
+/test-string-input-visitor
+/test-string-output-visitor
+/test-visitor-serialization
+/fsdev/virtfs-proxy-helper
+/fsdev/virtfs-proxy-helper.1
+/fsdev/virtfs-proxy-helper.pod
+/.gdbinit
 *.a
 *.aux
 *.cp
 *.dvi
 *.exe
+*.dll
+*.so
+*.mo
 *.fn
 *.ky
 *.log
@@ -73,34 +83,35 @@ fsdev/virtfs-proxy-helper.pod
 *.tp
 *.vr
 *.d
-!scripts/qemu-guest-agent/fsfreeze-hook.d
+!/scripts/qemu-guest-agent/fsfreeze-hook.d
 *.o
 *.lo
 *.la
 *.pc
 .libs
+.sdk
 *.swp
 *.orig
 .pc
 *.gcda
 *.gcno
 patches
-pc-bios/bios-pq/status
-pc-bios/vgabios-pq/status
-pc-bios/optionrom/linuxboot.asm
-pc-bios/optionrom/linuxboot.bin
-pc-bios/optionrom/linuxboot.raw
-pc-bios/optionrom/linuxboot.img
-pc-bios/optionrom/multiboot.asm
-pc-bios/optionrom/multiboot.bin
-pc-bios/optionrom/multiboot.raw
-pc-bios/optionrom/multiboot.img
-pc-bios/optionrom/kvmvapic.asm
-pc-bios/optionrom/kvmvapic.bin
-pc-bios/optionrom/kvmvapic.raw
-pc-bios/optionrom/kvmvapic.img
-pc-bios/s390-ccw/s390-ccw.elf
-pc-bios/s390-ccw/s390-ccw.img
+/pc-bios/bios-pq/status
+/pc-bios/vgabios-pq/status
+/pc-bios/optionrom/linuxboot.asm
+/pc-bios/optionrom/linuxboot.bin
+/pc-bios/optionrom/linuxboot.raw
+/pc-bios/optionrom/linuxboot.img
+/pc-bios/optionrom/multiboot.asm
+/pc-bios/optionrom/multiboot.bin
+/pc-bios/optionrom/multiboot.raw
+/pc-bios/optionrom/multiboot.img
+/pc-bios/optionrom/kvmvapic.asm
+/pc-bios/optionrom/kvmvapic.bin
+/pc-bios/optionrom/kvmvapic.raw
+/pc-bios/optionrom/kvmvapic.img
+/pc-bios/s390-ccw/s390-ccw.elf
+/pc-bios/s390-ccw/s390-ccw.img
 .stgit-*
 cscope.*
 tags
diff --git a/.gitmodules b/.gitmodules
index d7e3f3c..444c24a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,27 +1,30 @@
 [submodule "roms/vgabios"]
 	path = roms/vgabios
-	url = git://git.qemu.org/vgabios.git/
+	url = git://git.qemu-project.org/vgabios.git/
 [submodule "roms/seabios"]
 	path = roms/seabios
-	url = git://git.qemu.org/seabios.git/
+	url = git://git.qemu-project.org/seabios.git/
 [submodule "roms/SLOF"]
 	path = roms/SLOF
-	url = git://git.qemu.org/SLOF.git
+	url = git://git.qemu-project.org/SLOF.git
 [submodule "roms/ipxe"]
 	path = roms/ipxe
-	url = git://git.qemu.org/ipxe.git
+	url = git://git.qemu-project.org/ipxe.git
 [submodule "roms/openbios"]
 	path = roms/openbios
-	url = git://git.qemu.org/openbios.git
+	url = git://git.qemu-project.org/openbios.git
+[submodule "roms/openhackware"]
+	path = roms/openhackware
+	url = git://git.qemu-project.org/openhackware.git
 [submodule "roms/qemu-palcode"]
 	path = roms/qemu-palcode
 	url = git://github.com/rth7680/qemu-palcode.git
 [submodule "roms/sgabios"]
 	path = roms/sgabios
-	url = git://git.qemu.org/sgabios.git
+	url = git://git.qemu-project.org/sgabios.git
 [submodule "pixman"]
 	path = pixman
 	url = git://anongit.freedesktop.org/pixman
 [submodule "dtc"]
 	path = dtc
-	url = git://git.qemu.org/dtc.git
+	url = git://git.qemu-project.org/dtc.git
diff --git a/.mailmap b/.mailmap
index 9797802..28defa1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -2,7 +2,8 @@
 # into proper addresses so that they are counted properly in git shortlog output.
 #
 Andrzej Zaborowski <balrogg@gmail.com> balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
-Anthony Liguori <aliguori@us.ibm.com> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
+Anthony Liguori <anthony@codemonkey.ws> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
+Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
 Aurelien Jarno <aurelien@aurel32.net> aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
 Blue Swirl <blauwirbel@gmail.com> blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
 Edgar E. Iglesias <edgar.iglesias@gmail.com> edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..04da973
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,81 @@
+language: c
+python:
+  - "2.4"
+compiler:
+  - gcc
+  - clang
+notifications:
+  irc:
+    channels:
+      - "irc.oftc.net#qemu"
+    on_success: change
+    on_failure: always
+env:
+  global:
+    - TEST_CMD="make check"
+    - EXTRA_CONFIG=""
+    # Development packages, EXTRA_PKGS saved for additional builds
+    - CORE_PKGS="libusb-1.0-0-dev libiscsi-dev librados-dev libncurses5-dev"
+    - NET_PKGS="libseccomp-dev libgnutls-dev libssh2-1-dev  libspice-server-dev libspice-protocol-dev libnss3-dev"
+    - GUI_PKGS="libgtk-3-dev libvte-2.90-dev libsdl1.2-dev libpng12-dev libpixman-1-dev"
+    - EXTRA_PKGS=""
+  matrix:
+    - TARGETS=alpha-softmmu,alpha-linux-user
+    - TARGETS=arm-softmmu,arm-linux-user
+    - TARGETS=aarch64-softmmu,aarch64-linux-user
+    - TARGETS=cris-softmmu
+    - TARGETS=i386-softmmu,x86_64-softmmu
+    - TARGETS=lm32-softmmu
+    - TARGETS=m68k-softmmu
+    - TARGETS=microblaze-softmmu,microblazeel-softmmu
+    - TARGETS=mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu
+    - TARGETS=moxie-softmmu
+    - TARGETS=or32-softmmu,
+    - TARGETS=ppc-softmmu,ppc64-softmmu,ppcemb-softmmu
+    - TARGETS=s390x-softmmu
+    - TARGETS=sh4-softmmu,sh4eb-softmmu
+    - TARGETS=sparc-softmmu,sparc64-softmmu
+    - TARGETS=unicore32-softmmu
+    - TARGETS=xtensa-softmmu,xtensaeb-softmmu
+before_install:
+  - git submodule update --init --recursive
+  - sudo apt-get update -qq
+  - sudo apt-get install -qq ${CORE_PKGS} ${NET_PKGS} ${GUI_PKGS} ${EXTRA_PKGS}
+script: "./configure --target-list=${TARGETS} ${EXTRA_CONFIG} && make && ${TEST_CMD}"
+matrix:
+  # We manually include a number of additional build for non-standard bits
+  include:
+    # Debug related options
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-debug"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-debug --enable-tcg-interpreter"
+      compiler: gcc
+    # All the extra -dev packages
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_PKGS="libaio-dev libcap-ng-dev libattr1-dev libbrlapi-dev uuid-dev libusb-1.0.0-dev"
+      compiler: gcc
+    # Currently configure doesn't force --disable-pie
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-gprof --enable-gcov --disable-pie"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_PKGS="sparse"
+           EXTRA_CONFIG="--enable-sparse"
+      compiler: gcc
+    # All the trace backends (apart from dtrace)
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-trace-backend=stderr"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-trace-backend=simple"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-trace-backend=ftrace"
+           TEST_CMD=""
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+          EXTRA_PKGS="liblttng-ust-dev liburcu-dev"
+          EXTRA_CONFIG="--enable-trace-backend=ust"
+      compiler: gcc
diff --git a/CODING_STYLE b/CODING_STYLE
index dcbce28..4280945 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -84,3 +84,10 @@ and clarity it comes on a line by itself:
 Rationale: a consistent (except for functions...) bracing style reduces
 ambiguity and avoids needless churn when lines are added or removed.
 Furthermore, it is the QEMU coding style.
+
+5. Declarations
+
+Mixed declarations (interleaving statements and declarations within blocks)
+are not allowed; declarations should be at the beginning of blocks.  In other
+words, the code should not generate warnings if using GCC's
+-Wdeclaration-after-statement option.
diff --git a/Changelog b/Changelog
index 13eebef..1249b8a 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,6 @@
 This file documents changes for QEMU releases 0.12 and earlier.
 For changelog information for later releases, see
-http://wiki.qemu.org/ChangeLog or look at the git history for
+http://wiki.qemu-project.org/ChangeLog or look at the git history for
 more detailed information.
 
 
diff --git a/MAINTAINERS b/MAINTAINERS
index 654e2cb..c66946f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -50,8 +50,7 @@ Descriptions of section entries:
 
 General Project Administration
 ------------------------------
-M: Anthony Liguori <aliguori@us.ibm.com>
-M: Paul Brook <paul@codesourcery.com>
+M: Anthony Liguori <aliguori@amazon.com>
 
 Guest CPU cores (TCG):
 ----------------------
@@ -62,7 +61,6 @@ F: target-alpha/
 F: hw/alpha/
 
 ARM
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: target-arm/
@@ -83,8 +81,7 @@ F: hw/lm32/
 F: hw/char/lm32_*
 
 M68K
-M: Paul Brook <paul@codesourcery.com>
-S: Odd Fixes
+S: Orphan
 F: target-m68k/
 F: hw/m68k/
 
@@ -161,7 +158,6 @@ Guest CPU Cores (KVM):
 ----------------------
 
 Overall
-M: Gleb Natapov <gleb@redhat.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 L: kvm@vger.kernel.org
 S: Supported
@@ -179,12 +175,14 @@ S: Maintained
 F: target-ppc/kvm.c
 
 S390
+M: Christian Borntraeger <borntraeger@de.ibm.com>
+M: Cornelia Huck <cornelia.huck@de.ibm.com>
 M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: target-s390x/kvm.c
+F: hw/intc/s390_flic.[hc]
 
 X86
-M: Gleb Natapov <gleb@redhat.com>
 M: Marcelo Tosatti <mtosatti@redhat.com>
 L: kvm@vger.kernel.org
 S: Supported
@@ -222,6 +220,13 @@ F: *win32*
 
 ARM Machines
 ------------
+Allwinner-a10
+M: Li Guang <lig.fnst@cn.fujitsu.com>
+S: Maintained
+F: hw/*/allwinner-a10*
+F: include/hw/*/allwinner-a10*
+F: hw/arm/cubieboard.c
+
 Exynos
 M: Evgeny Voevodin <e.voevodin@samsung.com>
 M: Maksim Kozlov <m.kozlov@samsung.com>
@@ -236,6 +241,12 @@ S: Supported
 F: hw/arm/highbank.c
 F: hw/net/xgmac.c
 
+Canon DIGIC
+M: Antony Pavlov <antonynpavlov@gmail.com>
+S: Maintained
+F: include/hw/arm/digic.h
+F: hw/*/digic*
+
 Gumstix
 M: qemu-devel@nongnu.org
 S: Orphan
@@ -248,7 +259,6 @@ F: hw/*/imx*
 F: hw/arm/kzm.c
 
 Integrator CP
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/arm/integratorcp.c
@@ -274,7 +284,6 @@ S: Maintained
 F: hw/arm/palm.c
 
 Real View
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/arm/realview*
@@ -285,19 +294,17 @@ S: Maintained
 F: hw/arm/spitz.c
 
 Stellaris
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/*/stellaris*
 
 Versatile PB
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/*/versatile*
 
 Xilinx Zynq
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 S: Maintained
 F: hw/arm/xilinx_zynq.c
 F: hw/misc/zynq_slcr.c
@@ -327,18 +334,15 @@ F: hw/lm32/milkymist.c
 M68K Machines
 -------------
 an5206
-M: Paul Brook <paul@codesourcery.com>
-S: Maintained
+S: Orphan
 F: hw/m68k/an5206.c
 
 dummy_m68k
-M: Paul Brook <paul@codesourcery.com>
-S: Maintained
+S: Orphan
 F: hw/m68k/dummy_m68k.c
 
 mcf5208
-M: Paul Brook <paul@codesourcery.com>
-S: Maintained
+S: Orphan
 F: hw/m68k/mcf5208.c
 
 MicroBlaze Machines
@@ -349,7 +353,7 @@ S: Maintained
 F: hw/microblaze/petalogix_s3adsp1800_mmu.c
 
 petalogix_ml605
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 S: Maintained
 F: hw/microblaze/petalogix_ml605_mmu.c
 
@@ -492,10 +496,13 @@ F: hw/s390x/s390-*.c
 
 S390 Virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Christian Borntraeger <borntraeger@de.ibm.com>
 M: Alexander Graf <agraf@suse.de>
 S: Supported
 F: hw/s390x/s390-virtio-ccw.c
 F: hw/s390x/css.[hc]
+F: hw/s390x/sclp*.[hc]
+F: hw/s390x/ipl*.[hc]
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
 
 UniCore32 Machines
@@ -509,10 +516,24 @@ F: hw/unicore32/
 X86 Machines
 ------------
 PC
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
+M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
-F: hw/i386/pc.[ch]
-F: hw/i386/pc_piix.c
+F: include/hw/i386/
+F: hw/i386/
+F: hw/pci-host/piix.c
+F: hw/pci-host/q35.c
+F: hw/pci-host/pam.c
+F: include/hw/pci-host/q35.h
+F: include/hw/pci-host/pam.h
+F: hw/isa/piix4.c
+F: hw/isa/lpc_ich9.c
+F: hw/i2c/smbus_ich9.c
+F: hw/acpi/piix4.c
+F: hw/acpi/ich9.c
+F: include/hw/acpi/ich9.h
+F: include/hw/acpi/piix.h
+
 
 Xtensa Machines
 ---------------
@@ -567,12 +588,11 @@ F: hw/scsi/*
 T: git git://github.com/bonzini/qemu.git scsi-next
 
 LSI53C895A
-M: Paul Brook <paul@codesourcery.com>
-S: Odd Fixes
+S: Orphan
 F: hw/scsi/lsi53c895a.c
 
 SSI
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 S: Maintained
 F: hw/ssi/*
 F: hw/block/m25p80.c
@@ -593,7 +613,8 @@ S: Supported
 F: hw/*/*vhost*
 
 virtio
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
+M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: hw/*/virtio*
 
@@ -602,6 +623,7 @@ M: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
 S: Supported
 F: hw/9pfs/
 F: fsdev/
+F: tests/virtio-9p-test.c
 T: git git://github.com/kvaneesh/QEMU.git
 
 virtio-blk
@@ -612,6 +634,7 @@ F: hw/block/virtio-blk.c
 
 virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Christian Borntraeger <borntraeger@de.ibm.com>
 S: Supported
 F: hw/s390x/virtio-ccw.[hc]
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
@@ -626,9 +649,10 @@ nvme
 M: Keith Busch <keith.busch@intel.com>
 S: Supported
 F: hw/block/nvme*
+F: tests/nvme-test.c
 
 Xilinx EDK
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
 S: Maintained
 F: hw/*/xilinx_*
@@ -638,6 +662,7 @@ Subsystems
 ----------
 Audio
 M: Vassili Karpov (malc) <av1474@comtv.ru>
+M: Gerd Hoffmann <kraxel@redhat.com>
 S: Maintained
 F: audio/
 F: hw/audio/
@@ -649,9 +674,11 @@ S: Supported
 F: block*
 F: block/
 F: hw/block/
+T: git git://repo.or.cz/qemu/kevin.git block
+T: git git://github.com/stefanha/qemu.git block
 
 Character Devices
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
 S: Maintained
 F: qemu-char.c
 
@@ -669,7 +696,7 @@ F: include/hw/cpu/icc_bus.h
 F: hw/cpu/icc_bus.c
 
 Device Tree
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: device_tree.[ch]
@@ -689,34 +716,45 @@ F: audio/spiceaudio.c
 F: hw/display/qxl*
 
 Graphics
-M: Anthony Liguori <aliguori@us.ibm.com>
-S: Maintained
+M: Anthony Liguori <aliguori@amazon.com>
+M: Gerd Hoffmann <kraxel@redhat.com>
+S: Odd Fixes
 F: ui/
 
 Cocoa graphics
 M: Andreas Färber <andreas.faerber@web.de>
+M: Peter Maydell <peter.maydell@linaro.org>
 S: Odd Fixes
 F: ui/cocoa.m
 
 Main loop
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
 S: Supported
 F: vl.c
 
 Human Monitor (HMP)
 M: Luiz Capitulino <lcapitulino@redhat.com>
-S: Supported
+S: Maintained
 F: monitor.c
 F: hmp.c
 F: hmp-commands.hx
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 Network device layer
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
 M: Stefan Hajnoczi <stefanha@redhat.com>
 S: Maintained
 F: net/
 T: git git://github.com/stefanha/qemu.git net
 
+Netmap network backend
+M: Luigi Rizzo <rizzo@iet.unipi.it>
+M: Giuseppe Lettieri <g.lettieri@iet.unipi.it>
+M: Vincenzo Maffione <v.maffione@gmail.com>
+W: http://info.iet.unipi.it/~luigi/netmap/
+S: Maintained
+F: net/netmap.c
+
 Network Block Device (NBD)
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Odd Fixes
@@ -728,8 +766,9 @@ T: git git://github.com/bonzini/qemu.git nbd-next
 QAPI
 M: Luiz Capitulino <lcapitulino@redhat.com>
 M: Michael Roth <mdroth@linux.vnet.ibm.com>
-S: Supported
+S: Maintained
 F: qapi/
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 QAPI Schema
 M: Eric Blake <eblake@redhat.com>
@@ -737,14 +776,16 @@ M: Luiz Capitulino <lcapitulino@redhat.com>
 M: Markus Armbruster <armbru@redhat.com>
 S: Supported
 F: qapi-schema.json
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 QMP
 M: Luiz Capitulino <lcapitulino@redhat.com>
-S: Supported
+S: Maintained
 F: qmp.c
 F: monitor.c
 F: qmp-commands.hx
 F: QMP/
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 SLIRP
 M: Jan Kiszka <jan.kiszka@siemens.com>
@@ -766,6 +807,12 @@ M: Blue Swirl <blauwirbel@gmail.com>
 S: Odd Fixes
 F: scripts/checkpatch.pl
 
+Seccomp
+M: Eduardo Otubo <otubo@linux.vnet.ibm.com>
+S: Supported
+F: qemu-seccomp.c
+F: include/sysemu/seccomp.h
+
 Usermode Emulation
 ------------------
 BSD user
@@ -797,11 +844,6 @@ M: Andrzej Zaborowski <balrogg@gmail.com>
 S: Maintained
 F: tcg/arm/
 
-HPPA target
-M: Richard Henderson <rth@twiddle.net>
-S: Maintained
-F: tcg/hppa/
-
 i386 target
 M: qemu-devel@nongnu.org
 S: Maintained
@@ -842,25 +884,73 @@ TCI target
 M: Stefan Weil <sw@weilnetz.de>
 S: Maintained
 F: tcg/tci/
+F: tci.c
 
 Stable branches
 ---------------
 Stable 1.0
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-1.0.git
+T: git git://git.qemu-project.org/qemu-stable-1.0.git
 S: Orphan
 
 Stable 0.15
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-0.15.git
-S: Orphan
+M: Andreas Färber <afaerber@suse.de>
+T: git git://git.qemu-project.org/qemu-stable-0.15.git
+S: Supported
 
 Stable 0.14
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-0.14.git
+T: git git://git.qemu-project.org/qemu-stable-0.14.git
 S: Orphan
 
 Stable 0.10
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-0.10.git
+T: git git://git.qemu-project.org/qemu-stable-0.10.git
 S: Orphan
+
+Block drivers
+-------------
+VMDK
+M: Fam Zheng <famz@redhat.com>
+S: Supported
+F: block/vmdk.c
+
+RBD
+M: Josh Durgin <josh.durgin@inktank.com>
+S: Supported
+F: block/rbd.c
+
+Sheepdog
+M: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
+M: Liu Yuan <namei.unix@gmail.com>
+L: sheepdog@lists.wpkg.org
+S: Supported
+F: block/sheepdog.c
+
+VHDX
+M: Jeff Cody <jcody@redhat.com>
+S: Supported
+F: block/vhdx*
+
+VDI
+M: Stefan Weil <sw@weilnetz.de>
+S: Maintained
+F: block/vdi.c
+
+iSCSI
+M: Ronnie Sahlberg <ronniesahlberg@gmail.com>
+M: Paolo Bonzini <pbonzini@redhat.com>
+M: Peter Lieven <pl@kamp.de>
+S: Supported
+F: block/iscsi.c
+
+NFS
+M: Peter Lieven <pl@kamp.de>
+S: Maintained
+F: block/nfs.c
+
+SSH
+M: Richard W.M. Jones <rjones@redhat.com>
+S: Supported
+F: block/ssh.c
diff --git a/Makefile b/Makefile
index 4d257f1..423e373 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,14 @@ CONFIG_ALL=y
 include $(SRC_PATH)/rules.mak
 config-host.mak: $(SRC_PATH)/configure
 	@echo $@ is out-of-date, running configure
-	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
+	@# TODO: The next lines include code which supports a smooth
+	@# transition from old configurations without config.status.
+	@# This code can be removed after QEMU 1.7.
+	@if test -x config.status; then \
+	    ./config.status; \
+        else \
+	    sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \
+	fi
 else
 config-host.mak:
 ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
@@ -50,6 +57,11 @@ GENERATED_HEADERS += trace/generated-tracers-dtrace.h
 endif
 GENERATED_SOURCES += trace/generated-tracers.c
 
+ifeq ($(TRACE_BACKEND),ust)
+GENERATED_HEADERS += trace/generated-ust-provider.h
+GENERATED_SOURCES += trace/generated-ust.c
+endif
+
 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;
@@ -65,7 +77,7 @@ LIBS+=-lz $(LIBS_TOOLS)
 HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
 
 ifdef BUILD_DOCS
-DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
+DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
 ifdef CONFIG_VIRTFS
 DOCS+=fsdev/virtfs-proxy-helper.1
 endif
@@ -115,13 +127,30 @@ defconfig:
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/Makefile.objs
+endif
+
+dummy := $(call unnest-vars,, \
+                stub-obj-y \
+                util-obj-y \
+                qga-obj-y \
+                qga-vss-dll-obj-y \
+                block-obj-y \
+                block-obj-m \
+                common-obj-y \
+                common-obj-m)
+
+ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/tests/Makefile
 endif
 ifeq ($(CONFIG_SMARTCARD_NSS),y)
 include $(SRC_PATH)/libcacard/Makefile
 endif
 
-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
+all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
+
+vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
+
+vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
 
 config-host.h: config-host.h-timestamp
 config-host.h-timestamp: config-host.mak
@@ -131,6 +160,7 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
 
+$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
 
 subdir-%:
@@ -168,7 +198,9 @@ recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
 bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
 
 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
+	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
 $(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
+	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.lo")
 
 Makefile: $(version-obj-y) $(version-lobj-y)
 
@@ -178,6 +210,9 @@ Makefile: $(version-obj-y) $(version-lobj-y)
 libqemustub.a: $(stub-obj-y)
 libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o
 
+block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
+util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
+
 ######################################################################
 
 qemu-img.o: qemu-img-cmds.h
@@ -231,10 +266,10 @@ clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 	rm -f qemu-options.def
-	find . -name '*.[oda]' -type f -exec rm -f {} +
-	find . -name '*.l[oa]' -type f -exec rm -f {} +
-	rm -f $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
-	rm -Rf .libs
+	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
+	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
+	rm -f fsdev/*.pod
+	rm -rf .libs */.libs
 	rm -f qemu-img-cmds.h
 	@# May not be present in GENERATED_HEADERS
 	rm -f trace/generated-tracers-dtrace.dtrace*
@@ -243,7 +278,6 @@ clean:
 	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
 	rm -rf qapi-generated
 	rm -rf qga/qapi-generated
-	$(MAKE) -C tests/tcg clean
 	for d in $(ALL_SUBDIRS); do \
 	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
 	rm -f $$d/qemu-options.def; \
@@ -259,6 +293,7 @@ qemu-%.tar.bz2:
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
 	rm -f config-all-devices.mak config-all-disas.mak
+	rm -f po/*.mo
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
 	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
@@ -270,19 +305,20 @@ distclean: clean
 	for d in $(TARGET_DIRS); do \
 	rm -rf $$d || exit 1 ; \
         done
+	rm -Rf .sdk
 	if test -f pixman/config.log; then make -C pixman distclean; fi
 	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
 common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
-bepo
+bepo    cz
 
 ifdef INSTALL_BLOBS
-BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
+BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
 acpi-dsdt.aml q35-acpi-dsdt.aml \
-ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
+ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
@@ -301,7 +337,7 @@ endif
 install-doc: $(DOCS)
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
 	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
 ifdef CONFIG_POSIX
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
 	$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
@@ -338,6 +374,12 @@ install-datadir install-localstatedir
 ifneq ($(TOOLS),)
 	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
 endif
+ifneq ($(CONFIG_MODULES),)
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
+	for s in $(patsubst %.mo,%$(DSOSUF),$(modules-m)); do \
+		$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
+	done
+endif
 ifneq ($(HELPERS-y),)
 	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
 	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
@@ -355,7 +397,7 @@ endif
 		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
 	done
 	for d in $(TARGET_DIRS); do \
-	$(MAKE) -C $$d $@ || exit 1 ; \
+	$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
         done
 
 # various test targets
@@ -395,7 +437,7 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
 qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
 
-QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
+qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
 
 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
diff --git a/Makefile.objs b/Makefile.objs
index f46a4cd..a6e0e2a 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -19,11 +19,8 @@ block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
 block-obj-y += qemu-coroutine-sleep.o
 block-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
 
-ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
-# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
-# only pull in the actual virtio-9p device if we also enabled virtio.
-CONFIG_REALLY_VIRTFS=y
-endif
+block-obj-m = block/
+
 
 ######################################################################
 # smartcard
@@ -41,9 +38,9 @@ libcacard-y += libcacard/vcardt.o
 # single QEMU executable should support all CPUs and machines.
 
 ifeq ($(CONFIG_SOFTMMU),y)
-common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
+common-obj-y = blockdev.o blockdev-nbd.o block/
+common-obj-y += iothread.o
 common-obj-y += net/
-common-obj-y += readline.o
 common-obj-y += qdev-monitor.o device-hotplug.o
 common-obj-$(CONFIG_WIN32) += os-win32.o
 common-obj-$(CONFIG_POSIX) += os-posix.o
@@ -51,6 +48,8 @@ common-obj-$(CONFIG_POSIX) += os-posix.o
 common-obj-$(CONFIG_LINUX) += fsdev/
 
 common-obj-y += migration.o migration-tcp.o
+common-obj-y += vmstate.o
+common-obj-y += qemu-file.o
 common-obj-$(CONFIG_RDMA) += migration-rdma.o
 common-obj-y += qemu-char.o #aio.o
 common-obj-y += block-migration.o
@@ -109,17 +108,4 @@ version-lobj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.lo
 # FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed
 # by libqemuutil.a.  These should be moved to a separate .json schema.
 qga-obj-y = qga/ qapi-types.o qapi-visit.o
-
-vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-
-vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
-
-QEMU_CFLAGS+=$(GLIB_CFLAGS)
-
-nested-vars += \
-	stub-obj-y \
-	util-obj-y \
-	qga-obj-y \
-	block-obj-y \
-	common-obj-y
-dummy := $(call unnest-vars)
+qga-vss-dll-obj-y = qga/
diff --git a/Makefile.target b/Makefile.target
index 9a49852..6d8fde8 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -70,10 +70,6 @@ all: $(PROGS) stap
 # Dummy command so that make thinks it has done something
 	@true
 
-CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
-CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
-CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
-
 #########################################################
 # cpu emulator library
 obj-y = exec.o translate-all.o cpu-exec.o
@@ -83,8 +79,8 @@ obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
 obj-y += fpu/softfloat.o
 obj-y += target-$(TARGET_BASE_ARCH)/
 obj-y += disas.o
-obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
-obj-$(CONFIG_NO_KVM) += kvm-stub.o
+obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
+obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
 
 #########################################################
 # Linux user emulator target
@@ -124,8 +120,10 @@ obj-y += dump.o
 LIBS+=$(libs_softmmu)
 
 # xen support
-obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
-obj-$(CONFIG_NO_XEN) += xen-stub.o
+obj-$(CONFIG_XEN) += xen-common.o
+obj-$(CONFIG_XEN_I386) += xen-hvm.o xen-mapcache.o
+obj-$(call lnot,$(CONFIG_XEN)) += xen-common-stub.o
+obj-$(call lnot,$(CONFIG_XEN_I386)) += xen-hvm-stub.o
 
 # Hardware support
 ifeq ($(TARGET_NAME), sparc64)
@@ -134,8 +132,6 @@ else
 obj-y += hw/$(TARGET_BASE_ARCH)/
 endif
 
-main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-
 GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
 
 endif # CONFIG_SOFTMMU
@@ -143,13 +139,26 @@ endif # CONFIG_SOFTMMU
 # Workaround for http://gcc.gnu.org/PR55489, see configure.
 %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
 
-nested-vars += obj-y
+dummy := $(call unnest-vars,,obj-y)
 
-# This resolves all nested paths, so it must come last
+# we are making another call to unnest-vars with different vars, protect obj-y,
+# it can be overriden in subdir Makefile.objs
+obj-y-save := $(obj-y)
+
+block-obj-y :=
+common-obj-y :=
 include $(SRC_PATH)/Makefile.objs
+dummy := $(call unnest-vars,.., \
+               block-obj-y \
+               block-obj-m \
+               common-obj-y \
+               common-obj-m)
+
+# Now restore obj-y
+obj-y := $(obj-y-save)
 
-all-obj-y = $(obj-y)
-all-obj-y += $(addprefix ../, $(common-obj-y))
+all-obj-y = $(obj-y) $(common-obj-y)
+all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
 
 ifndef CONFIG_HAIKU
 LIBS+=-lm
diff --git a/QMP/README b/QMP/README
deleted file mode 100644
index c95a08c..0000000
--- a/QMP/README
+++ /dev/null
@@ -1,88 +0,0 @@
-                          QEMU Monitor Protocol
-                          =====================
-
-Introduction
--------------
-
-The QEMU Monitor Protocol (QMP) allows applications to communicate with
-QEMU's Monitor.
-
-QMP is JSON[1] based and currently has the following features:
-
-- Lightweight, text-based, easy to parse data format
-- Asynchronous messages support (ie. events)
-- Capabilities Negotiation
-
-For detailed information on QMP's usage, please, refer to the following files:
-
-o qmp-spec.txt      QEMU Monitor Protocol current specification
-o qmp-commands.txt  QMP supported commands (auto-generated at build-time)
-o qmp-events.txt    List of available asynchronous events
-
-There is also a simple Python script called 'qmp-shell' available.
-
-IMPORTANT: It's strongly recommended to read the 'Stability Considerations'
-section in the qmp-commands.txt file before making any serious use of QMP.
-
-
-[1] http://www.json.org
-
-Usage
------
-
-To enable QMP, you need a QEMU monitor instance in "control mode". There are
-two ways of doing this.
-
-The simplest one is using the '-qmp' command-line option. The following
-example makes QMP available on localhost port 4444:
-
-  $ qemu [...] -qmp tcp:localhost:4444,server
-
-However, in order to have more complex combinations, like multiple monitors,
-the '-mon' command-line option should be used along with the '-chardev' one.
-For instance, the following example creates one user monitor on stdio and one
-QMP monitor on localhost port 4444.
-
-   $ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
-                -chardev socket,id=mon1,host=localhost,port=4444,server \
-                -mon chardev=mon1,mode=control
-
-Please, refer to QEMU's manpage for more information.
-
-Simple Testing
---------------
-
-To manually test QMP one can connect with telnet and issue commands by hand:
-
-$ telnet localhost 4444
-Trying 127.0.0.1...
-Connected to localhost.
-Escape character is '^]'.
-{"QMP": {"version": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}, "capabilities": []}}
-{ "execute": "qmp_capabilities" }
-{"return": {}}
-{ "execute": "query-version" }
-{"return": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}}
-
-Development Process
--------------------
-
-When changing QMP's interface (by adding new commands, events or modifying
-existing ones) it's mandatory to update the relevant documentation, which is
-one (or more) of the files listed in the 'Introduction' section*.
-
-Also, it's strongly recommended to send the documentation patch first, before
-doing any code change. This is so because:
-
-  1. Avoids the code dictating the interface
-
-  2. Review can improve your interface.  Letting that happen before
-     you implement it can save you work.
-
-* The qmp-commands.txt file is generated from the qmp-commands.hx one, which
-  is the file that should be edited.
-
-Homepage
---------
-
-http://wiki.qemu.org/QMP
diff --git a/QMP/qemu-ga-client b/QMP/qemu-ga-client
deleted file mode 100755
index 46676c3..0000000
--- a/QMP/qemu-ga-client
+++ /dev/null
@@ -1,299 +0,0 @@
-#!/usr/bin/python
-


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

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

From xen-changelog-bounces@lists.xen.org Wed Jun 04 23:44:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 04 Jun 2014 23:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WsKrY-0007JA-9m; Wed, 04 Jun 2014 23:44:56 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WsKrX-0007J0-7E
	for xen-changelog@lists.xensource.com; Wed, 04 Jun 2014 23:44:55 +0000
Received: from [85.158.143.35:22451] by server-3.bemta-4.messagelabs.com id
	66/C2-13602-67FAF835; Wed, 04 Jun 2014 23:44:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1401925488!9333716!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.3 required=7.0 tests=MAILTO_TO_SPAM_ADDR
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9956 invoked from network); 4 Jun 2014 23:44:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	4 Jun 2014 23:44:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WsKrQ-0008F9-E4
	for xen-changelog@lists.xensource.com; Wed, 04 Jun 2014 23:44:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WsKrP-0003rL-Sc
	for xen-changelog@lists.xensource.com; Wed, 04 Jun 2014 23:44:48 +0000
Date: Wed, 04 Jun 2014 23:44:47 +0000
Message-Id: <E1WsKrP-0003rL-Sc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] Merge remote-tracking
	branch 'xen-staging/master' into xen-for-4.5-temp
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3323743706982268757=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

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

commit 2addb502cdb50bab00514b9723bf6e09c88ff75e
Merge: 1e1a3289f473a460bee7a8745574f61c9e2f8506 65fc9b78ba3d868a26952db0d8e51cecf01d47b4
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 3 17:52:59 2014 +0000
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Tue Jun 3 17:52:59 2014 +0000

    Merge remote-tracking branch 'xen-staging/master' into xen-for-4.5-temp

 .gitignore                                         |  153 +-
 .gitmodules                                        |   17 +-
 .mailmap                                           |    3 +-
 .travis.yml                                        |   81 +
 CODING_STYLE                                       |    7 +
 Changelog                                          |    2 +-
 MAINTAINERS                                        |  182 +-
 Makefile                                           |   70 +-
 Makefile.objs                                      |   28 +-
 Makefile.target                                    |   37 +-
 QMP/README                                         |   88 -
 QMP/qemu-ga-client                                 |  299 -
 QMP/qmp                                            |  126 -
 QMP/qmp-events.txt                                 |  480 -
 QMP/qmp-shell                                      |  286 -
 QMP/qmp-spec.txt                                   |  282 -
 QMP/qmp.py                                         |  190 -
 QMP/qom-fuse                                       |  138 -
 QMP/qom-get                                        |   67 -
 QMP/qom-list                                       |   64 -
 QMP/qom-set                                        |   64 -
 README                                             |    2 +-
 VERSION                                            |    2 +-
 aio-posix.c                                        |   55 +-
 aio-win32.c                                        |   58 +-
 arch_init.c                                        |  285 +-
 async.c                                            |   42 +-
 audio/audio.c                                      |   10 +-
 audio/mixeng.c                                     |    6 -
 audio/mixeng_template.h                            |    4 +-
 audio/noaudio.c                                    |    4 +-
 audio/ossaudio.c                                   |    4 +
 audio/paaudio.c                                    |    8 +-
 audio/spiceaudio.c                                 |   31 +-
 audio/wavaudio.c                                   |    2 +-
 backends/baum.c                                    |   24 +-
 backends/rng-egd.c                                 |    1 -
 backends/rng-random.c                              |    4 +-
 backends/rng.c                                     |   17 +-
 block-migration.c                                  |   29 +-
 block.c                                            | 2550 +-
 block/Makefile.objs                                |   21 +-
 block/backup.c                                     |   28 +-
 block/blkdebug.c                                   |  133 +-
 block/blkverify.c                                  |  168 +-
 block/bochs.c                                      |  125 +-
 block/cloop.c                                      |   84 +-
 block/commit.c                                     |   22 +-
 block/cow.c                                        |  185 +-
 block/curl.c                                       |  137 +-
 block/dmg.c                                        |  278 +-
 block/gluster.c                                    |  543 +-
 block/iscsi.c                                      | 1117 +-
 block/linux-aio.c                                  |   18 +-
 block/mirror.c                                     |  212 +-
 block/nbd-client.c                                 |  388 +
 block/nbd-client.h                                 |   50 +
 block/nbd.c                                        |  431 +-
 block/nfs.c                                        |  442 +
 block/parallels.c                                  |   20 +-
 block/qapi.c                                       |  225 +-
 block/qcow.c                                       |   41 +-
 block/qcow2-cache.c                                |   33 +
 block/qcow2-cluster.c                              |  377 +-
 block/qcow2-refcount.c                             |  716 +-
 block/qcow2-snapshot.c                             |  160 +-
 block/qcow2.c                                      |  873 +-
 block/qcow2.h                                      |  156 +-
 block/qed.c                                        |  122 +-
 block/qed.h                                        |    2 +-
 block/quorum.c                                     |  877 +
 block/raw-aio.h                                    |    3 +-
 block/raw-posix.c                                  |  472 +-
 block/raw-win32.c                                  |  106 +-
 block/raw.c                                        |  192 -
 block/raw_bsd.c                                    |  206 +
 block/rbd.c                                        |  174 +-
 block/sheepdog.c                                   |  586 +-
 block/snapshot.c                                   |  210 +-
 block/ssh.c                                        |   18 +-
 block/stream.c                                     |   36 +-
 block/vdi.c                                        |   90 +-
 block/vhdx-endian.c                                |  216 +
 block/vhdx-log.c                                   | 1021 +
 block/vhdx.c                                       | 1287 +-
 block/vhdx.h                                       |  181 +-
 block/vmdk.c                                       |  651 +-
 block/vpc.c                                        |  100 +-
 block/vvfat.c                                      |   96 +-
 block/win32-aio.c                                  |   10 +-
 blockdev-nbd.c                                     |   10 +-
 blockdev.c                                         | 1492 +-
 blockjob.c                                         |   31 +-
 bsd-user/main.c                                    |    2 +-
 bsd-user/qemu.h                                    |    6 +-
 configure                                          | 1307 +-
 cpu-exec.c                                         |  179 +-
 cpus.c                                             |  430 +-
 cputlb.c                                           |   76 +-
 default-configs/aarch64-linux-user.mak             |    3 +
 default-configs/aarch64-softmmu.mak                |    6 +
 default-configs/arm-linux-user.mak                 |    2 -
 default-configs/arm-softmmu.mak                    |   14 +-
 default-configs/armeb-linux-user.mak               |    2 -
 default-configs/m68k-linux-user.mak                |    2 -
 default-configs/m68k-softmmu.mak                   |    1 -
 default-configs/ppc-linux-user.mak                 |    2 -
 default-configs/ppc-softmmu.mak                    |    4 +-
 default-configs/ppc64-linux-user.mak               |    2 -
 default-configs/ppc64-softmmu.mak                  |    4 +-
 default-configs/ppc64abi32-linux-user.mak          |    2 -
 default-configs/ppcemb-softmmu.mak                 |   26 -
 default-configs/s390x-softmmu.mak                  |    1 +
 default-configs/sparc-softmmu.mak                  |    1 +
 device-hotplug.c                                   |    4 +-
 device_tree.c                                      |   68 +-
 disas.c                                            |   61 +-
 disas/Makefile.objs                                |    5 +
 disas/arm-a64.cc                                   |   87 +
 disas/i386.c                                       |  154 +-
 disas/libvixl/LICENCE                              |   30 +
 disas/libvixl/Makefile.objs                        |    8 +
 disas/libvixl/README                               |   12 +
 disas/libvixl/a64/assembler-a64.h                  | 1784 +
 disas/libvixl/a64/constants-a64.h                  | 1104 +
 disas/libvixl/a64/cpu-a64.h                        |   56 +
 disas/libvixl/a64/decoder-a64.cc                   |  712 +
 disas/libvixl/a64/decoder-a64.h                    |  198 +
 disas/libvixl/a64/disasm-a64.cc                    | 1678 +
 disas/libvixl/a64/disasm-a64.h                     |  109 +
 disas/libvixl/a64/instructions-a64.cc              |  238 +
 disas/libvixl/a64/instructions-a64.h               |  344 +
 disas/libvixl/globals.h                            |   65 +
 disas/libvixl/platform.h                           |   43 +
 disas/libvixl/utils.cc                             |  126 +
 disas/libvixl/utils.h                              |  126 +
 disas/ppc.c                                        |    3 +-
 dma-helpers.c                                      |    2 +
 docs/ccid.txt                                      |    2 +-
 docs/memory.txt                                    |   68 +-
 docs/q35-chipset.cfg                               |   23 +
 docs/qapi-code-gen.txt                             |   24 +-
 docs/qemupciserial.inf                             |  167 +-
 docs/qmp/README                                    |   87 +
 docs/qmp/qmp-events.txt                            |  541 +
 docs/qmp/qmp-spec.txt                              |  273 +
 docs/rdma.txt                                      |   26 +-
 docs/specs/acpi_cpu_hotplug.txt                    |    4 +-
 docs/specs/qcow2.txt                               |   10 +-
 docs/tracing.txt                                   |   36 +
 dump.c                                             |  974 +-
 exec.c                                             | 1081 +-
 fpu/softfloat.c                                    | 1155 +-
 fsdev/Makefile.objs                                |    4 +-
 fsdev/virtfs-proxy-helper.c                        |    2 +-
 gdb-xml/aarch64-core.xml                           |   46 +
 gdb-xml/aarch64-fpu.xml                            |   86 +
 gdbstub.c                                          |   71 +-
 hmp-commands.hx                                    |   93 +-
 hmp.c                                              |  175 +-
 hmp.h                                              |    5 +
 hw/9pfs/cofile.c                                   |    4 -
 hw/9pfs/cofs.c                                     |   48 +-
 hw/9pfs/virtio-9p-device.c                         |   43 +-
 hw/9pfs/virtio-9p-handle.c                         |   17 +-
 hw/9pfs/virtio-9p-local.c                          |  298 +-
 hw/9pfs/virtio-9p-posix-acl.c                      |   52 +-
 hw/9pfs/virtio-9p-proxy.c                          |    3 +-
 hw/9pfs/virtio-9p-xattr-user.c                     |   27 +-
 hw/9pfs/virtio-9p-xattr.c                          |   15 +-
 hw/9pfs/virtio-9p-xattr.h                          |   27 +-
 hw/9pfs/virtio-9p.c                                |   12 +-
 hw/9pfs/virtio-9p.h                                |    6 +-
 hw/Makefile.objs                                   |    4 +-
 hw/acpi/Makefile.objs                              |    3 +-
 hw/acpi/core.c                                     |   69 +-
 hw/acpi/cpu_hotplug.c                              |   65 +
 hw/acpi/ich9.c                                     |   62 +-
 hw/acpi/pcihp.c                                    |  331 +
 hw/acpi/piix4.c                                    |  478 +-
 hw/alpha/dp264.c                                   |    6 +-
 hw/alpha/typhoon.c                                 |  206 +-
 hw/arm/Makefile.objs                               |    7 +-
 hw/arm/allwinner-a10.c                             |  119 +
 hw/arm/armv7m.c                                    |   30 +-
 hw/arm/boot.c                                      |  274 +-
 hw/arm/collie.c                                    |    1 -
 hw/arm/cubieboard.c                                |   76 +
 hw/arm/digic.c                                     |  115 +
 hw/arm/digic_boards.c                              |  162 +
 hw/arm/exynos4210.c                                |   34 +-
 hw/arm/exynos4_boards.c                            |    5 +-
 hw/arm/gumstix.c                                   |   13 +-
 hw/arm/highbank.c                                  |   55 +-
 hw/arm/integratorcp.c                              |   24 +-
 hw/arm/kzm.c                                       |    9 +-
 hw/arm/mainstone.c                                 |   21 +-
 hw/arm/musicpal.c                                  |   21 +-
 hw/arm/nseries.c                                   |    8 +-
 hw/arm/omap1.c                                     |   84 +-
 hw/arm/omap2.c                                     |    8 +-
 hw/arm/omap_sx1.c                                  |   15 +-
 hw/arm/palm.c                                      |   14 +-
 hw/arm/pic_cpu.c                                   |   68 -
 hw/arm/pxa2xx.c                                    |  151 +-
 hw/arm/pxa2xx_gpio.c                               |    2 +-
 hw/arm/pxa2xx_pic.c                                |   15 +-
 hw/arm/realview.c                                  |   49 +-
 hw/arm/spitz.c                                     |   25 +-
 hw/arm/stellaris.c                                 |   20 +-
 hw/arm/strongarm.c                                 |   40 +-
 hw/arm/tosa.c                                      |   19 +-
 hw/arm/versatilepb.c                               |   14 +-
 hw/arm/vexpress.c                                  |  190 +-
 hw/arm/virt.c                                      |  458 +
 hw/arm/xilinx_zynq.c                               |   53 +-
 hw/arm/z2.c                                        |   42 +-
 hw/audio/ac97.c                                    |    4 +-
 hw/audio/adlib.c                                   |    8 +-
 hw/audio/cs4231a.c                                 |    2 +-
 hw/audio/es1370.c                                  |    4 +-
 hw/audio/fmopl.c                                   |    6 +-
 hw/audio/gus.c                                     |    2 +-
 hw/audio/hda-codec-common.h                        |  456 +
 hw/audio/hda-codec.c                               |  520 +-
 hw/audio/intel-hda.c                               |   17 +-
 hw/audio/intel-hda.h                               |    2 +-
 hw/audio/marvell_88w8618.c                         |    2 +
 hw/audio/pcspk.c                                   |    5 +-
 hw/audio/pl041.c                                   |    1 -
 hw/audio/sb16.c                                    |   10 +-
 hw/audio/wm8750.c                                  |   33 +-
 hw/block/cdrom.c                                   |   10 +-
 hw/block/dataplane/virtio-blk.c                    |  231 +-
 hw/block/dataplane/virtio-blk.h                    |    5 +-
 hw/block/fdc.c                                     |    9 +-
 hw/block/m25p80.c                                  |   14 +-
 hw/block/nand.c                                    |    2 +-
 hw/block/nvme.c                                    |   26 +-
 hw/block/pflash_cfi01.c                            |  262 +-
 hw/block/pflash_cfi02.c                            |   12 +-
 hw/block/tc58128.c                                 |   10 +-
 hw/block/virtio-blk.c                              |   50 +-
 hw/block/xen_blkif.h                               |   12 +
 hw/block/xen_disk.c                                |   73 +-
 hw/bt/core.c                                       |   23 +
 hw/bt/hci-csr.c                                    |    4 +-
 hw/bt/hci.c                                        |   86 +-
 hw/bt/l2cap.c                                      |    8 +-
 hw/char/Makefile.objs                              |    5 +-
 hw/char/cadence_uart.c                             |  161 +-
 hw/char/debugcon.c                                 |    4 +-
 hw/char/digic-uart.c                               |  195 +
 hw/char/exynos4210_uart.c                          |    6 +-
 hw/char/ipack.c                                    |  116 -
 hw/char/ipack.h                                    |   79 -
 hw/char/ipoctal232.c                               |   20 +-
 hw/char/lm32_juart.c                               |    2 +-
 hw/char/lm32_uart.c                                |    2 +-
 hw/char/milkymist-uart.c                           |   26 +-
 hw/char/parallel.c                                 |    2 +-
 hw/char/pl011.c                                    |   24 +-
 hw/char/sclpconsole-lm.c                           |  379 +
 hw/char/sclpconsole.c                              |  114 +-
 hw/char/serial-isa.c                               |    2 +-
 hw/char/serial-pci.c                               |    5 +-
 hw/char/serial.c                                   |   33 +-
 hw/char/sh_serial.c                                |    2 -
 hw/char/spapr_vty.c                                |    1 +
 hw/char/tpci200.c                                  |  672 -
 hw/char/virtio-console.c                           |   69 +-
 hw/char/virtio-serial-bus.c                        |   96 +-
 hw/core/Makefile.objs                              |    4 +-
 hw/core/fw-path-provider.c                         |   52 +
 hw/core/hotplug.c                                  |   48 +
 hw/core/irq.c                                      |   16 +
 hw/core/loader.c                                   |  126 +-
 hw/core/machine.c                                  |   28 +
 hw/core/null-machine.c                             |    1 -
 hw/core/ptimer.c                                   |   18 +-
 hw/core/qdev-properties-system.c                   |   99 +-
 hw/core/qdev-properties.c                          |  254 +-
 hw/core/qdev.c                                     |  300 +-
 hw/core/sysbus.c                                   |   15 +-
 hw/cpu/Makefile.objs                               |    5 +-
 hw/cpu/a15mpcore.c                                 |   92 +-
 hw/cpu/a9mpcore.c                                  |  148 +-
 hw/cpu/arm11mpcore.c                               |  251 +-
 hw/cpu/icc_bus.c                                   |   17 +-
 hw/cpu/realview_mpcore.c                           |  139 +
 hw/cris/Makefile.objs                              |    1 -
 hw/cris/axis_dev88.c                               |   19 +-
 hw/cris/pic_cpu.c                                  |   47 -
 hw/display/Makefile.objs                           |    4 +-
 hw/display/ads7846.c                               |    7 +-
 hw/display/blizzard.c                              |    2 +-
 hw/display/blizzard_template.h                     |   40 +-
 hw/display/cg3.c                                   |  385 +
 hw/display/cirrus_vga.c                            |    9 +-
 hw/display/exynos4210_fimd.c                       |    2 +-
 hw/display/g364fb.c                                |    4 +-
 hw/display/jazz_led.c                              |    2 +-
 hw/display/milkymist-vgafb.c                       |    2 +-
 hw/display/milkymist-vgafb_template.h              |    2 +-
 hw/display/omap_lcdc.c                             |    2 +-
 hw/display/pl110.c                                 |   21 +-
 hw/display/pl110_template.h                        |   12 +-
 hw/display/pxa2xx_lcd.c                            |    2 +-
 hw/display/pxa2xx_template.h                       |   22 +-
 hw/display/qxl-logger.c                            |    2 +-
 hw/display/qxl-render.c                            |    1 +
 hw/display/qxl.c                                   |  114 +-
 hw/display/qxl.h                                   |    6 +-
 hw/display/sm501.c                                 |    3 +-
 hw/display/sm501_template.h                        |    2 +-
 hw/display/ssd0303.c                               |   20 +-
 hw/display/ssd0323.c                               |   11 +-
 hw/display/tc6393xb.c                              |    2 +-
 hw/display/tc6393xb_template.h                     |   14 +-
 hw/display/tcx.c                                   |   32 +-
 hw/display/vga-isa-mm.c                            |    2 +-
 hw/display/vga-isa.c                               |    2 +-
 hw/display/vga-pci.c                               |    4 +-
 hw/display/vga.c                                   |   12 +-
 hw/display/vga_template.h                          |   14 +-
 hw/display/vmware_vga.c                            |    8 +-
 hw/display/xenfb.c                                 |    9 +-
 hw/dma/i82374.c                                    |    2 +-
 hw/dma/pl080.c                                     |   10 +-
 hw/dma/pl330.c                                     |   61 +-
 hw/dma/rc4030.c                                    |    4 +-
 hw/dma/soc_dma.c                                   |    8 +-
 hw/dma/sparc32_dma.c                               |    2 +
 hw/dma/sun4m_iommu.c                               |    5 +-
 hw/dma/xilinx_axidma.c                             |   38 +-
 hw/gpio/max7310.c                                  |   23 +-
 hw/gpio/omap_gpio.c                                |    4 +
 hw/i2c/bitbang_i2c.c                               |    6 +-
 hw/i2c/bitbang_i2c.h                               |    2 +-
 hw/i2c/core.c                                      |   32 +-
 hw/i2c/exynos4210_i2c.c                            |    2 +-
 hw/i2c/omap_i2c.c                                  |    6 +-
 hw/i2c/pm_smbus.c                                  |    2 +-
 hw/i2c/smbus.c                                     |   18 +-
 hw/i2c/smbus_eeprom.c                              |    4 +-
 hw/i2c/smbus_ich9.c                                |    8 +-
 hw/i2c/versatile_i2c.c                             |    2 +-
 hw/i386/Makefile.objs                              |   29 +-
 hw/i386/acpi-build.c                               | 1558 +
 hw/i386/acpi-build.h                               |    9 +
 hw/i386/acpi-defs.h                                |  317 +
 hw/i386/acpi-dsdt-cpu-hotplug.dsl                  |  104 +
 hw/i386/acpi-dsdt-dbug.dsl                         |   41 +
 hw/i386/acpi-dsdt-hpet.dsl                         |   48 +
 hw/i386/acpi-dsdt-isa.dsl                          |  128 +
 hw/i386/acpi-dsdt-pci-crs.dsl                      |   92 +
 hw/i386/acpi-dsdt.dsl                              |  360 +
 hw/i386/acpi-dsdt.hex.generated                    | 4485 ++
 hw/i386/bios-linker-loader.c                       |  157 +
 hw/i386/bios-linker-loader.h                       |   27 +
 hw/i386/kvm/apic.c                                 |   16 +-
 hw/i386/kvm/clock.c                                |    5 +-
 hw/i386/kvm/i8254.c                                |   14 +-
 hw/i386/kvm/ioapic.c                               |    8 +-
 hw/i386/kvm/pci-assign.c                           |  102 +-
 hw/i386/kvmvapic.c                                 |   20 +-
 hw/i386/pc.c                                       |  159 +-
 hw/i386/pc_piix.c                                  |  328 +-
 hw/i386/pc_q35.c                                   |  160 +-
 hw/i386/pc_sysfw.c                                 |  110 +-
 hw/i386/q35-acpi-dsdt.dsl                          |  452 +
 hw/i386/q35-acpi-dsdt.hex.generated                | 7383 +++
 hw/i386/smbios.c                                   |  353 +-
 hw/i386/ssdt-misc.dsl                              |  119 +
 hw/i386/ssdt-misc.hex.generated                    |  386 +
 hw/i386/ssdt-pcihp.dsl                             |  100 +
 hw/i386/ssdt-pcihp.hex.generated                   |  251 +
 hw/i386/ssdt-proc.dsl                              |   63 +
 hw/i386/ssdt-proc.hex.generated                    |  134 +
 hw/i386/xen/Makefile.objs                          |    1 +
 hw/i386/xen/xen_apic.c                             |   97 +
 hw/i386/xen/xen_platform.c                         |  450 +
 hw/i386/xen/xen_pvdevice.c                         |  135 +
 hw/i386/xen_domainbuild.c                          |  299 -
 hw/i386/xen_domainbuild.h                          |   13 -
 hw/i386/xen_machine_pv.c                           |  110 -
 hw/ide/ahci.c                                      |   28 +-
 hw/ide/ahci.h                                      |   10 +-
 hw/ide/atapi.c                                     |   16 +-
 hw/ide/cmd646.c                                    |    4 +-
 hw/ide/core.c                                      |   60 +-
 hw/ide/ich.c                                       |    3 +-
 hw/ide/internal.h                                  |    5 +-
 hw/ide/isa.c                                       |    6 +-
 hw/ide/macio.c                                     |    2 +-
 hw/ide/microdrive.c                                |  226 +-
 hw/ide/mmio.c                                      |    2 +-
 hw/ide/pci.c                                       |    2 +-
 hw/ide/piix.c                                      |   12 +-
 hw/ide/qdev.c                                      |    7 +-
 hw/ide/via.c                                       |    3 +-
 hw/input/hid.c                                     |   10 +-
 hw/input/lm832x.c                                  |   30 +-
 hw/input/pckbd.c                                   |    3 +-
 hw/input/pxa2xx_keypad.c                           |    6 +-
 hw/input/tsc2005.c                                 |   16 +-
 hw/input/tsc210x.c                                 |   32 +-
 hw/input/vmmouse.c                                 |    3 +-
 hw/intc/Makefile.objs                              |    3 +
 hw/intc/allwinner-a10-pic.c                        |  200 +
 hw/intc/apic.c                                     |   73 +-
 hw/intc/apic_common.c                              |   88 +-
 hw/intc/arm_gic.c                                  |  224 +-
 hw/intc/arm_gic_common.c                           |   31 +-
 hw/intc/arm_gic_kvm.c                              |  447 +-
 hw/intc/armv7m_nvic.c                              |   16 +-
 hw/intc/etraxfs_pic.c                              |    4 +
 hw/intc/exynos4210_combiner.c                      |    2 +-
 hw/intc/gic_internal.h                             |  105 +-
 hw/intc/grlib_irqmp.c                              |    2 +
 hw/intc/i8259.c                                    |    4 +-
 hw/intc/i8259_common.c                             |   14 +-
 hw/intc/ioapic.c                                   |   16 +-
 hw/intc/ioapic_common.c                            |   16 +-
 hw/intc/omap_intc.c                                |    4 +
 hw/intc/openpic.c                                  |   14 +-
 hw/intc/openpic_kvm.c                              |   14 +-
 hw/intc/pl190.c                                    |    1 -
 hw/intc/realview_gic.c                             |   58 +-
 hw/intc/s390_flic.c                                |  322 +
 hw/intc/slavio_intctl.c                            |    2 +-
 hw/intc/xics.c                                     |  387 +-
 hw/intc/xics_kvm.c                                 |  503 +
 hw/intc/xilinx_intc.c                              |    3 +-
 hw/ipack/Makefile.objs                             |    2 +
 hw/ipack/ipack.c                                   |  120 +
 hw/ipack/tpci200.c                                 |  672 +
 hw/isa/isa-bus.c                                   |    1 -
 hw/isa/lpc_ich9.c                                  |   47 +-
 hw/isa/pc87312.c                                   |    2 +-
 hw/isa/piix4.c                                     |    8 +-
 hw/isa/vt82c686.c                                  |   12 +-
 hw/lm32/lm32_boards.c                              |   12 +-
 hw/lm32/lm32_hwsetup.h                             |    2 +-
 hw/lm32/milkymist.c                                |    9 +-
 hw/m68k/an5206.c                                   |    5 +-
 hw/m68k/dummy_m68k.c                               |    1 -
 hw/m68k/mcf5208.c                                  |    5 +-
 hw/microblaze/Makefile.objs                        |    1 -
 hw/microblaze/boot.c                               |   54 +-
 hw/microblaze/boot.h                               |    4 +-
 hw/microblaze/petalogix_ml605_mmu.c                |   74 +-
 hw/microblaze/petalogix_s3adsp1800_mmu.c           |   45 +-
 hw/microblaze/pic_cpu.c                            |   47 -
 hw/microblaze/pic_cpu.h                            |    8 -
 hw/mips/cputimer.c                                 |   16 +-
 hw/mips/gt64xxx_pci.c                              |    6 +
 hw/mips/mips_fulong2e.c                            |    3 +-
 hw/mips/mips_jazz.c                                |   26 +-
 hw/mips/mips_malta.c                               |   39 +-
 hw/mips/mips_mipssim.c                             |    5 +-
 hw/mips/mips_r4k.c                                 |    1 -
 hw/misc/Makefile.objs                              |    5 +-
 hw/misc/a9scu.c                                    |   25 +-
 hw/misc/applesmc.c                                 |    3 +-
 hw/misc/arm11scu.c                                 |  100 +
 hw/misc/arm_integrator_debug.c                     |   99 +
 hw/misc/arm_l2x0.c                                 |    1 -
 hw/misc/arm_sysctl.c                               |    6 +-
 hw/misc/debugexit.c                                |    4 +-
 hw/misc/eccmemctl.c                                |    2 +-
 hw/misc/exynos4210_pmu.c                           |    3 +-
 hw/misc/ivshmem.c                                  |    2 +-
 hw/misc/lm32_sys.c                                 |    8 +-
 hw/misc/macio/cuda.c                               |   38 +-
 hw/misc/macio/macio.c                              |   17 +-
 hw/misc/max111x.c                                  |   54 +-
 hw/misc/pvpanic.c                                  |   12 +-
 hw/misc/pxa2xx_pcmcia.c                            |  207 -
 hw/misc/tmp105.c                                   |    8 +-
 hw/misc/vfio.c                                     |  945 +-
 hw/misc/vmport.c                                   |    3 +-
 hw/misc/zynq_slcr.c                                |    5 +
 hw/moxie/moxiesim.c                                |    2 +-
 hw/net/Makefile.objs                               |    4 +
 hw/net/allwinner_emac.c                            |  539 +
 hw/net/cadence_gem.c                               |  278 +-
 hw/net/dp8393x.c                                   |   20 +-
 hw/net/e1000.c                                     |  244 +-
 hw/net/eepro100.c                                  |    4 +-
 hw/net/etraxfs_eth.c                               |    2 +
 hw/net/fsl_etsec/etsec.c                           |  465 +
 hw/net/fsl_etsec/etsec.h                           |  174 +
 hw/net/fsl_etsec/miim.c                            |  146 +
 hw/net/fsl_etsec/registers.c                       |  295 +
 hw/net/fsl_etsec/registers.h                       |  320 +
 hw/net/fsl_etsec/rings.c                           |  650 +
 hw/net/lan9118.c                                   |   10 +-
 hw/net/lance.c                                     |    2 +
 hw/net/ne2000-isa.c                                |    2 +-
 hw/net/ne2000.c                                    |    7 +-
 hw/net/opencores_eth.c                             |   33 +-
 hw/net/pcnet-pci.c                                 |    7 +-
 hw/net/pcnet.c                                     |   10 +-
 hw/net/rtl8139.c                                   |   37 +-
 hw/net/smc91c111.c                                 |    1 +
 hw/net/spapr_llan.c                                |    6 +
 hw/net/stellaris_enet.c                            |    3 +-
 hw/net/vhost_net.c                                 |    8 +-
 hw/net/virtio-net.c                                |  164 +-
 hw/net/vmware_utils.h                              |   16 +-
 hw/net/vmxnet3.c                                   |   93 +-
 hw/net/vmxnet3.h                                   |    2 -
 hw/net/xilinx_axienet.c                            |   37 +-
 hw/nvram/eeprom93xx.c                              |   62 +-
 hw/nvram/fw_cfg.c                                  |   40 +-
 hw/nvram/spapr_nvram.c                             |   17 +-
 hw/openrisc/cputimer.c                             |   35 +-
 hw/openrisc/openrisc_sim.c                         |    4 +-
 hw/openrisc/pic_cpu.c                              |   17 +-
 hw/pci-bridge/dec.c                                |    6 +
 hw/pci-bridge/pci_bridge_dev.c                     |   11 +-
 hw/pci-host/apb.c                                  |   16 +-
 hw/pci-host/bonito.c                               |    8 +-
 hw/pci-host/grackle.c                              |   10 +-
 hw/pci-host/pam.c                                  |    2 +-
 hw/pci-host/piix.c                                 |   84 +-
 hw/pci-host/ppce500.c                              |    5 +
 hw/pci-host/prep.c                                 |  248 +-
 hw/pci-host/q35.c                                  |   96 +-
 hw/pci-host/uninorth.c                             |   28 +-
 hw/pci-host/versatile.c                            |   10 +-
 hw/pci/Makefile.objs                               |    2 +-
 hw/pci/msi.c                                       |    2 +-
 hw/pci/msix.c                                      |    2 +-
 hw/pci/pci-hotplug-old.c                           |    6 +-
 hw/pci/pci.c                                       |  303 +-
 hw/pci/pci_bridge.c                                |    9 +-
 hw/pci/pci_host.c                                  |   14 +-
 hw/pci/pcie.c                                      |   75 +-
 hw/pci/pcie_aer.c                                  |    8 +-
 hw/pci/pcie_host.c                                 |   24 -
 hw/pci/pcie_port.c                                 |    8 +
 hw/pci/shpc.c                                      |  128 +-
 hw/pcmcia/Makefile.objs                            |    2 +
 hw/pcmcia/pcmcia.c                                 |   24 +
 hw/pcmcia/pxa2xx.c                                 |  285 +
 hw/ppc/Makefile.objs                               |    6 +-
 hw/ppc/e500.c                                      |  306 +-
 hw/ppc/e500.h                                      |   13 +-
 hw/ppc/e500plat.c                                  |   21 +-
 hw/ppc/mac.h                                       |    1 -
 hw/ppc/mac_newworld.c                              |    4 +-
 hw/ppc/mac_oldworld.c                              |    4 +-
 hw/ppc/mpc8544ds.c                                 |   21 +-
 hw/ppc/ppc.c                                       |  186 +-
 hw/ppc/ppc405_boards.c                             |   41 +-
 hw/ppc/ppc405_uc.c                                 |   71 +-
 hw/ppc/ppc440_bamboo.c                             |   32 +-
 hw/ppc/ppc4xx_devs.c                               |    4 +-
 hw/ppc/ppc4xx_pci.c                                |    5 +
 hw/ppc/ppc_booke.c                                 |   87 +-
 hw/ppc/ppce500_spin.c                              |    8 +-
 hw/ppc/prep.c                                      |  155 +-
 hw/ppc/spapr.c                                     |  331 +-
 hw/ppc/spapr_events.c                              |    6 +-
 hw/ppc/spapr_hcall.c                               |  221 +-
 hw/ppc/spapr_iommu.c                               |  108 +-
 hw/ppc/spapr_pci.c                                 |  232 +-
 hw/ppc/spapr_rtas.c                                |  134 +-
 hw/ppc/spapr_vio.c                                 |   17 +-
 hw/ppc/virtex_ml507.c                              |   97 +-
 hw/s390x/Makefile.objs                             |    1 +
 hw/s390x/css.c                                     |   23 +-
 hw/s390x/css.h                                     |    2 +
 hw/s390x/event-facility.c                          |  112 +-
 hw/s390x/ipl.c                                     |   39 +-
 hw/s390x/s390-virtio-bus.c                         |   66 +-
 hw/s390x/s390-virtio-ccw.c                         |   22 +-
 hw/s390x/s390-virtio-hcall.c                       |   14 +-
 hw/s390x/s390-virtio.c                             |   13 +-
 hw/s390x/sclp.c                                    |  122 +-
 hw/s390x/sclpcpu.c                                 |  112 +
 hw/s390x/sclpquiesce.c                             |   29 +-
 hw/s390x/virtio-ccw.c                              |  260 +-
 hw/s390x/virtio-ccw.h                              |    5 +-
 hw/scsi/esp-pci.c                                  |    5 +-
 hw/scsi/esp.c                                      |    2 +-
 hw/scsi/lsi53c895a.c                               |   55 +-
 hw/scsi/megasas.c                                  |   33 +-
 hw/scsi/scsi-bus.c                                 |   78 +-
 hw/scsi/scsi-disk.c                                |  239 +-
 hw/scsi/scsi-generic.c                             |    4 +-
 hw/scsi/spapr_vscsi.c                              |  266 +-
 hw/scsi/srp.h                                      |    7 +
 hw/scsi/vhost-scsi.c                               |   45 +-
 hw/scsi/virtio-scsi.c                              |   69 +-
 hw/scsi/vmw_pvscsi.c                               |   14 +-
 hw/sd/milkymist-memcard.c                          |    4 +
 hw/sd/omap_mmc.c                                   |    6 +
 hw/sd/pl181.c                                      |    5 +-
 hw/sd/pxa2xx_mmci.c                                |    3 +
 hw/sd/sd.c                                         |    5 +
 hw/sd/sdhci.c                                      |   36 +-
 hw/sd/ssi-sd.c                                     |   10 +-
 hw/sh4/r2d.c                                       |    5 +-
 hw/sh4/sh7750.c                                    |    2 +-
 hw/sh4/sh_pci.c                                    |    6 +
 hw/sh4/shix.c                                      |   17 +-
 hw/sparc/leon3.c                                   |    7 +-
 hw/sparc/sun4m.c                                   |  213 +-
 hw/sparc64/sun4u.c                                 |   82 +-
 hw/ssi/ssi.c                                       |   11 +-
 hw/ssi/xilinx_spips.c                              |    4 +-
 hw/timer/Makefile.objs                             |    4 +
 hw/timer/a9gtimer.c                                |  369 +
 hw/timer/allwinner-a10-pit.c                       |  254 +
 hw/timer/arm_mptimer.c                             |   73 +-
 hw/timer/arm_timer.c                               |    3 +
 hw/timer/cadence_ttc.c                             |    6 +-
 hw/timer/digic-timer.c                             |  163 +
 hw/timer/ds1338.c                                  |   21 +-
 hw/timer/etraxfs_timer.c                           |    2 +-
 hw/timer/exynos4210_mct.c                          |    3 +-
 hw/timer/exynos4210_pwm.c                          |    1 +
 hw/timer/exynos4210_rtc.c                          |    4 +-
 hw/timer/grlib_gptimer.c                           |    7 +-
 hw/timer/hpet.c                                    |   51 +-
 hw/timer/i8254.c                                   |   28 +-
 hw/timer/i8254_common.c                            |   11 +-
 hw/timer/imx_epit.c                                |   95 +-
 hw/timer/imx_gpt.c                                 |    1 +
 hw/timer/lm32_timer.c                              |    1 +
 hw/timer/m48t59.c                                  |   29 +-
 hw/timer/mc146818rtc.c                             |   76 +-
 hw/timer/omap_gptimer.c                            |   24 +-
 hw/timer/omap_synctimer.c                          |    2 +-
 hw/timer/pl031.c                                   |   20 +-
 hw/timer/puv3_ost.c                                |    1 +
 hw/timer/pxa2xx_timer.c                            |   34 +-
 hw/timer/sh_timer.c                                |    1 +
 hw/timer/slavio_timer.c                            |   26 +-
 hw/timer/tusb6010.c                                |   12 +-
 hw/timer/twl92230.c                                |   49 +-
 hw/timer/xilinx_timer.c                            |    1 +
 hw/tpm/tpm_tis.c                                   |    1 +
 hw/unicore32/puv3.c                                |    7 +-
 hw/usb/Makefile.objs                               |    5 +-
 hw/usb/bus.c                                       |   36 +-
 hw/usb/ccid-card-emulated.c                        |    8 +-
 hw/usb/combined-packet.c                           |    1 +
 hw/usb/core.c                                      |   25 +
 hw/usb/desc-msos.c                                 |  234 +
 hw/usb/desc.c                                      |   51 +-
 hw/usb/desc.h                                      |   22 +-
 hw/usb/dev-audio.c                                 |    2 +-
 hw/usb/dev-bluetooth.c                             |   12 +-
 hw/usb/dev-hid.c                                   |   16 +-
 hw/usb/dev-hub.c                                   |    4 +-
 hw/usb/dev-network.c                               |    7 +-
 hw/usb/dev-serial.c                                |    2 +-
 hw/usb/dev-smartcard-reader.c                      |    6 +-
 hw/usb/dev-storage.c                               |   14 +-
 hw/usb/dev-uas.c                                   |  178 +-
 hw/usb/dev-wacom.c                                 |    2 +-
 hw/usb/hcd-ehci-pci.c                              |    4 +-
 hw/usb/hcd-ehci.c                                  |   31 +-
 hw/usb/hcd-ehci.h                                  |    1 -
 hw/usb/hcd-musb.c                                  |    8 +-
 hw/usb/hcd-ohci.c                                  |   52 +-
 hw/usb/hcd-uhci.c                                  |   27 +-
 hw/usb/hcd-xhci.c                                  |  391 +-
 hw/usb/host-bsd.c                                  |  639 -
 hw/usb/host-legacy.c                               |    2 +-
 hw/usb/host-libusb.c                               |   36 +-
 hw/usb/host-linux.c                                | 1911 -
 hw/usb/redirect.c                                  |   16 +-
 hw/virtio/dataplane/Makefile.objs                  |    2 +-
 hw/virtio/dataplane/hostmem.c                      |  183 -
 hw/virtio/dataplane/vring.c                        |  253 +-
 hw/virtio/virtio-balloon.c                         |   47 +-
 hw/virtio/virtio-bus.c                             |   82 +-
 hw/virtio/virtio-mmio.c                            |   19 +-
 hw/virtio/virtio-pci.c                             |  162 +-
 hw/virtio/virtio-pci.h                             |    1 -
 hw/virtio/virtio-rng.c                             |   75 +-
 hw/virtio/virtio.c                                 |   73 +-
 hw/watchdog/watchdog.c                             |    3 +-
 hw/watchdog/wdt_i6300esb.c                         |    6 +-
 hw/watchdog/wdt_ib700.c                            |   10 +-
 hw/xen/Makefile.objs                               |    1 -
 hw/xen/xen_apic.c                                  |   95 -
 hw/xen/xen_backend.c                               |   19 +-
 hw/xen/xen_platform.c                              |  449 -
 hw/xen/xen_pt.c                                    |    7 +-
 hw/xen/xen_pt_config_init.c                        |    6 +-
 hw/xen/xen_pt_msi.c                                |    6 +-
 hw/xen/xen_pvdevice.c                              |  131 -
 hw/xenpv/Makefile.objs                             |    2 +
 hw/xenpv/xen_domainbuild.c                         |  299 +
 hw/xenpv/xen_domainbuild.h                         |   13 +
 hw/xenpv/xen_machine_pv.c                          |  109 +
 hw/xtensa/pic_cpu.c                                |   10 +-
 hw/xtensa/xtensa_lx60.c                            |   53 +-
 hw/xtensa/xtensa_sim.c                             |    1 -
 include/block/aio.h                                |   82 +-
 include/block/block.h                              |  148 +-
 include/block/block_int.h                          |  169 +-
 include/block/blockjob.h                           |   16 +-
 include/block/coroutine.h                          |   19 +-
 include/block/nbd.h                                |    6 -
 include/block/qapi.h                               |    3 +
 include/block/snapshot.h                           |   29 +-
 include/disas/bfd.h                                |    1 +
 include/elf.h                                      |   76 +
 include/exec/cpu-all.h                             |   29 +-
 include/exec/cpu-common.h                          |   45 +-
 include/exec/cpu-defs.h                            |   64 +-
 include/exec/cputlb.h                              |    6 +-
 include/exec/def-helper.h                          |    3 +-
 include/exec/exec-all.h                            |  153 +-
 include/exec/gen-icount.h                          |   14 +-
 include/exec/ioport.h                              |    2 +
 include/exec/memory-internal.h                     |   90 -
 include/exec/memory.h                              |   24 +-
 include/exec/ram_addr.h                            |  150 +
 include/exec/softmmu_defs.h                        |   37 -
 include/exec/softmmu_exec.h                        |    3 +-
 include/exec/softmmu_template.h                    |  609 +-
 include/exec/user/abitypes.h                       |    4 -
 include/fpu/softfloat.h                            |  111 +-
 include/hw/acpi/acpi.h                             |   15 +-
 include/hw/acpi/cpu_hotplug.h                      |   27 +
 include/hw/acpi/cpu_hotplug_defs.h                 |   32 +
 include/hw/acpi/ich9.h                             |    6 +
 include/hw/acpi/pcihp.h                            |   75 +
 include/hw/acpi/piix4.h                            |    8 +
 include/hw/arm/allwinner-a10.h                     |   38 +
 include/hw/arm/arm.h                               |   12 +-
 include/hw/arm/digic.h                             |   43 +
 include/hw/arm/exynos4210.h                        |    2 +-
 include/hw/arm/omap.h                              |    2 +-
 include/hw/arm/pxa.h                               |   12 +-
 include/hw/block/block.h                           |    6 -
 include/hw/boards.h                                |   71 +-
 include/hw/bt.h                                    |   11 +-
 include/hw/char/digic-uart.h                       |   47 +
 include/hw/char/serial.h                           |    4 +-
 include/hw/cpu/a15mpcore.h                         |   44 +
 include/hw/cpu/a9mpcore.h                          |   39 +
 include/hw/cpu/arm11mpcore.h                       |   35 +
 include/hw/cpu/icc_bus.h                           |    2 +-
 include/hw/cris/etraxfs.h                          |    2 -
 include/hw/elf_ops.h                               |   19 +-
 include/hw/fw-path-provider.h                      |   48 +
 include/hw/hotplug.h                               |   78 +
 include/hw/i2c/i2c.h                               |   20 +-
 include/hw/i2c/pm_smbus.h                          |    2 +-
 include/hw/i2c/smbus.h                             |   20 +-
 include/hw/i386/apic_internal.h                    |    2 +-
 include/hw/i386/ich9.h                             |    6 +-
 include/hw/i386/ioapic_internal.h                  |    3 +-
 include/hw/i386/pc.h                               |  114 +-
 include/hw/i386/smbios.h                           |    7 +-
 include/hw/ide.h                                   |    1 +
 include/hw/intc/allwinner-a10-pic.h                |   40 +
 include/hw/intc/arm_gic.h                          |   42 +
 include/hw/intc/arm_gic_common.h                   |  127 +
 include/hw/intc/realview_gic.h                     |   28 +
 include/hw/ipack/ipack.h                           |   87 +
 include/hw/irq.h                                   |    7 +
 include/hw/isa/isa.h                               |    9 +-
 include/hw/isa/vt82c686.h                          |    4 +-
 include/hw/loader.h                                |   28 +-
 include/hw/misc/a9scu.h                            |   31 +
 include/hw/misc/arm11scu.h                         |   29 +
 include/hw/misc/arm_integrator_debug.h             |   18 +
 include/hw/net/allwinner_emac.h                    |  210 +
 include/hw/nvram/fw_cfg.h                          |    8 +-
 include/hw/nvram/openbios_firmware_abi.h           |    2 +
 include/hw/pci-host/q35.h                          |   30 +-
 include/hw/pci-host/spapr.h                        |    8 +-
 include/hw/pci/pci.h                               |   66 +-
 include/hw/pci/pci_bus.h                           |    2 -
 include/hw/pci/pci_ids.h                           |    2 +-
 include/hw/pci/pcie.h                              |   23 +-
 include/hw/pci/pcie_host.h                         |   27 +
 include/hw/pci/shpc.h                              |    8 +
 include/hw/pcmcia.h                                |   46 +-
 include/hw/ppc/ppc.h                               |    7 +-
 include/hw/ppc/spapr.h                             |   46 +-
 include/hw/ppc/xics.h                              |   57 +
 include/hw/ptimer.h                                |   14 +-
 include/hw/qdev-core.h                             |   73 +-
 include/hw/qdev-dma.h                              |    2 +-
 include/hw/qdev-properties.h                       |   42 +-
 include/hw/s390x/ebcdic.h                          |  104 +
 include/hw/s390x/event-facility.h                  |  112 +-
 include/hw/s390x/s390_flic.h                       |   33 +
 include/hw/s390x/sclp.h                            |   99 +-
 include/hw/scsi/scsi.h                             |   13 +-
 include/hw/ssi.h                                   |    3 +-
 include/hw/sysbus.h                                |    2 +-
 include/hw/timer/a9gtimer.h                        |   97 +
 include/hw/timer/allwinner-a10-pit.h               |   58 +
 include/hw/timer/arm_mptimer.h                     |   54 +
 include/hw/timer/digic-timer.h                     |   46 +
 include/hw/timer/hpet.h                            |   10 +
 include/hw/usb.h                                   |   46 +-
 include/hw/virtio/dataplane/hostmem.h              |   58 -
 include/hw/virtio/dataplane/vring.h                |   10 +-
 include/hw/virtio/virtio-blk.h                     |    8 +-
 include/hw/virtio/virtio-bus.h                     |   22 +-
 include/hw/virtio/virtio-rng.h                     |    2 +
 include/hw/virtio/virtio-scsi.h                    |    4 +-
 include/hw/virtio/virtio-serial.h                  |    8 +-
 include/hw/virtio/virtio.h                         |    8 +-
 include/hw/xen/xen.h                               |    2 +-
 include/hw/xen/xen_common.h                        |    7 +
 include/hw/xilinx.h                                |   96 -
 include/migration/migration.h                      |   12 +
 include/migration/page_cache.h                     |    4 +-
 include/migration/qemu-file.h                      |    4 +
 include/migration/vmstate.h                        |   40 +-
 include/monitor/monitor.h                          |    8 +-
 include/monitor/readline.h                         |   55 -
 include/net/checksum.h                             |    1 +
 include/net/eth.h                                  |    6 +-
 include/net/net.h                                  |   21 +-
 include/net/tap.h                                  |    6 -
 include/qapi/error.h                               |   19 +
 include/qapi/opts-visitor.h                        |    6 +
 include/qapi/qmp/dispatch.h                        |    7 +-
 include/qapi/qmp/qdict.h                           |    3 +
 include/qapi/qmp/qerror.h                          |    5 +-
 include/qapi/qmp/qjson.h                           |    2 +-
 include/qapi/string-output-visitor.h               |    2 +-
 include/qapi/visitor.h                             |    3 +-
 include/qemu-common.h                              |   17 +-
 include/qemu-io.h                                  |    5 +
 include/qemu/atomic.h                              |    6 +-
 include/qemu/bitmap.h                              |   86 +-
 include/qemu/bitops.h                              |   14 +-
 include/qemu/bswap.h                               |   59 +-
 include/qemu/cache-utils.h                         |    4 +-
 include/qemu/config-file.h                         |    7 +
 include/qemu/crc32c.h                              |    4 +-
 include/qemu/fifo8.h                               |   61 +
 include/qemu/host-utils.h                          |   62 +-
 include/qemu/module.h                              |   23 +-
 include/qemu/option.h                              |    5 +-
 include/qemu/osdep.h                               |   36 +
 include/qemu/range.h                               |   20 +-
 include/qemu/ratelimit.h                           |    2 +-
 include/qemu/readline.h                            |   63 +
 include/qemu/rfifolock.h                           |   54 +
 include/qemu/seqlock.h                             |   72 +
 include/qemu/sockets.h                             |    1 +
 include/qemu/thread-posix.h                        |    8 +
 include/qemu/thread-win32.h                        |    4 +
 include/qemu/thread.h                              |   10 +-
 include/qemu/throttle.h                            |  110 +
 include/qemu/timer.h                               |  727 +-
 include/qemu/typedefs.h                            |   10 +-
 include/qom/cpu.h                                  |  153 +-
 include/qom/object.h                               |  161 +-
 include/qom/object_interfaces.h                    |   62 +
 include/sysemu/arch_init.h                         |    2 +-
 include/sysemu/blockdev.h                          |    3 +-
 include/sysemu/char.h                              |   10 +
 include/sysemu/device_tree.h                       |   80 +-
 include/sysemu/dump.h                              |  138 +
 include/sysemu/iothread.h                          |   40 +
 include/sysemu/kvm.h                               |   73 +-
 include/sysemu/qtest.h                             |   28 +-
 include/sysemu/rng.h                               |   11 -
 include/sysemu/sysemu.h                            |   17 +-
 include/ui/console.h                               |   36 +-
 include/ui/input.h                                 |   56 +
 include/ui/qemu-spice.h                            |    7 +-
 ioport.c                                           |    9 +
 iothread.c                                         |  167 +
 kvm-all.c                                          |  285 +-
 kvm-stub.c                                         |    6 +-
 libcacard/Makefile                                 |    5 +-
 libcacard/cac.c                                    |    1 -
 libcacard/card_7816.c                              |    2 +-
 libcacard/card_7816t.h                             |    2 +-
 libcacard/vcard_emul_nss.c                         |    1 -
 libcacard/vscclient.c                              |   19 +-
 linux-headers/asm-arm/kvm.h                        |   31 +-
 linux-headers/asm-arm64/kvm.h                      |  196 +
 linux-headers/asm-arm64/kvm_para.h                 |    1 +
 linux-headers/asm-mips/kvm.h                       |   81 +-
 linux-headers/asm-powerpc/kvm.h                    |   89 +-
 linux-headers/asm-s390/kvm.h                       |   19 +
 linux-headers/asm-x86/hyperv.h                     |   32 +
 linux-headers/asm-x86/kvm.h                        |    6 +-
 linux-headers/asm-x86/kvm_para.h                   |    1 +
 linux-headers/linux/kvm.h                          |   83 +
 linux-headers/linux/kvm_para.h                     |    1 +
 linux-headers/linux/vfio.h                         |   80 +-
 linux-headers/linux/virtio_config.h                |    3 +
 linux-user/aarch64/syscall.h                       |   10 +
 linux-user/aarch64/syscall_nr.h                    |  323 +
 linux-user/aarch64/target_cpu.h                    |   38 +
 linux-user/aarch64/target_signal.h                 |   29 +
 linux-user/aarch64/target_structs.h                |   58 +
 linux-user/aarch64/termbits.h                      |  220 +
 linux-user/alpha/syscall.h                         |    1 +
 linux-user/alpha/syscall_nr.h                      |   11 +-
 linux-user/alpha/target_structs.h                  |   48 +
 linux-user/arm/syscall.h                           |    1 +
 linux-user/arm/syscall_nr.h                        |    6 +
 linux-user/arm/target_cpu.h                        |    2 +-
 linux-user/arm/target_structs.h                    |   52 +
 linux-user/cpu-uname.c                             |    3 +-
 linux-user/cris/syscall.h                          |    2 +-
 linux-user/cris/syscall_nr.h                       |    1 +
 linux-user/cris/target_structs.h                   |   58 +
 linux-user/elfload.c                               |   53 +-
 linux-user/flatload.c                              |    5 +-
 linux-user/i386/syscall.h                          |    1 +
 linux-user/i386/syscall_nr.h                       |    6 +
 linux-user/i386/target_structs.h                   |   58 +
 linux-user/ioctls.h                                |    2 +
 linux-user/linuxload.c                             |   15 +-
 linux-user/m68k-sim.c                              |    3 +-
 linux-user/m68k/syscall.h                          |    2 +-
 linux-user/m68k/syscall_nr.h                       |    5 +
 linux-user/m68k/target_cpu.h                       |    4 +-
 linux-user/m68k/target_structs.h                   |   58 +
 linux-user/main.c                                  |  478 +-
 linux-user/microblaze/syscall.h                    |    2 +-
 linux-user/microblaze/syscall_nr.h                 |    7 +-
 linux-user/microblaze/target_structs.h             |   58 +
 linux-user/mips/syscall.h                          |    1 +
 linux-user/mips/syscall_nr.h                       |    6 +
 linux-user/mips/target_structs.h                   |   48 +
 linux-user/mips64/syscall.h                        |    1 +
 linux-user/mips64/syscall_nr.h                     |   13 +
 linux-user/mips64/target_cpu.h                     |   18 +
 linux-user/mips64/target_structs.h                 |    2 +
 linux-user/openrisc/syscall.h                      |    1 +
 linux-user/openrisc/syscall_nr.h                   |    6 +-
 linux-user/openrisc/target_structs.h               |   58 +
 linux-user/ppc/syscall.h                           |    1 +
 linux-user/ppc/syscall_nr.h                        |    6 +
 linux-user/ppc/target_structs.h                    |   60 +
 linux-user/qemu.h                                  |   22 +-
 linux-user/s390x/syscall.h                         |    3 +-
 linux-user/s390x/syscall_nr.h                      |    7 +-
 linux-user/s390x/target_structs.h                  |   63 +
 linux-user/sh4/syscall.h                           |    1 +
 linux-user/sh4/syscall_nr.h                        |    6 +
 linux-user/sh4/target_structs.h                    |   58 +
 linux-user/signal.c                                |  435 +-
 linux-user/sparc/syscall.h                         |    1 +
 linux-user/sparc/syscall_nr.h                      |    7 +
 linux-user/sparc/target_structs.h                  |   63 +
 linux-user/sparc64/syscall.h                       |    1 +
 linux-user/sparc64/syscall_nr.h                    |    7 +
 linux-user/sparc64/target_structs.h                |   58 +
 linux-user/strace.list                             |    9 +-
 linux-user/syscall.c                               | 1163 +-
 linux-user/syscall_defs.h                          |   92 +-
 linux-user/syscall_types.h                         |   13 +
 linux-user/unicore32/syscall.h                     |    1 +
 linux-user/unicore32/target_structs.h              |   58 +
 linux-user/vm86.c                                  |   27 +-
 linux-user/x86_64/syscall.h                        |    1 +
 linux-user/x86_64/syscall_nr.h                     |    7 +
 linux-user/x86_64/target_structs.h                 |   58 +
 main-loop.c                                        |   72 +-
 memory.c                                           |   24 +-
 memory_mapping.c                                   |    5 +-
 migration-exec.c                                   |    1 +
 migration-fd.c                                     |    1 +
 migration-rdma.c                                   |   25 +-
 migration-tcp.c                                    |    1 +
 migration-unix.c                                   |    1 +
 migration.c                                        |  115 +-
 module-common.c                                    |   10 +
 monitor.c                                          |  659 +-
 nbd.c                                              |   74 +-
 net/Makefile.objs                                  |    1 +
 net/clients.h                                      |    5 +
 net/dump.c                                         |    2 +-
 net/hub.c                                          |    2 +-
 net/net.c                                          |  128 +-
 net/netmap.c                                       |  472 +
 net/slirp.c                                        |    6 +-
 net/socket.c                                       |   20 +-
 net/tap-linux.c                                    |   14 +-
 net/tap-win32.c                                    |   92 +-
 net/tap.c                                          |   27 +-
 os-posix.c                                         |   46 +-
 os-win32.c                                         |   21 +-
 page_cache.c                                       |   34 +-
 pc-bios/QEMU,cgthree.bin                           |  Bin 0 -> 850 bytes
 pc-bios/QEMU,tcx.bin                               |  Bin 0 -> 1410 bytes
 pc-bios/README                                     |   10 +-
 pc-bios/acpi-dsdt.aml                              |  Bin 4407 -> 4407 bytes
 pc-bios/bios-256k.bin                              |  Bin 0 -> 262144 bytes
 pc-bios/bios.bin                                   |  Bin 131072 -> 131072 bytes
 pc-bios/keymaps/cz                                 |   94 +
 pc-bios/kvmvapic.bin                               |  Bin 9216 -> 9216 bytes
 pc-bios/multiboot.bin                              |  Bin 1024 -> 1024 bytes
 pc-bios/ohw.diff                                   | 1843 -
 pc-bios/openbios-ppc                               |  Bin 733976 -> 734008 bytes
 pc-bios/openbios-sparc32                           |  Bin 381484 -> 381512 bytes
 pc-bios/openbios-sparc64                           |  Bin 1598328 -> 1598376 bytes
 pc-bios/optionrom/Makefile                         |    3 +-
 pc-bios/ppc_rom.bin                                |  Bin 524288 -> 1048576 bytes
 pc-bios/q35-acpi-dsdt.aml                          |  Bin 7344 -> 7344 bytes
 pc-bios/s390-ccw.img                               |  Bin 9432 -> 9336 bytes
 pc-bios/s390-ccw/main.c                            |    3 +-
 pc-bios/s390-ccw/virtio.c                          |    8 +-
 pc-bios/s390-ccw/virtio.h                          |    1 +
 pc-bios/sgabios.bin                                |  Bin 4096 -> 4096 bytes
 pc-bios/slof.bin                                   |  Bin 909720 -> 921720 bytes
 pc-bios/vgabios-cirrus.bin                         |  Bin 35840 -> 36864 bytes
 pc-bios/vgabios-qxl.bin                            |  Bin 40448 -> 37376 bytes
 pc-bios/vgabios-stdvga.bin                         |  Bin 40448 -> 37376 bytes
 pc-bios/vgabios-vmware.bin                         |  Bin 40448 -> 37376 bytes
 pc-bios/vgabios.bin                                |  Bin 40448 -> 36864 bytes
 qapi-schema.json                                   |  982 +-
 qapi/opts-visitor.c                                |  188 +-
 qapi/qapi-dealloc-visitor.c                        |    4 +-
 qapi/qmp-registry.c                                |   33 +-
 qapi/string-input-visitor.c                        |   24 +
 qapi/string-output-visitor.c                       |   56 +-
 qdev-monitor.c                                     |  178 +-
 qemu-char.c                                        |   63 +-
 qemu-coroutine-io.c                                |    1 +
 qemu-coroutine-lock.c                              |    8 -
 qemu-coroutine-sleep.c                             |   24 +-
 qemu-doc.texi                                      |   57 +-
 qemu-file.c                                        |  835 +
 qemu-img-cmds.hx                                   |   16 +-
 qemu-img.c                                         |  739 +-
 qemu-img.texi                                      |  139 +-
 qemu-io-cmds.c                                     |   95 +-
 qemu-io.c                                          |  192 +-
 qemu-nbd.c                                         |  124 +-
 qemu-nbd.texi                                      |   10 +-
 qemu-options.hx                                    |   49 +-
 qemu-seccomp.c                                     |    9 +-
 qemu-timer.c                                       |  931 +-
 qemu.nsi                                           |    8 +-
 qemu.sasl                                          |    4 +-
 qga/Makefile.objs                                  |    3 +
 qga/channel-win32.c                                |   20 +-
 qga/commands-posix.c                               |   67 +-
 qga/commands-win32.c                               |  120 +-
 qga/commands.c                                     |   39 +-
 qga/guest-agent-core.h                             |    2 +-
 qga/main.c                                         |  103 +-
 qga/qapi-schema.json                               |   14 +-
 qga/vss-win32.c                                    |  166 +
 qga/vss-win32.h                                    |   27 +
 qga/vss-win32/Makefile.objs                        |   23 +
 qga/vss-win32/install.cpp                          |  465 +
 qga/vss-win32/provider.cpp                         |  534 +
 qga/vss-win32/qga-vss.def                          |   13 +
 qga/vss-win32/qga-vss.idl                          |   20 +
 qga/vss-win32/qga-vss.tlb                          |  Bin 0 -> 1528 bytes
 qga/vss-win32/requester.cpp                        |  503 +
 qga/vss-win32/requester.h                          |   43 +
 qga/vss-win32/vss-common.h                         |  129 +
 qmp-commands.hx                                    |  494 +-
 qmp.c                                              |   99 +-
 qobject/qdict.c                                    |  158 +-
 qobject/qerror.c                                   |   12 +-
 qom/Makefile.objs                                  |    1 +
 qom/cpu.c                                          |  114 +-
 qom/object.c                                       |  350 +-
 qom/object_interfaces.c                            |   32 +
 qtest.c                                            |   47 +-
 readline.c                                         |  494 -
 roms/Makefile                                      |  102 +-
 roms/SLOF                                          |    2 +-
 roms/config.seabios                                |    1 -
 roms/config.seabios-128k                           |    6 +
 roms/config.seabios-256k                           |    3 +
 roms/config.vga-cirrus                             |    3 +
 roms/config.vga-isavga                             |    3 +
 roms/config.vga-qxl                                |    6 +
 roms/config.vga-stdvga                             |    3 +
 roms/config.vga-vmware                             |    6 +
 roms/config.vga.cirrus                             |    3 -
 roms/config.vga.isavga                             |    3 -
 roms/config.vga.qxl                                |    6 -
 roms/config.vga.stdvga                             |    3 -
 roms/config.vga.vmware                             |    6 -
 roms/openbios                                      |    2 +-
 roms/openhackware                                  |    1 +
 roms/seabios                                       |    2 +-
 rules.mak                                          |  129 +-
 savevm.c                                           | 1643 +-
 scripts/acpi_extract.py                            |  362 +
 scripts/acpi_extract_preprocess.py                 |   51 +
 scripts/checkpatch.pl                              |   34 +-
 scripts/create_config                              |    7 +
 scripts/disas-objdump.pl                           |   99 +
 scripts/dump-guest-memory.py                       |  339 +
 scripts/extract-vsssdk-headers                     |   35 +
 scripts/get_maintainer.pl                          |    2 +-
 scripts/make-release                               |    3 +-
 scripts/qapi-commands.py                           |   24 +-
 scripts/qapi-types.py                              |   70 +-
 scripts/qapi-visit.py                              |   84 +-
 scripts/qapi.py                                    |  197 +-
 scripts/qemu-binfmt-conf.sh                        |    3 +
 scripts/qmp/qemu-ga-client                         |  301 +
 scripts/qmp/qmp                                    |  126 +
 scripts/qmp/qmp-shell                              |  305 +
 scripts/qmp/qmp.py                                 |  201 +
 scripts/qmp/qom-fuse                               |  138 +
 scripts/qmp/qom-get                                |   67 +
 scripts/qmp/qom-list                               |   64 +
 scripts/qmp/qom-set                                |   64 +
 scripts/refresh-pxe-roms.sh                        |   80 +-
 scripts/switch-timer-api                           |  178 +
 scripts/tracetool/backend/simple.py                |    6 +-
 scripts/tracetool/backend/ust.py                   |  101 +-
 scripts/tracetool/format/ust_events_c.py           |   30 +
 scripts/tracetool/format/ust_events_h.py           |   57 +
 scripts/update-acpi.sh                             |    4 +
 slirp/arp_table.c                                  |    4 +-
 slirp/if.c                                         |    4 +-
 slirp/libslirp.h                                   |    3 +-
 slirp/misc.c                                       |    4 +-
 slirp/slirp.c                                      |   65 +-
 slirp/slirp.h                                      |    3 +
 slirp/socket.c                                     |    2 +-
 slirp/tcp_subr.c                                   |    6 +-
 slirp/tftp.c                                       |    2 +-
 slirp/udp.c                                        |    4 +-
 spice-qemu-char.c                                  |   36 +-
 stubs/Makefile.objs                                |    4 +
 stubs/clock-warp.c                                 |    2 +-
 stubs/gdbstub.c                                    |    4 +-
 stubs/kvm.c                                        |    7 +
 stubs/qtest.c                                      |   14 +
 stubs/runstate-check.c                             |    6 +
 stubs/slirp.c                                      |    6 +-
 stubs/uuid.c                                       |   12 +
 target-alpha/cpu-qom.h                             |    2 +-
 target-alpha/cpu.c                                 |   26 +-
 target-alpha/cpu.h                                 |   20 +-
 target-alpha/helper.c                              |   45 +-
 target-alpha/helper.h                              |   12 +-
 target-alpha/mem_helper.c                          |   52 +-
 target-alpha/sys_helper.c                          |   33 +-
 target-alpha/translate.c                           |  156 +-
 target-arm/Makefile.objs                           |    6 +-
 target-arm/arm-semi.c                              |    9 +-
 target-arm/cpu-qom.h                               |   50 +
 target-arm/cpu.c                                   |  240 +-
 target-arm/cpu.h                                   |  583 +-
 target-arm/cpu64.c                                 |  133 +
 target-arm/crypto_helper.c                         |  281 +
 target-arm/gdbstub64.c                             |   73 +
 target-arm/helper-a64.c                            |  438 +
 target-arm/helper-a64.h                            |   48 +
 target-arm/helper.c                                | 2440 +-
 target-arm/helper.h                                |  105 +-
 target-arm/kvm-consts.h                            |  115 +
 target-arm/kvm.c                                   |  527 +-
 target-arm/kvm32.c                                 |  515 +
 target-arm/kvm64.c                                 |  204 +
 target-arm/kvm_arm.h                               |   72 +-
 target-arm/machine.c                               |   24 +-
 target-arm/neon_helper.c                           |  217 +-
 target-arm/op_helper.c                             |  113 +-
 target-arm/translate-a64.c                         |10448 ++++
 target-arm/translate.c                             | 1272 +-
 target-arm/translate.h                             |   80 +
 target-cris/cpu.c                                  |   53 +-
 target-cris/cpu.h                                  |   16 +-
 target-cris/helper.c                               |   51 +-
 target-cris/helper.h                               |    8 +-
 target-cris/mmu.c                                  |    3 +-
 target-cris/op_helper.c                            |   28 +-
 target-cris/translate.c                            |   55 +-
 target-cris/translate_v10.c                        |   16 +-
 target-i386/Makefile.objs                          |    4 +-
 target-i386/arch_memory_mapping.c                  |   48 +-
 target-i386/cc_helper.c                            |    2 +-
 target-i386/cpu-qom.h                              |   29 +
 target-i386/cpu.c                                  |  834 +-
 target-i386/cpu.h                                  |  579 +-
 target-i386/excp_helper.c                          |    6 +-
 target-i386/fpu_helper.c                           |   15 +-
 target-i386/gdbstub.c                              |    2 +-
 target-i386/helper.c                               |  159 +-
 target-i386/helper.h                               |    1 +
 target-i386/hyperv.c                               |   64 -
 target-i386/hyperv.h                               |   45 -
 target-i386/kvm-stub.c                             |   12 +
 target-i386/kvm.c                                  |  377 +-
 target-i386/machine.c                              |  197 +-
 target-i386/mem_helper.c                           |   16 +-
 target-i386/misc_helper.c                          |   46 +-
 target-i386/seg_helper.c                           |   32 +-
 target-i386/smm_helper.c                           |  300 +-
 target-i386/svm_helper.c                           |  326 +-
 target-i386/translate.c                            | 2815 +-
 target-lm32/TODO                                   |    2 -
 target-lm32/cpu-qom.h                              |    6 +
 target-lm32/cpu.c                                  |  202 +-
 target-lm32/cpu.h                                  |   43 +-
 target-lm32/helper.c                               |  256 +-
 target-lm32/helper.h                               |    4 +
 target-lm32/op_helper.c                            |   98 +-
 target-lm32/translate.c                            |  200 +-
 target-m68k/cpu.c                                  |   14 +-
 target-m68k/cpu.h                                  |    9 +-
 target-m68k/helper.c                               |   26 +-
 target-m68k/helper.h                               |   54 +
 target-m68k/helpers.h                              |   54 -
 target-m68k/m68k-semi.c                            |    5 +-
 target-m68k/op_helper.c                            |   36 +-
 target-m68k/qregs.def                              |    1 -
 target-m68k/translate.c                            |   56 +-
 target-microblaze/cpu.c                            |   35 +-
 target-microblaze/cpu.h                            |   13 +-
 target-microblaze/helper.c                         |   34 +-
 target-microblaze/mmu.c                            |    6 +-
 target-microblaze/op_helper.c                      |   19 +-
 target-microblaze/translate.c                      |  292 +-
 target-mips/cpu.c                                  |   38 +-
 target-mips/cpu.h                                  |   51 +-
 target-mips/dsp_helper.c                           |   30 +-
 target-mips/helper.c                               |   66 +-
 target-mips/helper.h                               |   16 +-
 target-mips/machine.c                              |    3 +-
 target-mips/mips-defs.h                            |    8 +
 target-mips/op_helper.c                            |   99 +-
 target-mips/translate.c                            |  252 +-
 target-mips/translate_init.c                       |   65 +-
 target-moxie/cpu.c                                 |   28 +-
 target-moxie/cpu.h                                 |    7 +-
 target-moxie/helper.c                              |   52 +-
 target-moxie/translate.c                           |    6 +-
 target-openrisc/cpu.c                              |   35 +-
 target-openrisc/cpu.h                              |   13 +-
 target-openrisc/exception.c                        |    6 +-
 target-openrisc/interrupt.c                        |   37 +-
 target-openrisc/interrupt_helper.c                 |    2 +-
 target-openrisc/mmu.c                              |   30 +-
 target-openrisc/mmu_helper.c                       |    8 +-
 target-openrisc/sys_helper.c                       |   60 +-
 target-openrisc/translate.c                        |  205 +-
 target-ppc/Makefile.objs                           |    4 +-
 target-ppc/STATUS                                  |    9 -
 target-ppc/arch_dump.c                             |  253 +
 target-ppc/cpu-models.c                            |    5 +-
 target-ppc/cpu-models.h                            |    8 +-
 target-ppc/cpu-qom.h                               |   17 +-
 target-ppc/cpu.h                                   |   87 +-
 target-ppc/excp_helper.c                           |   99 +-
 target-ppc/fpu_helper.c                            | 1312 +-
 target-ppc/helper.h                                |  217 +-
 target-ppc/helper_regs.h                           |    6 +-
 target-ppc/int_helper.c                            | 1411 +-
 target-ppc/kvm.c                                   |  202 +-
 target-ppc/kvm_ppc.c                               |    7 +-
 target-ppc/kvm_ppc.h                               |   36 +-
 target-ppc/machine.c                               |   17 +-
 target-ppc/mem_helper.c                            |    2 +
 target-ppc/misc_helper.c                           |    8 +-
 target-ppc/mmu-hash32.c                            |   35 +-
 target-ppc/mmu-hash32.h                            |   18 +-
 target-ppc/mmu-hash64.c                            |  145 +-
 target-ppc/mmu-hash64.h                            |   47 +-
 target-ppc/mmu_helper.c                            |  215 +-
 target-ppc/translate.c                             | 1834 +-
 target-ppc/translate_init.c                        |  503 +-
 target-ppc/user_only_helper.c                      |    8 +-
 target-s390x/arch_dump.c                           |    7 +-
 target-s390x/cc_helper.c                           |    5 +-
 target-s390x/cpu-qom.h                             |    6 +
 target-s390x/cpu.c                                 |   89 +-
 target-s390x/cpu.h                                 |   70 +-
 target-s390x/fpu_helper.c                          |    4 +-
 target-s390x/helper.c                              |   96 +-
 target-s390x/int_helper.c                          |    3 +-
 target-s390x/ioinst.c                              |  111 +-
 target-s390x/ioinst.h                              |   28 +-
 target-s390x/kvm.c                                 |  564 +-
 target-s390x/mem_helper.c                          |   61 +-
 target-s390x/misc_helper.c                         |  218 +-
 target-s390x/translate.c                           |   16 +-
 target-sh4/cpu.c                                   |   30 +-
 target-sh4/cpu.h                                   |   17 +-
 target-sh4/helper.c                                |  108 +-
 target-sh4/op_helper.c                             |   20 +-
 target-sh4/translate.c                             |  177 +-
 target-sparc/cpu.c                                 |  118 +-
 target-sparc/cpu.h                                 |   19 +-
 target-sparc/helper.c                              |   53 +-
 target-sparc/helper.h                              |   22 +-
 target-sparc/int32_helper.c                        |   10 +-
 target-sparc/int64_helper.c                        |    8 +-
 target-sparc/ldst_helper.c                         |  145 +-
 target-sparc/machine.c                             |    3 +-
 target-sparc/mmu_helper.c                          |   60 +-
 target-sparc/translate.c                           |   61 +-
 target-unicore32/cpu.c                             |   13 +-
 target-unicore32/cpu.h                             |   11 +-
 target-unicore32/helper.c                          |   31 +-
 target-unicore32/op_helper.c                       |   16 +-
 target-unicore32/softmmu.c                         |   32 +-
 target-unicore32/translate.c                       |   37 +-
 target-unicore32/ucf64_helper.c                    |    3 +-
 target-xtensa/core-dc232b.c                        |    8 +-
 target-xtensa/core-dc233c.c                        |    7 +-
 target-xtensa/core-fsf.c                           |    8 +-
 target-xtensa/cpu.c                                |   10 +
 target-xtensa/cpu.h                                |   17 +-
 target-xtensa/helper.c                             |   33 +-
 target-xtensa/helper.h                             |    1 +
 target-xtensa/op_helper.c                          |   62 +-
 target-xtensa/overlay_tool.h                       |   17 +
 target-xtensa/translate.c                          |  100 +-
 tcg/README                                         |   43 +-
 tcg/aarch64/tcg-target.c                           | 1060 +-
 tcg/aarch64/tcg-target.h                           |   53 +-
 tcg/arm/tcg-target.c                               |  843 +-
 tcg/arm/tcg-target.h                               |   13 +-
 tcg/hppa/tcg-target.c                              | 1829 -
 tcg/hppa/tcg-target.h                              |  126 -
 tcg/i386/tcg-target.c                              | 1121 +-
 tcg/i386/tcg-target.h                              |   28 +-
 tcg/ia64/tcg-target.c                              |  778 +-
 tcg/ia64/tcg-target.h                              |   13 +-
 tcg/mips/tcg-target.c                              |  259 +-
 tcg/mips/tcg-target.h                              |   59 +-
 tcg/optimize.c                                     |  208 +-
 tcg/ppc/tcg-target.c                               |  696 +-
 tcg/ppc/tcg-target.h                               |    6 +-
 tcg/ppc64/tcg-target.c                             | 1206 +-
 tcg/ppc64/tcg-target.h                             |   10 +-
 tcg/s390/tcg-target.c                              |  129 +-
 tcg/s390/tcg-target.h                              |    9 +-
 tcg/sparc/tcg-target.c                             |  613 +-
 tcg/sparc/tcg-target.h                             |   30 +-
 tcg/tcg-be-ldst.h                                  |   90 +
 tcg/tcg-be-null.h                                  |   43 +
 tcg/tcg-op.h                                       |  281 +-
 tcg/tcg-opc.h                                      |  100 +-
 tcg/tcg.c                                          |  481 +-
 tcg/tcg.h                                          |  254 +-
 tcg/tci/tcg-target.c                               |   15 +-
 tcg/tci/tcg-target.h                               |   20 +-
 tci.c                                              |    4 +-
 tests/.gitignore                                   |    4 +
 tests/Makefile                                     |  164 +-
 tests/acpi-test-data/pc/APIC                       |  Bin 0 -> 120 bytes
 tests/acpi-test-data/pc/DSDT                       |  Bin 0 -> 4480 bytes
 tests/acpi-test-data/pc/FACP                       |  Bin 0 -> 116 bytes
 tests/acpi-test-data/pc/FACS                       |  Bin 0 -> 64 bytes
 tests/acpi-test-data/pc/HPET                       |  Bin 0 -> 56 bytes
 tests/acpi-test-data/pc/SSDT                       |  Bin 0 -> 2269 bytes
 tests/acpi-test-data/q35/APIC                      |  Bin 0 -> 120 bytes
 tests/acpi-test-data/q35/DSDT                      |  Bin 0 -> 7378 bytes
 tests/acpi-test-data/q35/FACP                      |  Bin 0 -> 116 bytes
 tests/acpi-test-data/q35/FACS                      |  Bin 0 -> 64 bytes
 tests/acpi-test-data/q35/HPET                      |  Bin 0 -> 56 bytes
 tests/acpi-test-data/q35/MCFG                      |  Bin 0 -> 60 bytes
 tests/acpi-test-data/q35/SSDT                      |  Bin 0 -> 550 bytes
 tests/acpi-test-data/rebuild-expected-aml.sh       |   36 +
 tests/acpi-test.c                                  |  674 +
 tests/blockdev-test.c                              |   59 +
 tests/boot-order-test.c                            |    6 +-
 tests/check-qdict.c                                |  219 +
 tests/check-qom-interface.c                        |  105 +
 tests/e1000-test.c                                 |   33 +
 tests/eepro100-test.c                              |   63 +
 tests/endianness-test.c                            |   11 +-
 tests/fdc-test.c                                   |   20 +-
 tests/fw_cfg-test.c                                |   10 +-
 tests/hd-geo-test.c                                |    2 +-
 tests/i440fx-test.c                                |  176 +-
 tests/i82801b11-test.c                             |   33 +
 tests/ide-test.c                                   |   39 +-
 tests/ipoctal232-test.c                            |   33 +
 tests/libqos/pci-pc.c                              |   12 +-
 tests/libqtest.c                                   |  222 +-
 tests/libqtest.h                                   |   85 +-
 tests/m48t59-test.c                                |    5 +-
 tests/multiboot/Makefile                           |   18 +
 tests/multiboot/libc.c                             |  139 +
 tests/multiboot/libc.h                             |   61 +
 tests/multiboot/link.ld                            |   19 +
 tests/multiboot/mmap.c                             |   56 +
 tests/multiboot/mmap.out                           |   93 +
 tests/multiboot/multiboot.h                        |   66 +
 tests/multiboot/run_test.sh                        |   81 +
 tests/multiboot/start.S                            |   51 +
 tests/ne2000-test.c                                |   33 +
 tests/nvme-test.c                                  |   34 +
 tests/pcnet-test.c                                 |   33 +
 tests/pvpanic-test.c                               |   47 +
 tests/qapi-schema/comments.out                     |    2 +-
 tests/qapi-schema/duplicate-key.err                |    1 +
 tests/qapi-schema/duplicate-key.exit               |    1 +
 tests/qapi-schema/duplicate-key.json               |    2 +
 .../qapi-schema/flat-union-invalid-branch-key.err  |    1 +
 .../qapi-schema/flat-union-invalid-branch-key.exit |    1 +
 .../qapi-schema/flat-union-invalid-branch-key.json |   17 +
 .../flat-union-invalid-discriminator.err           |    1 +
 .../flat-union-invalid-discriminator.exit          |    1 +
 .../flat-union-invalid-discriminator.json          |   17 +
 tests/qapi-schema/flat-union-no-base.err           |    1 +
 tests/qapi-schema/flat-union-no-base.exit          |    1 +
 tests/qapi-schema/flat-union-no-base.json          |   10 +
 tests/qapi-schema/flat-union-reverse-define.exit   |    1 +
 tests/qapi-schema/flat-union-reverse-define.json   |   17 +
 tests/qapi-schema/flat-union-reverse-define.out    |    9 +
 .../flat-union-string-discriminator.err            |    1 +
 .../flat-union-string-discriminator.exit           |    1 +
 .../flat-union-string-discriminator.json           |   17 +
 tests/qapi-schema/qapi-schema-test.json            |   42 +-
 tests/qapi-schema/qapi-schema-test.out             |   24 +-
 tests/qapi-schema/union-invalid-base.err           |    1 +
 tests/qapi-schema/union-invalid-base.exit          |    1 +
 tests/qapi-schema/union-invalid-base.json          |   10 +
 tests/qdev-monitor-test.c                          |   77 +
 tests/qemu-iotests-quick.sh                        |    1 +
 tests/qemu-iotests/.gitignore                      |    1 +
 tests/qemu-iotests/001                             |    6 +-
 tests/qemu-iotests/002                             |   36 +-
 tests/qemu-iotests/003                             |   10 +-
 tests/qemu-iotests/004                             |   24 +-
 tests/qemu-iotests/005                             |    6 +-
 tests/qemu-iotests/007                             |    4 +-
 tests/qemu-iotests/008                             |    6 +-
 tests/qemu-iotests/009                             |    2 +-
 tests/qemu-iotests/010                             |    2 +-
 tests/qemu-iotests/011                             |    2 +-
 tests/qemu-iotests/012                             |    4 +-
 tests/qemu-iotests/013                             |    6 +-
 tests/qemu-iotests/013.out                         |44080 +++++++-------
 tests/qemu-iotests/014                             |    4 +-
 tests/qemu-iotests/014.out                         |64204 ++++++++++----------
 tests/qemu-iotests/015                             |   16 +-
 tests/qemu-iotests/016                             |   14 +-
 tests/qemu-iotests/017                             |    3 +-
 tests/qemu-iotests/017.out                         | 1080 +-
 tests/qemu-iotests/018                             |    9 +-
 tests/qemu-iotests/018.out                         | 1080 +-
 tests/qemu-iotests/019                             |   21 +-
 tests/qemu-iotests/019.out                         | 1636 +-
 tests/qemu-iotests/020                             |   20 +-
 tests/qemu-iotests/020.out                         | 1080 +-
 tests/qemu-iotests/021                             |    2 +-
 tests/qemu-iotests/022.out                         | 8816 ++--
 tests/qemu-iotests/023                             |    6 +-
 tests/qemu-iotests/023.out                         |26800 ++++----
 tests/qemu-iotests/024                             |   14 +-
 tests/qemu-iotests/024.out                         |  164 +-
 tests/qemu-iotests/025                             |    6 +-
 tests/qemu-iotests/025.out                         |   18 +-
 tests/qemu-iotests/026                             |   25 +-
 tests/qemu-iotests/026.out                         |   50 +-
 tests/qemu-iotests/026.out.nocache                 |  610 +
 tests/qemu-iotests/027                             |   10 +-
 tests/qemu-iotests/028                             |    8 +-
 tests/qemu-iotests/028.out                         |  458 +-
 tests/qemu-iotests/029                             |   52 +-
 tests/qemu-iotests/029.out                         |   17 +
 tests/qemu-iotests/030                             |   20 +-
 tests/qemu-iotests/031                             |   14 +-
 tests/qemu-iotests/031.out                         |   12 +-
 tests/qemu-iotests/032                             |    4 +-
 tests/qemu-iotests/032.out                         |   68 +-
 tests/qemu-iotests/033                             |   18 +-
 tests/qemu-iotests/034                             |   69 +-
 tests/qemu-iotests/035                             |    2 +-
 tests/qemu-iotests/035.out                         |    2 +-
 tests/qemu-iotests/036                             |    8 +-
 tests/qemu-iotests/036.out                         |    2 +-
 tests/qemu-iotests/037                             |   67 +-
 tests/qemu-iotests/037.out                         |  616 +-
 tests/qemu-iotests/038                             |   15 +-
 tests/qemu-iotests/038.out                         |  724 +-
 tests/qemu-iotests/039                             |   53 +-
 tests/qemu-iotests/039.out                         |   15 +-
 tests/qemu-iotests/040                             |  119 +-
 tests/qemu-iotests/041                             |   41 +
 tests/qemu-iotests/041.out                         |    4 +-
 tests/qemu-iotests/042                             |   10 +-
 tests/qemu-iotests/043                             |   34 +-
 tests/qemu-iotests/044.out                         |    2 +-
 tests/qemu-iotests/045                             |   51 +-
 tests/qemu-iotests/045.out                         |    4 +-
 tests/qemu-iotests/046                             |   30 +-
 tests/qemu-iotests/046.out                         |  232 +-
 tests/qemu-iotests/047                             |    2 +-
 tests/qemu-iotests/047.out                         |   20 +-
 tests/qemu-iotests/048                             |   15 +-
 tests/qemu-iotests/048.out                         |   29 +-
 tests/qemu-iotests/049                             |   36 +-
 tests/qemu-iotests/049.out                         |   18 +-
 tests/qemu-iotests/050                             |   20 +-
 tests/qemu-iotests/051                             |  124 +-
 tests/qemu-iotests/051.out                         |  296 +-
 tests/qemu-iotests/052                             |   11 +-
 tests/qemu-iotests/053                             |   10 +-
 tests/qemu-iotests/054                             |    4 +-
 tests/qemu-iotests/054.out                         |    4 +-
 tests/qemu-iotests/055                             |   14 +-
 tests/qemu-iotests/057                             |  259 +
 tests/qemu-iotests/057.out                         |    5 +
 tests/qemu-iotests/058                             |  138 +
 tests/qemu-iotests/058.out                         |   44 +
 tests/qemu-iotests/059                             |   58 +-
 tests/qemu-iotests/059.out                         |  100 +-
 tests/qemu-iotests/060                             |  170 +
 tests/qemu-iotests/060.out                         |   96 +
 tests/qemu-iotests/061                             |  215 +
 tests/qemu-iotests/061.out                         |  387 +
 tests/qemu-iotests/062                             |   64 +
 tests/qemu-iotests/062.out                         |    9 +
 tests/qemu-iotests/063                             |  100 +
 tests/qemu-iotests/063.out                         |   10 +
 tests/qemu-iotests/064                             |   73 +
 tests/qemu-iotests/064.out                         |   28 +
 tests/qemu-iotests/065                             |  125 +
 tests/qemu-iotests/065.out                         |    5 +
 tests/qemu-iotests/066                             |   63 +
 tests/qemu-iotests/066.out                         |   13 +
 tests/qemu-iotests/067                             |  133 +
 tests/qemu-iotests/067.out                         |   80 +
 tests/qemu-iotests/068                             |   65 +
 tests/qemu-iotests/068.out                         |   11 +
 tests/qemu-iotests/069                             |   60 +
 tests/qemu-iotests/069.out                         |    8 +
 tests/qemu-iotests/070                             |   78 +
 tests/qemu-iotests/070.out                         |   21 +
 tests/qemu-iotests/071                             |  239 +
 tests/qemu-iotests/071.out                         |   90 +
 tests/qemu-iotests/072                             |   69 +
 tests/qemu-iotests/072.out                         |   21 +
 tests/qemu-iotests/073                             |  166 +
 tests/qemu-iotests/073.out                         |  118 +
 tests/qemu-iotests/074                             |   86 +
 tests/qemu-iotests/074.out                         |   18 +
 tests/qemu-iotests/075                             |  106 +
 tests/qemu-iotests/075.out                         |   38 +
 tests/qemu-iotests/076                             |   76 +
 tests/qemu-iotests/076.out                         |   18 +
 tests/qemu-iotests/077                             |  278 +
 tests/qemu-iotests/077.out                         |  202 +
 tests/qemu-iotests/078                             |   91 +
 tests/qemu-iotests/078.out                         |   28 +
 tests/qemu-iotests/079                             |   63 +
 tests/qemu-iotests/079.out                         |   32 +
 tests/qemu-iotests/080                             |  180 +
 tests/qemu-iotests/080.out                         |   83 +
 tests/qemu-iotests/081                             |  149 +
 tests/qemu-iotests/081.out                         |   49 +
 tests/qemu-iotests/082                             |  208 +
 tests/qemu-iotests/082.out                         |  529 +
 tests/qemu-iotests/083                             |  129 +
 tests/qemu-iotests/083.out                         |  163 +
 tests/qemu-iotests/084                             |  104 +
 tests/qemu-iotests/084.out                         |   33 +
 tests/qemu-iotests/085                             |  192 +
 tests/qemu-iotests/085.out                         |   55 +
 tests/qemu-iotests/086                             |   65 +
 tests/qemu-iotests/086.out                         |   18 +
 tests/qemu-iotests/087                             |  139 +
 tests/qemu-iotests/087.out                         |   49 +
 tests/qemu-iotests/088                             |   64 +
 tests/qemu-iotests/088.out                         |   17 +
 tests/qemu-iotests/check                           |  242 +-
 tests/qemu-iotests/common                          |  497 +-
 tests/qemu-iotests/common.config                   |   17 +-
 tests/qemu-iotests/common.filter                   |   56 +-
 tests/qemu-iotests/common.pattern                  |   16 +-
 tests/qemu-iotests/common.rc                       |  214 +-
 tests/qemu-iotests/group                           |   43 +-
 tests/qemu-iotests/iotests.py                      |   50 +-
 tests/qemu-iotests/nbd-fault-injector.py           |  264 +
 tests/qemu-iotests/sample_images/README            |    8 +
 tests/qemu-iotests/sample_images/empty.bochs.bz2   |  Bin 0 -> 118 bytes
 .../qemu-iotests/sample_images/fake.parallels.bz2  |  Bin 0 -> 141 bytes
 .../sample_images/iotest-dirtylog-10G-4M.vhdx.bz2  |  Bin 0 -> 4490 bytes
 .../sample_images/iotest-dynamic-1G.vhdx.bz2       |  Bin 0 -> 874 bytes
 .../sample_images/iotest-version3.vmdk.bz2         |  Bin 0 -> 414 bytes
 .../sample_images/simple-pattern.cloop.bz2         |  Bin 0 -> 488 bytes
 tests/qemu-iotests/socket_scm_helper.c             |  135 +
 tests/qom-test.c                                   |  138 +
 tests/rtc-test.c                                   |    7 +-
 tests/rtl8139-test.c                               |   33 +
 tests/spapr-phb-test.c                             |   35 +
 tests/tcg/lm32/Makefile                            |    8 +-
 tests/tcg/openrisc/test_addc.c                     |    8 +-
 tests/tcg/openrisc/test_addic.c                    |   10 +-
 tests/tcg/test_path.c                              |   13 +-
 tests/tcg/xtensa/Makefile                          |   12 +-
 tests/tcg/xtensa/macros.inc                        |    6 +
 tests/tcg/xtensa/test_b.S                          |    2 +-
 tests/tcg/xtensa/test_bi.S                         |    2 +-
 tests/tcg/xtensa/test_boolean.S                    |    2 +-
 tests/tcg/xtensa/test_break.S                      |    2 +-
 tests/tcg/xtensa/test_bz.S                         |    2 +-
 tests/tcg/xtensa/test_cache.S                      |   97 +
 tests/tcg/xtensa/test_clamps.S                     |    2 +-
 tests/tcg/xtensa/test_extui.S                      |    2 +-
 tests/tcg/xtensa/test_fail.S                       |    2 +-
 tests/tcg/xtensa/test_interrupt.S                  |    2 +-
 tests/tcg/xtensa/test_loop.S                       |    2 +-
 tests/tcg/xtensa/test_mac16.S                      |    2 +-
 tests/tcg/xtensa/test_max.S                        |    2 +-
 tests/tcg/xtensa/test_min.S                        |    2 +-
 tests/tcg/xtensa/test_mmu.S                        |    6 +-
 tests/tcg/xtensa/test_mul16.S                      |    2 +-
 tests/tcg/xtensa/test_mul32.S                      |    2 +-
 tests/tcg/xtensa/test_nsa.S                        |    2 +-
 tests/tcg/xtensa/test_pipeline.S                   |    2 +-
 tests/tcg/xtensa/test_quo.S                        |    2 +-
 tests/tcg/xtensa/test_rem.S                        |    2 +-
 tests/tcg/xtensa/test_rst0.S                       |    2 +-
 tests/tcg/xtensa/test_s32c1i.S                     |    2 +-
 tests/tcg/xtensa/test_sar.S                        |    2 +-
 tests/tcg/xtensa/test_sext.S                       |    2 +-
 tests/tcg/xtensa/test_shift.S                      |    2 +-
 tests/tcg/xtensa/test_sr.S                         |    2 +-
 tests/tcg/xtensa/test_timer.S                      |    2 +-
 tests/tcg/xtensa/test_windowed.S                   |    2 +-
 tests/test-aio.c                                   |  297 +-
 tests/test-bitops.c                                |    4 +-
 tests/test-coroutine.c                             |   99 +-
 tests/test-int128.c                                |   15 +-
 tests/test-opts-visitor.c                          |  275 +
 tests/test-qdev-global-props.c                     |  180 +
 tests/test-qmp-commands.c                          |   78 +-
 tests/test-qmp-input-strict.c                      |   88 +-
 tests/test-qmp-input-visitor.c                     |   69 +-
 tests/test-qmp-output-visitor.c                    |   91 +-
 tests/test-rfifolock.c                             |   91 +
 tests/test-string-input-visitor.c                  |   20 +-
 tests/test-string-output-visitor.c                 |   16 +-
 tests/test-thread-pool.c                           |   27 +-
 tests/test-throttle.c                              |  481 +
 tests/test-visitor-serialization.c                 |   16 +-
 tests/test-vmstate.c                               |  357 +
 tests/tmp105-test.c                                |  141 +-
 tests/tpci200-test.c                               |   33 +
 tests/virtio-9p-test.c                             |   46 +
 tests/virtio-balloon-test.c                        |   33 +
 tests/virtio-blk-test.c                            |   34 +
 tests/virtio-console-test.c                        |   41 +
 tests/virtio-net-test.c                            |   33 +
 tests/virtio-rng-test.c                            |   33 +
 tests/virtio-scsi-test.c                           |   35 +
 tests/virtio-serial-test.c                         |   33 +
 tests/vmxnet3-test.c                               |   33 +
 thread-pool.c                                      |   14 +-
 tpm.c                                              |    2 +-
 trace-events                                       |  102 +-
 trace/Makefile.objs                                |   25 +
 trace/control-internal.h                           |   10 +-
 trace/simple.c                                     |   33 +-
 translate-all.c                                    |  173 +-
 translate-all.h                                    |    9 +-
 ui/Makefile.objs                                   |    8 +-
 ui/cocoa.m                                         |  182 +-
 ui/console.c                                       |  151 +-
 ui/curses.c                                        |   91 +-
 ui/gtk.c                                           |  228 +-
 ui/input-legacy.c                                  |  468 +
 ui/input.c                                         |  697 +-
 ui/keymaps.c                                       |    6 +
 ui/sdl.c                                           |  151 +-
 ui/sdl2-keymap.h                                   |  266 +
 ui/sdl2.c                                          |  834 +
 ui/sdl_keysym.h                                    |    3 +-
 ui/spice-core.c                                    |  100 +-
 ui/spice-display.c                                 |  116 +-
 ui/spice-input.c                                   |   84 +-
 ui/vnc-auth-sasl.h                                 |    1 +
 ui/vnc-auth-vencrypt.c                             |    2 +-
 ui/vnc-enc-tight.c                                 |    2 +-
 ui/vnc-enc-zywrle.h                                |    2 +-
 ui/vnc-jobs.c                                      |    8 +-
 ui/vnc-ws.c                                        |    1 +
 ui/vnc.c                                           |  300 +-
 ui/vnc.h                                           |   11 +-
 ui/vnc_keysym.h                                    |  373 +
 user-exec.c                                        |   28 +-
 util/Makefile.objs                                 |    4 +
 util/bitmap.c                                      |   60 +-
 util/cache-utils.c                                 |   51 +-
 util/compatfd.c                                    |   17 +-
 util/cutils.c                                      |   14 +
 util/error.c                                       |   63 +-
 util/fifo8.c                                       |   47 +
 util/getauxval.c                                   |   74 +
 util/host-utils.c                                  |   75 +
 util/iov.c                                         |  115 +-
 util/module.c                                      |  147 +-
 util/osdep.c                                       |   26 +-
 util/oslib-posix.c                                 |   97 +-
 util/oslib-win32.c                                 |   64 +-
 util/path.c                                        |    4 +-
 util/qemu-config.c                                 |  191 +-
 util/qemu-option.c                                 |   95 +-
 util/qemu-progress.c                               |   11 +-
 util/qemu-sockets.c                                |   24 +-
 util/qemu-thread-posix.c                           |  145 +-
 util/qemu-thread-win32.c                           |   38 +-
 util/readline.c                                    |  495 +
 util/rfifolock.c                                   |   78 +
 util/throttle.c                                    |  396 +
 version.rc                                         |    4 +-
 vl.c                                               |  650 +-
 vmstate.c                                          |  653 +
 xen-all.c                                          | 1228 -
 xen-common-stub.c                                  |   19 +
 xen-common.c                                       |  123 +
 xen-hvm-stub.c                                     |   61 +
 xen-hvm.c                                          | 1129 +
 xen-stub.c                                         |   70 -
 1729 files changed, 218601 insertions(+), 122912 deletions(-)

diff --git a/.gitignore b/.gitignore
index 0fe114d..de90463 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,65 +1,75 @@
-config-devices.*
-config-all-devices.*
-config-all-disas.*
-config-host.*
-config-target.*
-trace/generated-tracers.h
-trace/generated-tracers.c
-trace/generated-tracers-dtrace.h
-trace/generated-tracers.dtrace
-trace/generated-events.h
-trace/generated-events.c
-libcacard/trace/generated-tracers.c
+/config-devices.*
+/config-all-devices.*
+/config-all-disas.*
+/config-host.*
+/config-target.*
+/config.status
+/trace/generated-tracers.h
+/trace/generated-tracers.c
+/trace/generated-tracers-dtrace.h
+/trace/generated-tracers.dtrace
+/trace/generated-events.h
+/trace/generated-events.c
+/trace/generated-ust-provider.h
+/trace/generated-ust.c
+/libcacard/trace/generated-tracers.c
 *-timestamp
-*-softmmu
-*-darwin-user
-*-linux-user
-*-bsd-user
+/*-softmmu
+/*-darwin-user
+/*-linux-user
+/*-bsd-user
 libdis*
 libuser
-linux-headers/asm
-qapi-generated
-qapi-types.[ch]
-qapi-visit.[ch]
-qmp-commands.h
-qmp-marshal.c
-qemu-doc.html
-qemu-tech.html
-qemu-doc.info
-qemu-tech.info
-qemu.1
-qemu.pod
-qemu-img.1
-qemu-img.pod
-qemu-img
-qemu-nbd
-qemu-nbd.8
-qemu-nbd.pod
-qemu-options.def
-qemu-options.texi
-qemu-img-cmds.texi
-qemu-img-cmds.h
-qemu-io
-qemu-ga
-qemu-bridge-helper
-qemu-monitor.texi
-vscclient
-QMP/qmp-commands.txt
-test-coroutine
-test-qmp-input-visitor
-test-qmp-output-visitor
-test-string-input-visitor
-test-string-output-visitor
-test-visitor-serialization
-fsdev/virtfs-proxy-helper
-fsdev/virtfs-proxy-helper.1
-fsdev/virtfs-proxy-helper.pod
-.gdbinit
+/linux-headers/asm
+/qga/qapi-generated
+/qapi-generated
+/qapi-types.[ch]
+/qapi-visit.[ch]
+/qmp-commands.h
+/qmp-marshal.c
+/qemu-doc.html
+/qemu-tech.html
+/qemu-doc.info
+/qemu-tech.info
+/qemu.1
+/qemu.pod
+/qemu-img.1
+/qemu-img.pod
+/qemu-img
+/qemu-nbd
+/qemu-nbd.8
+/qemu-nbd.pod
+/qemu-options.def
+/qemu-options.texi
+/qemu-img-cmds.texi
+/qemu-img-cmds.h
+/qemu-io
+/qemu-ga
+/qemu-bridge-helper
+/qemu-monitor.texi
+/qmp-commands.txt
+/vscclient
+/test-bitops
+/test-coroutine
+/test-int128
+/test-opts-visitor
+/test-qmp-input-visitor
+/test-qmp-output-visitor
+/test-string-input-visitor
+/test-string-output-visitor
+/test-visitor-serialization
+/fsdev/virtfs-proxy-helper
+/fsdev/virtfs-proxy-helper.1
+/fsdev/virtfs-proxy-helper.pod
+/.gdbinit
 *.a
 *.aux
 *.cp
 *.dvi
 *.exe
+*.dll
+*.so
+*.mo
 *.fn
 *.ky
 *.log
@@ -73,34 +83,35 @@ fsdev/virtfs-proxy-helper.pod
 *.tp
 *.vr
 *.d
-!scripts/qemu-guest-agent/fsfreeze-hook.d
+!/scripts/qemu-guest-agent/fsfreeze-hook.d
 *.o
 *.lo
 *.la
 *.pc
 .libs
+.sdk
 *.swp
 *.orig
 .pc
 *.gcda
 *.gcno
 patches
-pc-bios/bios-pq/status
-pc-bios/vgabios-pq/status
-pc-bios/optionrom/linuxboot.asm
-pc-bios/optionrom/linuxboot.bin
-pc-bios/optionrom/linuxboot.raw
-pc-bios/optionrom/linuxboot.img
-pc-bios/optionrom/multiboot.asm
-pc-bios/optionrom/multiboot.bin
-pc-bios/optionrom/multiboot.raw
-pc-bios/optionrom/multiboot.img
-pc-bios/optionrom/kvmvapic.asm
-pc-bios/optionrom/kvmvapic.bin
-pc-bios/optionrom/kvmvapic.raw
-pc-bios/optionrom/kvmvapic.img
-pc-bios/s390-ccw/s390-ccw.elf
-pc-bios/s390-ccw/s390-ccw.img
+/pc-bios/bios-pq/status
+/pc-bios/vgabios-pq/status
+/pc-bios/optionrom/linuxboot.asm
+/pc-bios/optionrom/linuxboot.bin
+/pc-bios/optionrom/linuxboot.raw
+/pc-bios/optionrom/linuxboot.img
+/pc-bios/optionrom/multiboot.asm
+/pc-bios/optionrom/multiboot.bin
+/pc-bios/optionrom/multiboot.raw
+/pc-bios/optionrom/multiboot.img
+/pc-bios/optionrom/kvmvapic.asm
+/pc-bios/optionrom/kvmvapic.bin
+/pc-bios/optionrom/kvmvapic.raw
+/pc-bios/optionrom/kvmvapic.img
+/pc-bios/s390-ccw/s390-ccw.elf
+/pc-bios/s390-ccw/s390-ccw.img
 .stgit-*
 cscope.*
 tags
diff --git a/.gitmodules b/.gitmodules
index d7e3f3c..444c24a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,27 +1,30 @@
 [submodule "roms/vgabios"]
 	path = roms/vgabios
-	url = git://git.qemu.org/vgabios.git/
+	url = git://git.qemu-project.org/vgabios.git/
 [submodule "roms/seabios"]
 	path = roms/seabios
-	url = git://git.qemu.org/seabios.git/
+	url = git://git.qemu-project.org/seabios.git/
 [submodule "roms/SLOF"]
 	path = roms/SLOF
-	url = git://git.qemu.org/SLOF.git
+	url = git://git.qemu-project.org/SLOF.git
 [submodule "roms/ipxe"]
 	path = roms/ipxe
-	url = git://git.qemu.org/ipxe.git
+	url = git://git.qemu-project.org/ipxe.git
 [submodule "roms/openbios"]
 	path = roms/openbios
-	url = git://git.qemu.org/openbios.git
+	url = git://git.qemu-project.org/openbios.git
+[submodule "roms/openhackware"]
+	path = roms/openhackware
+	url = git://git.qemu-project.org/openhackware.git
 [submodule "roms/qemu-palcode"]
 	path = roms/qemu-palcode
 	url = git://github.com/rth7680/qemu-palcode.git
 [submodule "roms/sgabios"]
 	path = roms/sgabios
-	url = git://git.qemu.org/sgabios.git
+	url = git://git.qemu-project.org/sgabios.git
 [submodule "pixman"]
 	path = pixman
 	url = git://anongit.freedesktop.org/pixman
 [submodule "dtc"]
 	path = dtc
-	url = git://git.qemu.org/dtc.git
+	url = git://git.qemu-project.org/dtc.git
diff --git a/.mailmap b/.mailmap
index 9797802..28defa1 100644
--- a/.mailmap
+++ b/.mailmap
@@ -2,7 +2,8 @@
 # into proper addresses so that they are counted properly in git shortlog output.
 #
 Andrzej Zaborowski <balrogg@gmail.com> balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162>
-Anthony Liguori <aliguori@us.ibm.com> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
+Anthony Liguori <anthony@codemonkey.ws> aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
+Anthony Liguori <anthony@codemonkey.ws> Anthony Liguori <aliguori@us.ibm.com>
 Aurelien Jarno <aurelien@aurel32.net> aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>
 Blue Swirl <blauwirbel@gmail.com> blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>
 Edgar E. Iglesias <edgar.iglesias@gmail.com> edgar_igl <edgar_igl@c046a42c-6fe2-441c-8c8c-71466251a162>
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..04da973
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,81 @@
+language: c
+python:
+  - "2.4"
+compiler:
+  - gcc
+  - clang
+notifications:
+  irc:
+    channels:
+      - "irc.oftc.net#qemu"
+    on_success: change
+    on_failure: always
+env:
+  global:
+    - TEST_CMD="make check"
+    - EXTRA_CONFIG=""
+    # Development packages, EXTRA_PKGS saved for additional builds
+    - CORE_PKGS="libusb-1.0-0-dev libiscsi-dev librados-dev libncurses5-dev"
+    - NET_PKGS="libseccomp-dev libgnutls-dev libssh2-1-dev  libspice-server-dev libspice-protocol-dev libnss3-dev"
+    - GUI_PKGS="libgtk-3-dev libvte-2.90-dev libsdl1.2-dev libpng12-dev libpixman-1-dev"
+    - EXTRA_PKGS=""
+  matrix:
+    - TARGETS=alpha-softmmu,alpha-linux-user
+    - TARGETS=arm-softmmu,arm-linux-user
+    - TARGETS=aarch64-softmmu,aarch64-linux-user
+    - TARGETS=cris-softmmu
+    - TARGETS=i386-softmmu,x86_64-softmmu
+    - TARGETS=lm32-softmmu
+    - TARGETS=m68k-softmmu
+    - TARGETS=microblaze-softmmu,microblazeel-softmmu
+    - TARGETS=mips-softmmu,mips64-softmmu,mips64el-softmmu,mipsel-softmmu
+    - TARGETS=moxie-softmmu
+    - TARGETS=or32-softmmu,
+    - TARGETS=ppc-softmmu,ppc64-softmmu,ppcemb-softmmu
+    - TARGETS=s390x-softmmu
+    - TARGETS=sh4-softmmu,sh4eb-softmmu
+    - TARGETS=sparc-softmmu,sparc64-softmmu
+    - TARGETS=unicore32-softmmu
+    - TARGETS=xtensa-softmmu,xtensaeb-softmmu
+before_install:
+  - git submodule update --init --recursive
+  - sudo apt-get update -qq
+  - sudo apt-get install -qq ${CORE_PKGS} ${NET_PKGS} ${GUI_PKGS} ${EXTRA_PKGS}
+script: "./configure --target-list=${TARGETS} ${EXTRA_CONFIG} && make && ${TEST_CMD}"
+matrix:
+  # We manually include a number of additional build for non-standard bits
+  include:
+    # Debug related options
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-debug"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-debug --enable-tcg-interpreter"
+      compiler: gcc
+    # All the extra -dev packages
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_PKGS="libaio-dev libcap-ng-dev libattr1-dev libbrlapi-dev uuid-dev libusb-1.0.0-dev"
+      compiler: gcc
+    # Currently configure doesn't force --disable-pie
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-gprof --enable-gcov --disable-pie"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_PKGS="sparse"
+           EXTRA_CONFIG="--enable-sparse"
+      compiler: gcc
+    # All the trace backends (apart from dtrace)
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-trace-backend=stderr"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-trace-backend=simple"
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+           EXTRA_CONFIG="--enable-trace-backend=ftrace"
+           TEST_CMD=""
+      compiler: gcc
+    - env: TARGETS=i386-softmmu,x86_64-softmmu
+          EXTRA_PKGS="liblttng-ust-dev liburcu-dev"
+          EXTRA_CONFIG="--enable-trace-backend=ust"
+      compiler: gcc
diff --git a/CODING_STYLE b/CODING_STYLE
index dcbce28..4280945 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -84,3 +84,10 @@ and clarity it comes on a line by itself:
 Rationale: a consistent (except for functions...) bracing style reduces
 ambiguity and avoids needless churn when lines are added or removed.
 Furthermore, it is the QEMU coding style.
+
+5. Declarations
+
+Mixed declarations (interleaving statements and declarations within blocks)
+are not allowed; declarations should be at the beginning of blocks.  In other
+words, the code should not generate warnings if using GCC's
+-Wdeclaration-after-statement option.
diff --git a/Changelog b/Changelog
index 13eebef..1249b8a 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,6 @@
 This file documents changes for QEMU releases 0.12 and earlier.
 For changelog information for later releases, see
-http://wiki.qemu.org/ChangeLog or look at the git history for
+http://wiki.qemu-project.org/ChangeLog or look at the git history for
 more detailed information.
 
 
diff --git a/MAINTAINERS b/MAINTAINERS
index 654e2cb..c66946f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -50,8 +50,7 @@ Descriptions of section entries:
 
 General Project Administration
 ------------------------------
-M: Anthony Liguori <aliguori@us.ibm.com>
-M: Paul Brook <paul@codesourcery.com>
+M: Anthony Liguori <aliguori@amazon.com>
 
 Guest CPU cores (TCG):
 ----------------------
@@ -62,7 +61,6 @@ F: target-alpha/
 F: hw/alpha/
 
 ARM
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: target-arm/
@@ -83,8 +81,7 @@ F: hw/lm32/
 F: hw/char/lm32_*
 
 M68K
-M: Paul Brook <paul@codesourcery.com>
-S: Odd Fixes
+S: Orphan
 F: target-m68k/
 F: hw/m68k/
 
@@ -161,7 +158,6 @@ Guest CPU Cores (KVM):
 ----------------------
 
 Overall
-M: Gleb Natapov <gleb@redhat.com>
 M: Paolo Bonzini <pbonzini@redhat.com>
 L: kvm@vger.kernel.org
 S: Supported
@@ -179,12 +175,14 @@ S: Maintained
 F: target-ppc/kvm.c
 
 S390
+M: Christian Borntraeger <borntraeger@de.ibm.com>
+M: Cornelia Huck <cornelia.huck@de.ibm.com>
 M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: target-s390x/kvm.c
+F: hw/intc/s390_flic.[hc]
 
 X86
-M: Gleb Natapov <gleb@redhat.com>
 M: Marcelo Tosatti <mtosatti@redhat.com>
 L: kvm@vger.kernel.org
 S: Supported
@@ -222,6 +220,13 @@ F: *win32*
 
 ARM Machines
 ------------
+Allwinner-a10
+M: Li Guang <lig.fnst@cn.fujitsu.com>
+S: Maintained
+F: hw/*/allwinner-a10*
+F: include/hw/*/allwinner-a10*
+F: hw/arm/cubieboard.c
+
 Exynos
 M: Evgeny Voevodin <e.voevodin@samsung.com>
 M: Maksim Kozlov <m.kozlov@samsung.com>
@@ -236,6 +241,12 @@ S: Supported
 F: hw/arm/highbank.c
 F: hw/net/xgmac.c
 
+Canon DIGIC
+M: Antony Pavlov <antonynpavlov@gmail.com>
+S: Maintained
+F: include/hw/arm/digic.h
+F: hw/*/digic*
+
 Gumstix
 M: qemu-devel@nongnu.org
 S: Orphan
@@ -248,7 +259,6 @@ F: hw/*/imx*
 F: hw/arm/kzm.c
 
 Integrator CP
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/arm/integratorcp.c
@@ -274,7 +284,6 @@ S: Maintained
 F: hw/arm/palm.c
 
 Real View
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/arm/realview*
@@ -285,19 +294,17 @@ S: Maintained
 F: hw/arm/spitz.c
 
 Stellaris
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/*/stellaris*
 
 Versatile PB
-M: Paul Brook <paul@codesourcery.com>
 M: Peter Maydell <peter.maydell@linaro.org>
 S: Maintained
 F: hw/*/versatile*
 
 Xilinx Zynq
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 S: Maintained
 F: hw/arm/xilinx_zynq.c
 F: hw/misc/zynq_slcr.c
@@ -327,18 +334,15 @@ F: hw/lm32/milkymist.c
 M68K Machines
 -------------
 an5206
-M: Paul Brook <paul@codesourcery.com>
-S: Maintained
+S: Orphan
 F: hw/m68k/an5206.c
 
 dummy_m68k
-M: Paul Brook <paul@codesourcery.com>
-S: Maintained
+S: Orphan
 F: hw/m68k/dummy_m68k.c
 
 mcf5208
-M: Paul Brook <paul@codesourcery.com>
-S: Maintained
+S: Orphan
 F: hw/m68k/mcf5208.c
 
 MicroBlaze Machines
@@ -349,7 +353,7 @@ S: Maintained
 F: hw/microblaze/petalogix_s3adsp1800_mmu.c
 
 petalogix_ml605
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 S: Maintained
 F: hw/microblaze/petalogix_ml605_mmu.c
 
@@ -492,10 +496,13 @@ F: hw/s390x/s390-*.c
 
 S390 Virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Christian Borntraeger <borntraeger@de.ibm.com>
 M: Alexander Graf <agraf@suse.de>
 S: Supported
 F: hw/s390x/s390-virtio-ccw.c
 F: hw/s390x/css.[hc]
+F: hw/s390x/sclp*.[hc]
+F: hw/s390x/ipl*.[hc]
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
 
 UniCore32 Machines
@@ -509,10 +516,24 @@ F: hw/unicore32/
 X86 Machines
 ------------
 PC
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
+M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
-F: hw/i386/pc.[ch]
-F: hw/i386/pc_piix.c
+F: include/hw/i386/
+F: hw/i386/
+F: hw/pci-host/piix.c
+F: hw/pci-host/q35.c
+F: hw/pci-host/pam.c
+F: include/hw/pci-host/q35.h
+F: include/hw/pci-host/pam.h
+F: hw/isa/piix4.c
+F: hw/isa/lpc_ich9.c
+F: hw/i2c/smbus_ich9.c
+F: hw/acpi/piix4.c
+F: hw/acpi/ich9.c
+F: include/hw/acpi/ich9.h
+F: include/hw/acpi/piix.h
+
 
 Xtensa Machines
 ---------------
@@ -567,12 +588,11 @@ F: hw/scsi/*
 T: git git://github.com/bonzini/qemu.git scsi-next
 
 LSI53C895A
-M: Paul Brook <paul@codesourcery.com>
-S: Odd Fixes
+S: Orphan
 F: hw/scsi/lsi53c895a.c
 
 SSI
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 S: Maintained
 F: hw/ssi/*
 F: hw/block/m25p80.c
@@ -593,7 +613,8 @@ S: Supported
 F: hw/*/*vhost*
 
 virtio
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
+M: Michael S. Tsirkin <mst@redhat.com>
 S: Supported
 F: hw/*/virtio*
 
@@ -602,6 +623,7 @@ M: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
 S: Supported
 F: hw/9pfs/
 F: fsdev/
+F: tests/virtio-9p-test.c
 T: git git://github.com/kvaneesh/QEMU.git
 
 virtio-blk
@@ -612,6 +634,7 @@ F: hw/block/virtio-blk.c
 
 virtio-ccw
 M: Cornelia Huck <cornelia.huck@de.ibm.com>
+M: Christian Borntraeger <borntraeger@de.ibm.com>
 S: Supported
 F: hw/s390x/virtio-ccw.[hc]
 T: git git://github.com/cohuck/qemu virtio-ccw-upstr
@@ -626,9 +649,10 @@ nvme
 M: Keith Busch <keith.busch@intel.com>
 S: Supported
 F: hw/block/nvme*
+F: tests/nvme-test.c
 
 Xilinx EDK
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 M: Edgar E. Iglesias <edgar.iglesias@gmail.com>
 S: Maintained
 F: hw/*/xilinx_*
@@ -638,6 +662,7 @@ Subsystems
 ----------
 Audio
 M: Vassili Karpov (malc) <av1474@comtv.ru>
+M: Gerd Hoffmann <kraxel@redhat.com>
 S: Maintained
 F: audio/
 F: hw/audio/
@@ -649,9 +674,11 @@ S: Supported
 F: block*
 F: block/
 F: hw/block/
+T: git git://repo.or.cz/qemu/kevin.git block
+T: git git://github.com/stefanha/qemu.git block
 
 Character Devices
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
 S: Maintained
 F: qemu-char.c
 
@@ -669,7 +696,7 @@ F: include/hw/cpu/icc_bus.h
 F: hw/cpu/icc_bus.c
 
 Device Tree
-M: Peter Crosthwaite <peter.crosthwaite@petalogix.com>
+M: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
 M: Alexander Graf <agraf@suse.de>
 S: Maintained
 F: device_tree.[ch]
@@ -689,34 +716,45 @@ F: audio/spiceaudio.c
 F: hw/display/qxl*
 
 Graphics
-M: Anthony Liguori <aliguori@us.ibm.com>
-S: Maintained
+M: Anthony Liguori <aliguori@amazon.com>
+M: Gerd Hoffmann <kraxel@redhat.com>
+S: Odd Fixes
 F: ui/
 
 Cocoa graphics
 M: Andreas Färber <andreas.faerber@web.de>
+M: Peter Maydell <peter.maydell@linaro.org>
 S: Odd Fixes
 F: ui/cocoa.m
 
 Main loop
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
 S: Supported
 F: vl.c
 
 Human Monitor (HMP)
 M: Luiz Capitulino <lcapitulino@redhat.com>
-S: Supported
+S: Maintained
 F: monitor.c
 F: hmp.c
 F: hmp-commands.hx
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 Network device layer
-M: Anthony Liguori <aliguori@us.ibm.com>
+M: Anthony Liguori <aliguori@amazon.com>
 M: Stefan Hajnoczi <stefanha@redhat.com>
 S: Maintained
 F: net/
 T: git git://github.com/stefanha/qemu.git net
 
+Netmap network backend
+M: Luigi Rizzo <rizzo@iet.unipi.it>
+M: Giuseppe Lettieri <g.lettieri@iet.unipi.it>
+M: Vincenzo Maffione <v.maffione@gmail.com>
+W: http://info.iet.unipi.it/~luigi/netmap/
+S: Maintained
+F: net/netmap.c
+
 Network Block Device (NBD)
 M: Paolo Bonzini <pbonzini@redhat.com>
 S: Odd Fixes
@@ -728,8 +766,9 @@ T: git git://github.com/bonzini/qemu.git nbd-next
 QAPI
 M: Luiz Capitulino <lcapitulino@redhat.com>
 M: Michael Roth <mdroth@linux.vnet.ibm.com>
-S: Supported
+S: Maintained
 F: qapi/
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 QAPI Schema
 M: Eric Blake <eblake@redhat.com>
@@ -737,14 +776,16 @@ M: Luiz Capitulino <lcapitulino@redhat.com>
 M: Markus Armbruster <armbru@redhat.com>
 S: Supported
 F: qapi-schema.json
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 QMP
 M: Luiz Capitulino <lcapitulino@redhat.com>
-S: Supported
+S: Maintained
 F: qmp.c
 F: monitor.c
 F: qmp-commands.hx
 F: QMP/
+T: git git://repo.or.cz/qemu/qmp-unstable.git queue/qmp
 
 SLIRP
 M: Jan Kiszka <jan.kiszka@siemens.com>
@@ -766,6 +807,12 @@ M: Blue Swirl <blauwirbel@gmail.com>
 S: Odd Fixes
 F: scripts/checkpatch.pl
 
+Seccomp
+M: Eduardo Otubo <otubo@linux.vnet.ibm.com>
+S: Supported
+F: qemu-seccomp.c
+F: include/sysemu/seccomp.h
+
 Usermode Emulation
 ------------------
 BSD user
@@ -797,11 +844,6 @@ M: Andrzej Zaborowski <balrogg@gmail.com>
 S: Maintained
 F: tcg/arm/
 
-HPPA target
-M: Richard Henderson <rth@twiddle.net>
-S: Maintained
-F: tcg/hppa/
-
 i386 target
 M: qemu-devel@nongnu.org
 S: Maintained
@@ -842,25 +884,73 @@ TCI target
 M: Stefan Weil <sw@weilnetz.de>
 S: Maintained
 F: tcg/tci/
+F: tci.c
 
 Stable branches
 ---------------
 Stable 1.0
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-1.0.git
+T: git git://git.qemu-project.org/qemu-stable-1.0.git
 S: Orphan
 
 Stable 0.15
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-0.15.git
-S: Orphan
+M: Andreas Färber <afaerber@suse.de>
+T: git git://git.qemu-project.org/qemu-stable-0.15.git
+S: Supported
 
 Stable 0.14
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-0.14.git
+T: git git://git.qemu-project.org/qemu-stable-0.14.git
 S: Orphan
 
 Stable 0.10
 L: qemu-stable@nongnu.org
-T: git git://git.qemu.org/qemu-stable-0.10.git
+T: git git://git.qemu-project.org/qemu-stable-0.10.git
 S: Orphan
+
+Block drivers
+-------------
+VMDK
+M: Fam Zheng <famz@redhat.com>
+S: Supported
+F: block/vmdk.c
+
+RBD
+M: Josh Durgin <josh.durgin@inktank.com>
+S: Supported
+F: block/rbd.c
+
+Sheepdog
+M: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
+M: Liu Yuan <namei.unix@gmail.com>
+L: sheepdog@lists.wpkg.org
+S: Supported
+F: block/sheepdog.c
+
+VHDX
+M: Jeff Cody <jcody@redhat.com>
+S: Supported
+F: block/vhdx*
+
+VDI
+M: Stefan Weil <sw@weilnetz.de>
+S: Maintained
+F: block/vdi.c
+
+iSCSI
+M: Ronnie Sahlberg <ronniesahlberg@gmail.com>
+M: Paolo Bonzini <pbonzini@redhat.com>
+M: Peter Lieven <pl@kamp.de>
+S: Supported
+F: block/iscsi.c
+
+NFS
+M: Peter Lieven <pl@kamp.de>
+S: Maintained
+F: block/nfs.c
+
+SSH
+M: Richard W.M. Jones <rjones@redhat.com>
+S: Supported
+F: block/ssh.c
diff --git a/Makefile b/Makefile
index 4d257f1..423e373 100644
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,14 @@ CONFIG_ALL=y
 include $(SRC_PATH)/rules.mak
 config-host.mak: $(SRC_PATH)/configure
 	@echo $@ is out-of-date, running configure
-	@sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh
+	@# TODO: The next lines include code which supports a smooth
+	@# transition from old configurations without config.status.
+	@# This code can be removed after QEMU 1.7.
+	@if test -x config.status; then \
+	    ./config.status; \
+        else \
+	    sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh; \
+	fi
 else
 config-host.mak:
 ifneq ($(filter-out %clean,$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail))
@@ -50,6 +57,11 @@ GENERATED_HEADERS += trace/generated-tracers-dtrace.h
 endif
 GENERATED_SOURCES += trace/generated-tracers.c
 
+ifeq ($(TRACE_BACKEND),ust)
+GENERATED_HEADERS += trace/generated-ust-provider.h
+GENERATED_SOURCES += trace/generated-ust.c
+endif
+
 # Don't try to regenerate Makefile or configure
 # We don't generate any of them
 Makefile: ;
@@ -65,7 +77,7 @@ LIBS+=-lz $(LIBS_TOOLS)
 HELPERS-$(CONFIG_LINUX) = qemu-bridge-helper$(EXESUF)
 
 ifdef BUILD_DOCS
-DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 QMP/qmp-commands.txt
+DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 qemu-nbd.8 qmp-commands.txt
 ifdef CONFIG_VIRTFS
 DOCS+=fsdev/virtfs-proxy-helper.1
 endif
@@ -115,13 +127,30 @@ defconfig:
 
 ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/Makefile.objs
+endif
+
+dummy := $(call unnest-vars,, \
+                stub-obj-y \
+                util-obj-y \
+                qga-obj-y \
+                qga-vss-dll-obj-y \
+                block-obj-y \
+                block-obj-m \
+                common-obj-y \
+                common-obj-m)
+
+ifneq ($(wildcard config-host.mak),)
 include $(SRC_PATH)/tests/Makefile
 endif
 ifeq ($(CONFIG_SMARTCARD_NSS),y)
 include $(SRC_PATH)/libcacard/Makefile
 endif
 
-all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all
+all: $(DOCS) $(TOOLS) $(HELPERS-y) recurse-all modules
+
+vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
+
+vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
 
 config-host.h: config-host.h-timestamp
 config-host.h-timestamp: config-host.mak
@@ -131,6 +160,7 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx
 SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
 SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES))
 
+$(SOFTMMU_SUBDIR_RULES): $(block-obj-y)
 $(SOFTMMU_SUBDIR_RULES): config-all-devices.mak
 
 subdir-%:
@@ -168,7 +198,9 @@ recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES)
 bt-host.o: QEMU_CFLAGS += $(BLUEZ_CFLAGS)
 
 $(BUILD_DIR)/version.o: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h | $(BUILD_DIR)/version.lo
+	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.o")
 $(BUILD_DIR)/version.lo: $(SRC_PATH)/version.rc $(BUILD_DIR)/config-host.h
+	$(call quiet-command,$(WINDRES) -I$(BUILD_DIR) -o $@ $<,"  RC    version.lo")
 
 Makefile: $(version-obj-y) $(version-lobj-y)
 
@@ -178,6 +210,9 @@ Makefile: $(version-obj-y) $(version-lobj-y)
 libqemustub.a: $(stub-obj-y)
 libqemuutil.a: $(util-obj-y) qapi-types.o qapi-visit.o
 
+block-modules = $(foreach o,$(block-obj-m),"$(basename $(subst /,-,$o))",) NULL
+util/module.o-cflags = -D'CONFIG_BLOCK_MODULES=$(block-modules)'
+
 ######################################################################
 
 qemu-img.o: qemu-img-cmds.h
@@ -231,10 +266,10 @@ clean:
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
 	rm -f qemu-options.def
-	find . -name '*.[oda]' -type f -exec rm -f {} +
-	find . -name '*.l[oa]' -type f -exec rm -f {} +
-	rm -f $(TOOLS) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
-	rm -Rf .libs
+	find . \( -name '*.l[oa]' -o -name '*.so' -o -name '*.dll' -o -name '*.mo' -o -name '*.[oda]' \) -type f -exec rm {} +
+	rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) qemu-ga TAGS cscope.* *.pod *~ */*~
+	rm -f fsdev/*.pod
+	rm -rf .libs */.libs
 	rm -f qemu-img-cmds.h
 	@# May not be present in GENERATED_HEADERS
 	rm -f trace/generated-tracers-dtrace.dtrace*
@@ -243,7 +278,6 @@ clean:
 	rm -f $(foreach f,$(GENERATED_SOURCES),$(f) $(f)-timestamp)
 	rm -rf qapi-generated
 	rm -rf qga/qapi-generated
-	$(MAKE) -C tests/tcg clean
 	for d in $(ALL_SUBDIRS); do \
 	if test -d $$d; then $(MAKE) -C $$d $@ || exit 1; fi; \
 	rm -f $$d/qemu-options.def; \
@@ -259,6 +293,7 @@ qemu-%.tar.bz2:
 distclean: clean
 	rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
 	rm -f config-all-devices.mak config-all-disas.mak
+	rm -f po/*.mo
 	rm -f roms/seabios/config.mak roms/vgabios/config.mak
 	rm -f qemu-doc.info qemu-doc.aux qemu-doc.cp qemu-doc.cps qemu-doc.dvi
 	rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys
@@ -270,19 +305,20 @@ distclean: clean
 	for d in $(TARGET_DIRS); do \
 	rm -rf $$d || exit 1 ; \
         done
+	rm -Rf .sdk
 	if test -f pixman/config.log; then make -C pixman distclean; fi
 	if test -f dtc/version_gen.h; then make $(DTC_MAKE_ARGS) clean; fi
 
 KEYMAPS=da     en-gb  et  fr     fr-ch  is  lt  modifiers  no  pt-br  sv \
 ar      de     en-us  fi  fr-be  hr     it  lv  nl         pl  ru     th \
 common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr \
-bepo
+bepo    cz
 
 ifdef INSTALL_BLOBS
-BLOBS=bios.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
+BLOBS=bios.bin bios-256k.bin sgabios.bin vgabios.bin vgabios-cirrus.bin \
 vgabios-stdvga.bin vgabios-vmware.bin vgabios-qxl.bin \
 acpi-dsdt.aml q35-acpi-dsdt.aml \
-ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc \
+ppc_rom.bin openbios-sparc32 openbios-sparc64 openbios-ppc QEMU,tcx.bin QEMU,cgthree.bin \
 pxe-e1000.rom pxe-eepro100.rom pxe-ne2k_pci.rom \
 pxe-pcnet.rom pxe-rtl8139.rom pxe-virtio.rom \
 efi-e1000.rom efi-eepro100.rom efi-ne2k_pci.rom \
@@ -301,7 +337,7 @@ endif
 install-doc: $(DOCS)
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_docdir)"
 	$(INSTALL_DATA) qemu-doc.html  qemu-tech.html "$(DESTDIR)$(qemu_docdir)"
-	$(INSTALL_DATA) QMP/qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
+	$(INSTALL_DATA) qmp-commands.txt "$(DESTDIR)$(qemu_docdir)"
 ifdef CONFIG_POSIX
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1"
 	$(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1"
@@ -338,6 +374,12 @@ install-datadir install-localstatedir
 ifneq ($(TOOLS),)
 	$(INSTALL_PROG) $(STRIP_OPT) $(TOOLS) "$(DESTDIR)$(bindir)"
 endif
+ifneq ($(CONFIG_MODULES),)
+	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
+	for s in $(patsubst %.mo,%$(DSOSUF),$(modules-m)); do \
+		$(INSTALL_PROG) $(STRIP_OPT) $$s "$(DESTDIR)$(qemu_moddir)/$$(echo $$s | tr / -)"; \
+	done
+endif
 ifneq ($(HELPERS-y),)
 	$(INSTALL_DIR) "$(DESTDIR)$(libexecdir)"
 	$(INSTALL_PROG) $(STRIP_OPT) $(HELPERS-y) "$(DESTDIR)$(libexecdir)"
@@ -355,7 +397,7 @@ endif
 		$(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \
 	done
 	for d in $(TARGET_DIRS); do \
-	$(MAKE) -C $$d $@ || exit 1 ; \
+	$(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
         done
 
 # various test targets
@@ -395,7 +437,7 @@ qemu-options.texi: $(SRC_PATH)/qemu-options.hx
 qemu-monitor.texi: $(SRC_PATH)/hmp-commands.hx
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"  GEN   $@")
 
-QMP/qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
+qmp-commands.txt: $(SRC_PATH)/qmp-commands.hx
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -q < $< > $@,"  GEN   $@")
 
 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx
diff --git a/Makefile.objs b/Makefile.objs
index f46a4cd..a6e0e2a 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -19,11 +19,8 @@ block-obj-y += qemu-coroutine.o qemu-coroutine-lock.o qemu-coroutine-io.o
 block-obj-y += qemu-coroutine-sleep.o
 block-obj-y += coroutine-$(CONFIG_COROUTINE_BACKEND).o
 
-ifeq ($(CONFIG_VIRTIO)$(CONFIG_VIRTFS)$(CONFIG_PCI),yyy)
-# Lots of the fsdev/9pcode is pulled in by vl.c via qemu_fsdev_add.
-# only pull in the actual virtio-9p device if we also enabled virtio.
-CONFIG_REALLY_VIRTFS=y
-endif
+block-obj-m = block/
+
 
 ######################################################################
 # smartcard
@@ -41,9 +38,9 @@ libcacard-y += libcacard/vcardt.o
 # single QEMU executable should support all CPUs and machines.
 
 ifeq ($(CONFIG_SOFTMMU),y)
-common-obj-y = $(block-obj-y) blockdev.o blockdev-nbd.o block/
+common-obj-y = blockdev.o blockdev-nbd.o block/
+common-obj-y += iothread.o
 common-obj-y += net/
-common-obj-y += readline.o
 common-obj-y += qdev-monitor.o device-hotplug.o
 common-obj-$(CONFIG_WIN32) += os-win32.o
 common-obj-$(CONFIG_POSIX) += os-posix.o
@@ -51,6 +48,8 @@ common-obj-$(CONFIG_POSIX) += os-posix.o
 common-obj-$(CONFIG_LINUX) += fsdev/
 
 common-obj-y += migration.o migration-tcp.o
+common-obj-y += vmstate.o
+common-obj-y += qemu-file.o
 common-obj-$(CONFIG_RDMA) += migration-rdma.o
 common-obj-y += qemu-char.o #aio.o
 common-obj-y += block-migration.o
@@ -109,17 +108,4 @@ version-lobj-$(CONFIG_WIN32) += $(BUILD_DIR)/version.lo
 # FIXME: a few definitions from qapi-types.o/qapi-visit.o are needed
 # by libqemuutil.a.  These should be moved to a separate .json schema.
 qga-obj-y = qga/ qapi-types.o qapi-visit.o
-
-vl.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-
-vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
-
-QEMU_CFLAGS+=$(GLIB_CFLAGS)
-
-nested-vars += \
-	stub-obj-y \
-	util-obj-y \
-	qga-obj-y \
-	block-obj-y \
-	common-obj-y
-dummy := $(call unnest-vars)
+qga-vss-dll-obj-y = qga/
diff --git a/Makefile.target b/Makefile.target
index 9a49852..6d8fde8 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -70,10 +70,6 @@ all: $(PROGS) stap
 # Dummy command so that make thinks it has done something
 	@true
 
-CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
-CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
-CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
-
 #########################################################
 # cpu emulator library
 obj-y = exec.o translate-all.o cpu-exec.o
@@ -83,8 +79,8 @@ obj-$(CONFIG_TCG_INTERPRETER) += disas/tci.o
 obj-y += fpu/softfloat.o
 obj-y += target-$(TARGET_BASE_ARCH)/
 obj-y += disas.o
-obj-$(CONFIG_GDBSTUB_XML) += gdbstub-xml.o
-obj-$(CONFIG_NO_KVM) += kvm-stub.o
+obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o
+obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o
 
 #########################################################
 # Linux user emulator target
@@ -124,8 +120,10 @@ obj-y += dump.o
 LIBS+=$(libs_softmmu)
 
 # xen support
-obj-$(CONFIG_XEN) += xen-all.o xen-mapcache.o
-obj-$(CONFIG_NO_XEN) += xen-stub.o
+obj-$(CONFIG_XEN) += xen-common.o
+obj-$(CONFIG_XEN_I386) += xen-hvm.o xen-mapcache.o
+obj-$(call lnot,$(CONFIG_XEN)) += xen-common-stub.o
+obj-$(call lnot,$(CONFIG_XEN_I386)) += xen-hvm-stub.o
 
 # Hardware support
 ifeq ($(TARGET_NAME), sparc64)
@@ -134,8 +132,6 @@ else
 obj-y += hw/$(TARGET_BASE_ARCH)/
 endif
 
-main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-
 GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
 
 endif # CONFIG_SOFTMMU
@@ -143,13 +139,26 @@ endif # CONFIG_SOFTMMU
 # Workaround for http://gcc.gnu.org/PR55489, see configure.
 %/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
 
-nested-vars += obj-y
+dummy := $(call unnest-vars,,obj-y)
 
-# This resolves all nested paths, so it must come last
+# we are making another call to unnest-vars with different vars, protect obj-y,
+# it can be overriden in subdir Makefile.objs
+obj-y-save := $(obj-y)
+
+block-obj-y :=
+common-obj-y :=
 include $(SRC_PATH)/Makefile.objs
+dummy := $(call unnest-vars,.., \
+               block-obj-y \
+               block-obj-m \
+               common-obj-y \
+               common-obj-m)
+
+# Now restore obj-y
+obj-y := $(obj-y-save)
 
-all-obj-y = $(obj-y)
-all-obj-y += $(addprefix ../, $(common-obj-y))
+all-obj-y = $(obj-y) $(common-obj-y)
+all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
 
 ifndef CONFIG_HAIKU
 LIBS+=-lm
diff --git a/QMP/README b/QMP/README
deleted file mode 100644
index c95a08c..0000000
--- a/QMP/README
+++ /dev/null
@@ -1,88 +0,0 @@
-                          QEMU Monitor Protocol
-                          =====================
-
-Introduction
--------------
-
-The QEMU Monitor Protocol (QMP) allows applications to communicate with
-QEMU's Monitor.
-
-QMP is JSON[1] based and currently has the following features:
-
-- Lightweight, text-based, easy to parse data format
-- Asynchronous messages support (ie. events)
-- Capabilities Negotiation
-
-For detailed information on QMP's usage, please, refer to the following files:
-
-o qmp-spec.txt      QEMU Monitor Protocol current specification
-o qmp-commands.txt  QMP supported commands (auto-generated at build-time)
-o qmp-events.txt    List of available asynchronous events
-
-There is also a simple Python script called 'qmp-shell' available.
-
-IMPORTANT: It's strongly recommended to read the 'Stability Considerations'
-section in the qmp-commands.txt file before making any serious use of QMP.
-
-
-[1] http://www.json.org
-
-Usage
------
-
-To enable QMP, you need a QEMU monitor instance in "control mode". There are
-two ways of doing this.
-
-The simplest one is using the '-qmp' command-line option. The following
-example makes QMP available on localhost port 4444:
-
-  $ qemu [...] -qmp tcp:localhost:4444,server
-
-However, in order to have more complex combinations, like multiple monitors,
-the '-mon' command-line option should be used along with the '-chardev' one.
-For instance, the following example creates one user monitor on stdio and one
-QMP monitor on localhost port 4444.
-
-   $ qemu [...] -chardev stdio,id=mon0 -mon chardev=mon0,mode=readline \
-                -chardev socket,id=mon1,host=localhost,port=4444,server \
-                -mon chardev=mon1,mode=control
-
-Please, refer to QEMU's manpage for more information.
-
-Simple Testing
---------------
-
-To manually test QMP one can connect with telnet and issue commands by hand:
-
-$ telnet localhost 4444
-Trying 127.0.0.1...
-Connected to localhost.
-Escape character is '^]'.
-{"QMP": {"version": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}, "capabilities": []}}
-{ "execute": "qmp_capabilities" }
-{"return": {}}
-{ "execute": "query-version" }
-{"return": {"qemu": {"micro": 50, "minor": 13, "major": 0}, "package": ""}}
-
-Development Process
--------------------
-
-When changing QMP's interface (by adding new commands, events or modifying
-existing ones) it's mandatory to update the relevant documentation, which is
-one (or more) of the files listed in the 'Introduction' section*.
-
-Also, it's strongly recommended to send the documentation patch first, before
-doing any code change. This is so because:
-
-  1. Avoids the code dictating the interface
-
-  2. Review can improve your interface.  Letting that happen before
-     you implement it can save you work.
-
-* The qmp-commands.txt file is generated from the qmp-commands.hx one, which
-  is the file that should be edited.
-
-Homepage
---------
-
-http://wiki.qemu.org/QMP
diff --git a/QMP/qemu-ga-client b/QMP/qemu-ga-client
deleted file mode 100755
index 46676c3..0000000
--- a/QMP/qemu-ga-client
+++ /dev/null
@@ -1,299 +0,0 @@
-#!/usr/bin/python
-


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscTN-0006za-PX; Thu, 05 Jun 2014 18:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTM-0006zP-2k
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:08 +0000
Received: from [85.158.139.211:40398] by server-10.bemta-5.messagelabs.com id
	B7/67-24945-3E7B0935; Thu, 05 Jun 2014 18:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1401993185!8338240!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25092 invoked from network); 5 Jun 2014 18:33:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTH-0003XH-Oj
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTH-000546-BH
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:03 +0000
Date: Thu, 05 Jun 2014 18:33:03 +0000
Message-Id: <E1WscTH-000546-BH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7fe67ca553320251398ccc56f8a9c95f13782a9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:09:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:09:27 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 98f73d9..2583afa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -760,21 +760,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:33:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscTN-0006za-PX; Thu, 05 Jun 2014 18:33:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTM-0006zP-2k
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:08 +0000
Received: from [85.158.139.211:40398] by server-10.bemta-5.messagelabs.com id
	B7/67-24945-3E7B0935; Thu, 05 Jun 2014 18:33:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1401993185!8338240!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25092 invoked from network); 5 Jun 2014 18:33:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTH-0003XH-Oj
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTH-000546-BH
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:03 +0000
Date: Thu, 05 Jun 2014 18:33:03 +0000
Message-Id: <E1WscTH-000546-BH@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7fe67ca553320251398ccc56f8a9c95f13782a9b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:09:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:09:27 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 98f73d9..2583afa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -760,21 +760,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscTX-00070Q-SB; Thu, 05 Jun 2014 18:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTW-00070B-9L
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:18 +0000
Received: from [85.158.139.211:40906] by server-10.bemta-5.messagelabs.com id
	EA/97-24945-DE7B0935; Thu, 05 Jun 2014 18:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1401993195!8339880!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2989 invoked from network); 5 Jun 2014 18:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTT-0003XK-Ol
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTT-00054U-KJ
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:15 +0000
Date: Thu, 05 Jun 2014 18:33:15 +0000
Message-Id: <E1WscTT-00054U-KJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: fix mask applied to DMIBAR
	in desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c5a50b46b1c7e2c112cd97854abf8b9e6538bc46
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:10:36 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:10:36 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: f8ecf31c31906552522c2a1b0d1cada07d78876e
    master date: 2014-05-26 12:28:46 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index d917b2f..33f3942 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000UL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscTX-00070Q-SB; Thu, 05 Jun 2014 18:33:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTW-00070B-9L
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:18 +0000
Received: from [85.158.139.211:40906] by server-10.bemta-5.messagelabs.com id
	EA/97-24945-DE7B0935; Thu, 05 Jun 2014 18:33:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1401993195!8339880!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2989 invoked from network); 5 Jun 2014 18:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTT-0003XK-Ol
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTT-00054U-KJ
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:15 +0000
Date: Thu, 05 Jun 2014 18:33:15 +0000
Message-Id: <E1WscTT-00054U-KJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: fix mask applied to DMIBAR
	in desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c5a50b46b1c7e2c112cd97854abf8b9e6538bc46
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:10:36 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:10:36 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: f8ecf31c31906552522c2a1b0d1cada07d78876e
    master date: 2014-05-26 12:28:46 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index d917b2f..33f3942 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000UL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18: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.xen.org>)
	id 1WscTh-00071r-Uw; Thu, 05 Jun 2014 18:33:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTg-00071f-Du
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:28 +0000
Received: from [193.109.254.147:54426] by server-2.bemta-14.messagelabs.com id
	B0/80-21684-7F7B0935; Thu, 05 Jun 2014 18:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1401993206!9349734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28957 invoked from network); 5 Jun 2014 18:33:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTd-0003XT-T8
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTd-00055F-S2
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:25 +0000
Date: Thu, 05 Jun 2014 18:33:25 +0000
Message-Id: <E1WscTd-00055F-S2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 513b7a761012ed3057c4d3e330067d58a7bd960d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:11:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:11:29 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6b4d71d028f445cba7426a144751fddc8bfdd67b
    master date: 2014-05-28 09:50:33 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 1294561..5e02ac8 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18: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.xen.org>)
	id 1WscTh-00071r-Uw; Thu, 05 Jun 2014 18:33:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTg-00071f-Du
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:28 +0000
Received: from [193.109.254.147:54426] by server-2.bemta-14.messagelabs.com id
	B0/80-21684-7F7B0935; Thu, 05 Jun 2014 18:33:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1401993206!9349734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28957 invoked from network); 5 Jun 2014 18:33:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTd-0003XT-T8
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTd-00055F-S2
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:25 +0000
Date: Thu, 05 Jun 2014 18:33:25 +0000
Message-Id: <E1WscTd-00055F-S2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 513b7a761012ed3057c4d3e330067d58a7bd960d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:11:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:11:29 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6b4d71d028f445cba7426a144751fddc8bfdd67b
    master date: 2014-05-28 09:50:33 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 1294561..5e02ac8 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscTs-00073M-1Q; Thu, 05 Jun 2014 18:33:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTq-000739-JK
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:38 +0000
Received: from [85.158.143.35:6026] by server-3.bemta-4.messagelabs.com id
	3A/D9-13602-108B0935; Thu, 05 Jun 2014 18:33:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1401993216!1493665!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5276 invoked from network); 5 Jun 2014 18:33:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTo-0003Xb-58
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTn-00055f-Vs
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:36 +0000
Date: Thu, 05 Jun 2014 18:33:35 +0000
Message-Id: <E1WscTn-00055f-Vs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: don't use VA for cache flush
	when also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 558d841bbe02448217fa3bb253ac8b6565c112e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:12:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:12:08 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscTs-00073M-1Q; Thu, 05 Jun 2014 18:33:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTq-000739-JK
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:38 +0000
Received: from [85.158.143.35:6026] by server-3.bemta-4.messagelabs.com id
	3A/D9-13602-108B0935; Thu, 05 Jun 2014 18:33:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1401993216!1493665!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5276 invoked from network); 5 Jun 2014 18:33:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTo-0003Xb-58
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTn-00055f-Vs
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:36 +0000
Date: Thu, 05 Jun 2014 18:33:35 +0000
Message-Id: <E1WscTn-00055f-Vs@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: don't use VA for cache flush
	when also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 558d841bbe02448217fa3bb253ac8b6565c112e0
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:12:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:12:08 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18: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.xen.org>)
	id 1WscU3-00075S-4H; Thu, 05 Jun 2014 18:33:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscU1-00074z-1A
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:49 +0000
Received: from [193.109.254.147:55395] by server-4.bemta-14.messagelabs.com id
	FF/11-02781-C08B0935; Thu, 05 Jun 2014 18:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1401993226!9392104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23851 invoked from network); 5 Jun 2014 18:33:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTy-0003Xh-By
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTy-00056a-9W
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:46 +0000
Date: Thu, 05 Jun 2014 18:33:46 +0000
Message-Id: <E1WscTy-00056a-9W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb5f0c280b252597b052894498c9fac2037cedd7
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 3 12:12:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:12:43 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
    master date: 2014-05-28 10:07:50 +0200
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 1895a78..f36aebc 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:33:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18: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.xen.org>)
	id 1WscU3-00075S-4H; Thu, 05 Jun 2014 18:33:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscU1-00074z-1A
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:49 +0000
Received: from [193.109.254.147:55395] by server-4.bemta-14.messagelabs.com id
	FF/11-02781-C08B0935; Thu, 05 Jun 2014 18:33:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1401993226!9392104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23851 invoked from network); 5 Jun 2014 18:33:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTy-0003Xh-By
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscTy-00056a-9W
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:46 +0000
Date: Thu, 05 Jun 2014 18:33:46 +0000
Message-Id: <E1WscTy-00056a-9W@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fb5f0c280b252597b052894498c9fac2037cedd7
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 3 12:12:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:12:43 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
    master date: 2014-05-28 10:07:50 +0200
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 1895a78..f36aebc 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:34:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscUC-000774-78; Thu, 05 Jun 2014 18:34:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscUB-00076o-04
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:59 +0000
Received: from [85.158.143.35:3226] by server-3.bemta-4.messagelabs.com id
	50/1A-13602-618B0935; Thu, 05 Jun 2014 18:33:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1401993236!9563350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18719 invoked from network); 5 Jun 2014 18:33:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscU8-0003Xq-Hz
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscU8-00056w-G0
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:56 +0000
Date: Thu, 05 Jun 2014 18:33:56 +0000
Message-Id: <E1WscU8-00056w-G0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b7132d4f862dbfce6fee59c920f050c2e135340
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 16:09:55 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 16:09:55 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
    master date: 2014-06-03 15:17:14 +0200
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 677fbcd..5048c29 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -289,20 +289,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 05 18:34:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 05 Jun 2014 18:34:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WscUC-000774-78; Thu, 05 Jun 2014 18:34:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscUB-00076o-04
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:59 +0000
Received: from [85.158.143.35:3226] by server-3.bemta-4.messagelabs.com id
	50/1A-13602-618B0935; Thu, 05 Jun 2014 18:33:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1401993236!9563350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18719 invoked from network); 5 Jun 2014 18:33:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	5 Jun 2014 18:33:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscU8-0003Xq-Hz
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WscU8-00056w-G0
	for xen-changelog@lists.xensource.com; Thu, 05 Jun 2014 18:33:56 +0000
Date: Thu, 05 Jun 2014 18:33:56 +0000
Message-Id: <E1WscU8-00056w-G0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9b7132d4f862dbfce6fee59c920f050c2e135340
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 16:09:55 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 16:09:55 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
    master date: 2014-06-03 15:17:14 +0200
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 677fbcd..5048c29 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -289,20 +289,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAMM-0005E9-14; Sat, 07 Jun 2014 06:44:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMK-0005Dz-8t
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:08 +0000
Received: from [193.109.254.147:62590] by server-8.bemta-14.messagelabs.com id
	4C/BB-01877-7B4B2935; Sat, 07 Jun 2014 06:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1402123445!9718853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1183 invoked from network); 7 Jun 2014 06:44:06 -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;
	7 Jun 2014 06:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMH-0000cM-3o
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMH-0005HS-0c
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:05 +0000
Date: Sat, 07 Jun 2014 06:44:05 +0000
Message-Id: <E1WtAMH-0005HS-0c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: check permissions when
	copying to/from guest virtual addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aad3c8917dd1013477b9d081cc38fd648551c5fd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:56 2014 +0100

    xen: arm: check permissions when copying to/from guest virtual addresses
    
    In particular we need to make sure the guest has write permissions to buffers
    which it passes as output buffers for hypercalls, otherwise the guest can
    overwrite memory which it shouldn't be able to write (like r/o grant table
    mappings).
    
    This is XSA-98.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c      |    2 +-
 xen/arch/arm/guestcopy.c         |    6 +++---
 xen/arch/arm/kernel.c            |    2 +-
 xen/arch/arm/traps.c             |    2 +-
 xen/include/asm-arm/arm32/page.h |    7 +++++--
 xen/include/asm-arm/arm64/page.h |    7 +++++--
 xen/include/asm-arm/mm.h         |    4 ++--
 xen/include/asm-arm/page.h       |    4 ++++
 8 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 5ca2f15..3da6b83 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -967,7 +967,7 @@ static void initrd_load(struct kernel_info *kinfo)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to translate guest address");
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index cea5f97..d1fddec 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -17,7 +17,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -62,7 +62,7 @@ unsigned long raw_clear_guest(void *to, unsigned len)
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -92,7 +92,7 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g) )
+        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 1e3107d..69c7d43 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -141,7 +141,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to map translate guest address");
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d1b2595..04b8e61 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -837,7 +837,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys) )
+    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
     {
         printk("Failed to convert stack to physical address\n");
         return;
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index b8221ca..80d5c36 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -90,11 +90,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp;
     tmp = READ_CP64(PAR);
-    WRITE_CP32(va, ATS12NSOPR);
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        WRITE_CP32(va, ATS12NSOPW);
+    else
+        WRITE_CP32(va, ATS12NSOPR);
     isb(); /* Ensure result is available. */
     par = READ_CP64(PAR);
     WRITE_CP64(tmp, PAR);
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 3352821..3922d87 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -83,11 +83,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp = READ_SYSREG64(PAR_EL1);
 
-    asm volatile ("at s12e1r, %0;" : : "r" (va));
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        asm volatile ("at s12e1r, %0;" : : "r" (va));
+    else
+        asm volatile ("at s12e1w, %0;" : : "r" (va));
     isb();
     par = READ_SYSREG64(PAR_EL1);
     WRITE_SYSREG64(tmp, PAR_EL1);
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index b8d4e7d..d0e5cb4 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -233,9 +233,9 @@ static inline void *maddr_to_virt(paddr_t ma)
 }
 #endif
 
-static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa)
+static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa, unsigned int flags)
 {
-    uint64_t par = gva_to_ma_par(va);
+    uint64_t par = gva_to_ma_par(va, flags);
     if ( par & PAR_F )
         return -EFAULT;
     *pa = (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index e00be9e..84562ec 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,6 +73,10 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
+/* Flags for gvirt_to_maddr */
+#define GV2M_READ  (0u<<0)
+#define GV2M_WRITE (1u<<0)
+
 #ifndef __ASSEMBLY__
 
 #include <xen/types.h>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAMM-0005E9-14; Sat, 07 Jun 2014 06:44:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMK-0005Dz-8t
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:08 +0000
Received: from [193.109.254.147:62590] by server-8.bemta-14.messagelabs.com id
	4C/BB-01877-7B4B2935; Sat, 07 Jun 2014 06:44:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-27.messagelabs.com!1402123445!9718853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1183 invoked from network); 7 Jun 2014 06:44:06 -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;
	7 Jun 2014 06:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMH-0000cM-3o
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMH-0005HS-0c
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:05 +0000
Date: Sat, 07 Jun 2014 06:44:05 +0000
Message-Id: <E1WtAMH-0005HS-0c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: check permissions when
	copying to/from guest virtual addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aad3c8917dd1013477b9d081cc38fd648551c5fd
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:56 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:56 2014 +0100

    xen: arm: check permissions when copying to/from guest virtual addresses
    
    In particular we need to make sure the guest has write permissions to buffers
    which it passes as output buffers for hypercalls, otherwise the guest can
    overwrite memory which it shouldn't be able to write (like r/o grant table
    mappings).
    
    This is XSA-98.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c      |    2 +-
 xen/arch/arm/guestcopy.c         |    6 +++---
 xen/arch/arm/kernel.c            |    2 +-
 xen/arch/arm/traps.c             |    2 +-
 xen/include/asm-arm/arm32/page.h |    7 +++++--
 xen/include/asm-arm/arm64/page.h |    7 +++++--
 xen/include/asm-arm/mm.h         |    4 ++--
 xen/include/asm-arm/page.h       |    4 ++++
 8 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 5ca2f15..3da6b83 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -967,7 +967,7 @@ static void initrd_load(struct kernel_info *kinfo)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to translate guest address");
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index cea5f97..d1fddec 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -17,7 +17,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -62,7 +62,7 @@ unsigned long raw_clear_guest(void *to, unsigned len)
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -92,7 +92,7 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g) )
+        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 1e3107d..69c7d43 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -141,7 +141,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to map translate guest address");
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d1b2595..04b8e61 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -837,7 +837,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys) )
+    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
     {
         printk("Failed to convert stack to physical address\n");
         return;
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index b8221ca..80d5c36 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -90,11 +90,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp;
     tmp = READ_CP64(PAR);
-    WRITE_CP32(va, ATS12NSOPR);
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        WRITE_CP32(va, ATS12NSOPW);
+    else
+        WRITE_CP32(va, ATS12NSOPR);
     isb(); /* Ensure result is available. */
     par = READ_CP64(PAR);
     WRITE_CP64(tmp, PAR);
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 3352821..3922d87 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -83,11 +83,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp = READ_SYSREG64(PAR_EL1);
 
-    asm volatile ("at s12e1r, %0;" : : "r" (va));
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        asm volatile ("at s12e1r, %0;" : : "r" (va));
+    else
+        asm volatile ("at s12e1w, %0;" : : "r" (va));
     isb();
     par = READ_SYSREG64(PAR_EL1);
     WRITE_SYSREG64(tmp, PAR_EL1);
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index b8d4e7d..d0e5cb4 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -233,9 +233,9 @@ static inline void *maddr_to_virt(paddr_t ma)
 }
 #endif
 
-static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa)
+static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa, unsigned int flags)
 {
-    uint64_t par = gva_to_ma_par(va);
+    uint64_t par = gva_to_ma_par(va, flags);
     if ( par & PAR_F )
         return -EFAULT;
     *pa = (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index e00be9e..84562ec 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,6 +73,10 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
+/* Flags for gvirt_to_maddr */
+#define GV2M_READ  (0u<<0)
+#define GV2M_WRITE (1u<<0)
+
 #ifndef __ASSEMBLY__
 
 #include <xen/types.h>
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAMX-0005F8-3u; Sat, 07 Jun 2014 06:44:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMV-0005Ev-47
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:19 +0000
Received: from [85.158.139.211:8758] by server-4.bemta-5.messagelabs.com id
	55/A6-30750-2C4B2935; Sat, 07 Jun 2014 06:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1402123456!5267196!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29704 invoked from network); 7 Jun 2014 06:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Jun 2014 06:44:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMR-0000cP-PS
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMR-0005Hq-Kv
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:15 +0000
Date: Sat, 07 Jun 2014 06:44:15 +0000
Message-Id: <E1WtAMR-0005Hq-Kv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: ensure we hold a
	reference to guest pages while we copy to/from them
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 78919a2d02e5dabbcb1e04b53932ce710ed5c55a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:58 2014 +0100

    xen: arm: ensure we hold a reference to guest pages while we copy to/from them
    
    This at once:
     - prevents the page from being reassigned under our feet
     - ensures that the domain owns the page, which stops a domain from giving a
       grant mapping, MMIO region, other non-RAM as a hypercall input/output.
    
    We need to hold the p2m lock while doing the lookup until we have the
    reference.
    
    This also requires that during domain 0 building current is set to an actual
    dom0 vcpu, so take care of this at the same time as the p2m is temporarily
    loaded.
    
    Lastly when dumping the guest stack we need to make sure that the guest hasn't
    pointed its sp off into the weeds and/or misaligned it, which could lead to
    hypervisor traps. Solve this by using the new function and checking alignment
    first.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    [ ijc -- backported to 4.4, using p2m_load_VTTBR ]
---
 xen/arch/arm/domain_build.c |    7 +++++++
 xen/arch/arm/guestcopy.c    |   26 +++++++++++++++++---------
 xen/arch/arm/p2m.c          |   28 ++++++++++++++++++++++++++++
 xen/arch/arm/traps.c        |   15 +++++++++++----
 xen/include/asm-arm/mm.h    |    3 +++
 xen/include/asm-arm/page.h  |    2 +-
 6 files changed, 67 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 3da6b83..c1497f8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -986,6 +986,7 @@ static void initrd_load(struct kernel_info *kinfo)
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
+    struct vcpu *saved_current;
     int rc, i, cpu;
 
     struct vcpu *v = d->vcpu[0];
@@ -1021,7 +1022,9 @@ int construct_dom0(struct domain *d)
         return rc;
 
     /* The following loads use the domain's p2m */
+    saved_current = current;
     p2m_load_VTTBR(d);
+    set_current(v);
 #ifdef CONFIG_ARM_64
     d->arch.type = kinfo.type;
     if ( is_pv32_domain(d) )
@@ -1039,6 +1042,10 @@ int construct_dom0(struct domain *d)
     initrd_load(&kinfo);
     dtb_load(&kinfo);
 
+    /* Now that we are done restore the original p2m and current. */
+    set_current(saved_current);
+    p2m_load_VTTBR(current->domain);
+
     discard_initial_modules();
 
     v->is_initialised = 1;
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d1fddec..0173597 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -1,6 +1,8 @@
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/domain_page.h>
+#include <xen/sched.h>
+#include <asm/current.h>
 
 #include <asm/mm.h>
 #include <asm/guest_access.h>
@@ -13,20 +15,22 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memcpy(p, from, size);
         if ( flush_dcache )
             clean_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
@@ -58,18 +62,20 @@ unsigned long raw_clear_guest(void *to, unsigned len)
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memset(p, 0x00, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         to += size;
         /*
@@ -88,19 +94,21 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
+        page = get_page_from_gva(current->domain, (vaddr_t) from, GV2M_READ);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += ((vaddr_t)from & (~PAGE_MASK));
 
         memcpy(to, p, size);
 
         unmap_domain_page(p);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index d00c882..7fd5920 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -655,6 +655,34 @@ unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
     return p >> PAGE_SHIFT;
 }
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+    struct page_info *page = NULL;
+    paddr_t maddr;
+
+    ASSERT(d == current->domain);
+
+    spin_lock(&p2m->lock);
+
+    if ( gvirt_to_maddr(va, &maddr, flags) )
+        goto err;
+
+    if ( !mfn_valid(maddr >> PAGE_SHIFT) )
+        goto err;
+
+    page = mfn_to_page(maddr >> PAGE_SHIFT);
+    ASSERT(page);
+
+    if ( unlikely(!get_page(page, d)) )
+        page = NULL;
+
+err:
+    spin_unlock(&p2m->lock);
+    return page;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 04b8e61..377f18f 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -777,7 +777,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 {
     int i;
     vaddr_t sp;
-    paddr_t stack_phys;
+    struct page_info *page;
     void *mapped;
     unsigned long *stack, addr;
 
@@ -837,13 +837,20 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
+    if ( sp & ( sizeof(long) - 1 ) )
+    {
+        printk("Stack is misaligned\n");
+        return;
+    }
+
+    page = get_page_from_gva(current->domain, sp, GV2M_READ);
+    if ( page == NULL )
     {
         printk("Failed to convert stack to physical address\n");
         return;
     }
 
-    mapped = map_domain_page(stack_phys >> PAGE_SHIFT);
+    mapped = __map_domain_page(page);
 
     stack = mapped + (sp & ~PAGE_MASK);
 
@@ -861,7 +868,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
         printk("Stack empty.");
     printk("\n");
     unmap_domain_page(mapped);
-
+    put_page(page);
 }
 
 #define STACK_BEFORE_EXCEPTION(regs) ((register_t*)(regs)->sp)
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index d0e5cb4..8bf179d 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -273,6 +273,9 @@ struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags);
+
 /*
  * The MPT (machine->physical mapping table) is an array of word-sized
  * values, indexed on machine frame number. It is expected that guest OSes
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 84562ec..c118309 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,7 +73,7 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
-/* Flags for gvirt_to_maddr */
+/* Flags for get_page_from_gva, gvirt_to_maddr etc */
 #define GV2M_READ  (0u<<0)
 #define GV2M_WRITE (1u<<0)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAMX-0005F8-3u; Sat, 07 Jun 2014 06:44:21 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMV-0005Ev-47
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:19 +0000
Received: from [85.158.139.211:8758] by server-4.bemta-5.messagelabs.com id
	55/A6-30750-2C4B2935; Sat, 07 Jun 2014 06:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1402123456!5267196!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29704 invoked from network); 7 Jun 2014 06:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Jun 2014 06:44:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMR-0000cP-PS
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMR-0005Hq-Kv
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:15 +0000
Date: Sat, 07 Jun 2014 06:44:15 +0000
Message-Id: <E1WtAMR-0005Hq-Kv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: ensure we hold a
	reference to guest pages while we copy to/from them
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 78919a2d02e5dabbcb1e04b53932ce710ed5c55a
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:58 2014 +0100

    xen: arm: ensure we hold a reference to guest pages while we copy to/from them
    
    This at once:
     - prevents the page from being reassigned under our feet
     - ensures that the domain owns the page, which stops a domain from giving a
       grant mapping, MMIO region, other non-RAM as a hypercall input/output.
    
    We need to hold the p2m lock while doing the lookup until we have the
    reference.
    
    This also requires that during domain 0 building current is set to an actual
    dom0 vcpu, so take care of this at the same time as the p2m is temporarily
    loaded.
    
    Lastly when dumping the guest stack we need to make sure that the guest hasn't
    pointed its sp off into the weeds and/or misaligned it, which could lead to
    hypervisor traps. Solve this by using the new function and checking alignment
    first.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
    [ ijc -- backported to 4.4, using p2m_load_VTTBR ]
---
 xen/arch/arm/domain_build.c |    7 +++++++
 xen/arch/arm/guestcopy.c    |   26 +++++++++++++++++---------
 xen/arch/arm/p2m.c          |   28 ++++++++++++++++++++++++++++
 xen/arch/arm/traps.c        |   15 +++++++++++----
 xen/include/asm-arm/mm.h    |    3 +++
 xen/include/asm-arm/page.h  |    2 +-
 6 files changed, 67 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 3da6b83..c1497f8 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -986,6 +986,7 @@ static void initrd_load(struct kernel_info *kinfo)
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
+    struct vcpu *saved_current;
     int rc, i, cpu;
 
     struct vcpu *v = d->vcpu[0];
@@ -1021,7 +1022,9 @@ int construct_dom0(struct domain *d)
         return rc;
 
     /* The following loads use the domain's p2m */
+    saved_current = current;
     p2m_load_VTTBR(d);
+    set_current(v);
 #ifdef CONFIG_ARM_64
     d->arch.type = kinfo.type;
     if ( is_pv32_domain(d) )
@@ -1039,6 +1042,10 @@ int construct_dom0(struct domain *d)
     initrd_load(&kinfo);
     dtb_load(&kinfo);
 
+    /* Now that we are done restore the original p2m and current. */
+    set_current(saved_current);
+    p2m_load_VTTBR(current->domain);
+
     discard_initial_modules();
 
     v->is_initialised = 1;
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d1fddec..0173597 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -1,6 +1,8 @@
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/domain_page.h>
+#include <xen/sched.h>
+#include <asm/current.h>
 
 #include <asm/mm.h>
 #include <asm/guest_access.h>
@@ -13,20 +15,22 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memcpy(p, from, size);
         if ( flush_dcache )
             clean_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
@@ -58,18 +62,20 @@ unsigned long raw_clear_guest(void *to, unsigned len)
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memset(p, 0x00, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         to += size;
         /*
@@ -88,19 +94,21 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
+        page = get_page_from_gva(current->domain, (vaddr_t) from, GV2M_READ);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += ((vaddr_t)from & (~PAGE_MASK));
 
         memcpy(to, p, size);
 
         unmap_domain_page(p);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index d00c882..7fd5920 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -655,6 +655,34 @@ unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
     return p >> PAGE_SHIFT;
 }
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+    struct page_info *page = NULL;
+    paddr_t maddr;
+
+    ASSERT(d == current->domain);
+
+    spin_lock(&p2m->lock);
+
+    if ( gvirt_to_maddr(va, &maddr, flags) )
+        goto err;
+
+    if ( !mfn_valid(maddr >> PAGE_SHIFT) )
+        goto err;
+
+    page = mfn_to_page(maddr >> PAGE_SHIFT);
+    ASSERT(page);
+
+    if ( unlikely(!get_page(page, d)) )
+        page = NULL;
+
+err:
+    spin_unlock(&p2m->lock);
+    return page;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 04b8e61..377f18f 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -777,7 +777,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 {
     int i;
     vaddr_t sp;
-    paddr_t stack_phys;
+    struct page_info *page;
     void *mapped;
     unsigned long *stack, addr;
 
@@ -837,13 +837,20 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
+    if ( sp & ( sizeof(long) - 1 ) )
+    {
+        printk("Stack is misaligned\n");
+        return;
+    }
+
+    page = get_page_from_gva(current->domain, sp, GV2M_READ);
+    if ( page == NULL )
     {
         printk("Failed to convert stack to physical address\n");
         return;
     }
 
-    mapped = map_domain_page(stack_phys >> PAGE_SHIFT);
+    mapped = __map_domain_page(page);
 
     stack = mapped + (sp & ~PAGE_MASK);
 
@@ -861,7 +868,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
         printk("Stack empty.");
     printk("\n");
     unmap_domain_page(mapped);
-
+    put_page(page);
 }
 
 #define STACK_BEFORE_EXCEPTION(regs) ((register_t*)(regs)->sp)
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index d0e5cb4..8bf179d 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -273,6 +273,9 @@ struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags);
+
 /*
  * The MPT (machine->physical mapping table) is an array of word-sized
  * values, indexed on machine frame number. It is expected that guest OSes
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 84562ec..c118309 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,7 +73,7 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
-/* Flags for gvirt_to_maddr */
+/* Flags for get_page_from_gva, gvirt_to_maddr etc */
 #define GV2M_READ  (0u<<0)
 #define GV2M_WRITE (1u<<0)
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06: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.xen.org>)
	id 1WtAMg-0005GQ-6a; Sat, 07 Jun 2014 06:44:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMe-0005GB-On
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:28 +0000
Received: from [85.158.143.35:26037] by server-2.bemta-4.messagelabs.com id
	BD/F2-06539-CC4B2935; Sat, 07 Jun 2014 06:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1402123466!9784832!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21595 invoked from network); 7 Jun 2014 06:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Jun 2014 06:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMc-0000cY-1g
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMb-0005Ii-V3
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:26 +0000
Date: Sat, 07 Jun 2014 06:44:25 +0000
Message-Id: <E1WtAMb-0005Ii-V3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: Move p2m context
	save/restore in a separate function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ca83a4bd3bf8d21886bccdd7c4710b798eec326
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Mar 19 15:43:37 2014 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:14:55 2014 +0100

    xen/arm: Move p2m context save/restore in a separate function
    
    Introduce p2m_{save,restore}_state to save/restore p2m context.
    
    The both functions will take care of:
        - VTTBR: contains the pointer to the domain P2M
        - Update HCR_RW if the domain is 64 bit
        - SCTLR: contains bit to know if the MMU is enabled or not
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 84ca4629d0aa71dc45c969f625d069373fb88828)
    [ ijc -- s/is_32bit_domain/is_pv32_domain ]
---
 xen/arch/arm/domain.c     |   21 +++------------------
 xen/arch/arm/p2m.c        |   25 +++++++++++++++++++++++++
 xen/include/asm-arm/p2m.h |    4 ++++
 3 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ba07846..c0c5af3 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -59,11 +59,12 @@ void idle_loop(void)
 
 static void ctxt_switch_from(struct vcpu *p)
 {
+    p2m_save_state(p);
+
     /* CP 15 */
     p->arch.csselr = READ_SYSREG(CSSELR_EL1);
 
     /* Control Registers */
-    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
     p->arch.cpacr = READ_SYSREG(CPACR_EL1);
 
     p->arch.contextidr = READ_SYSREG(CONTEXTIDR_EL1);
@@ -135,14 +136,7 @@ static void ctxt_switch_from(struct vcpu *p)
 
 static void ctxt_switch_to(struct vcpu *n)
 {
-    register_t hcr;
-
-    hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
-
-    p2m_load_VTTBR(n->domain);
-    isb();
+    p2m_restore_state(n);
 
     WRITE_SYSREG32(n->domain->arch.vpidr, VPIDR_EL2);
     WRITE_SYSREG(n->arch.vmpidr, VMPIDR_EL2);
@@ -190,7 +184,6 @@ static void ctxt_switch_to(struct vcpu *n)
     isb();
 
     /* Control Registers */
-    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
     WRITE_SYSREG(n->arch.cpacr, CPACR_EL1);
 
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
@@ -215,14 +208,6 @@ static void ctxt_switch_to(struct vcpu *n)
 
     isb();
 
-    if ( is_pv32_domain(n->domain) )
-        hcr &= ~HCR_RW;
-    else
-        hcr |= HCR_RW;
-
-    WRITE_SYSREG(hcr, HCR_EL2);
-    isb();
-
     /* This is could trigger an hardware interrupt from the virtual
      * timer. The interrupt needs to be injected into the guest. */
     WRITE_SYSREG32(n->arch.cntkctl, CNTKCTL_EL1);
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 7fd5920..e068f74 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -44,6 +44,31 @@ void p2m_load_VTTBR(struct domain *d)
     isb(); /* Ensure update is visible */
 }
 
+void p2m_save_state(struct vcpu *p)
+{
+    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
+}
+
+void p2m_restore_state(struct vcpu *n)
+{
+    register_t hcr;
+
+    hcr = READ_SYSREG(HCR_EL2);
+    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
+    isb();
+
+    p2m_load_VTTBR(n->domain);
+    isb();
+
+    if ( is_pv32_domain(n->domain) )
+        hcr &= ~HCR_RW;
+    else
+        hcr |= HCR_RW;
+
+    WRITE_SYSREG(hcr, HCR_EL2);
+    isb();
+}
+
 static int p2m_first_level_index(paddr_t addr)
 {
     /*
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 3b39c45..e1013c8 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -75,6 +75,10 @@ int p2m_alloc_table(struct domain *d);
 /* */
 void p2m_load_VTTBR(struct domain *d);
 
+/* Context switch */
+void p2m_save_state(struct vcpu *p);
+void p2m_restore_state(struct vcpu *n);
+
 /* Look up the MFN corresponding to a domain's PFN. */
 paddr_t p2m_lookup(struct domain *d, paddr_t gpfn, p2m_type_t *t);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06: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.xen.org>)
	id 1WtAMg-0005GQ-6a; Sat, 07 Jun 2014 06:44:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMe-0005GB-On
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:28 +0000
Received: from [85.158.143.35:26037] by server-2.bemta-4.messagelabs.com id
	BD/F2-06539-CC4B2935; Sat, 07 Jun 2014 06:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1402123466!9784832!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21595 invoked from network); 7 Jun 2014 06:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Jun 2014 06:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMc-0000cY-1g
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMb-0005Ii-V3
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:26 +0000
Date: Sat, 07 Jun 2014 06:44:25 +0000
Message-Id: <E1WtAMb-0005Ii-V3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: Move p2m context
	save/restore in a separate function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9ca83a4bd3bf8d21886bccdd7c4710b798eec326
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Mar 19 15:43:37 2014 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:14:55 2014 +0100

    xen/arm: Move p2m context save/restore in a separate function
    
    Introduce p2m_{save,restore}_state to save/restore p2m context.
    
    The both functions will take care of:
        - VTTBR: contains the pointer to the domain P2M
        - Update HCR_RW if the domain is 64 bit
        - SCTLR: contains bit to know if the MMU is enabled or not
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 84ca4629d0aa71dc45c969f625d069373fb88828)
    [ ijc -- s/is_32bit_domain/is_pv32_domain ]
---
 xen/arch/arm/domain.c     |   21 +++------------------
 xen/arch/arm/p2m.c        |   25 +++++++++++++++++++++++++
 xen/include/asm-arm/p2m.h |    4 ++++
 3 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index ba07846..c0c5af3 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -59,11 +59,12 @@ void idle_loop(void)
 
 static void ctxt_switch_from(struct vcpu *p)
 {
+    p2m_save_state(p);
+
     /* CP 15 */
     p->arch.csselr = READ_SYSREG(CSSELR_EL1);
 
     /* Control Registers */
-    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
     p->arch.cpacr = READ_SYSREG(CPACR_EL1);
 
     p->arch.contextidr = READ_SYSREG(CONTEXTIDR_EL1);
@@ -135,14 +136,7 @@ static void ctxt_switch_from(struct vcpu *p)
 
 static void ctxt_switch_to(struct vcpu *n)
 {
-    register_t hcr;
-
-    hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
-    isb();
-
-    p2m_load_VTTBR(n->domain);
-    isb();
+    p2m_restore_state(n);
 
     WRITE_SYSREG32(n->domain->arch.vpidr, VPIDR_EL2);
     WRITE_SYSREG(n->arch.vmpidr, VMPIDR_EL2);
@@ -190,7 +184,6 @@ static void ctxt_switch_to(struct vcpu *n)
     isb();
 
     /* Control Registers */
-    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
     WRITE_SYSREG(n->arch.cpacr, CPACR_EL1);
 
     WRITE_SYSREG(n->arch.contextidr, CONTEXTIDR_EL1);
@@ -215,14 +208,6 @@ static void ctxt_switch_to(struct vcpu *n)
 
     isb();
 
-    if ( is_pv32_domain(n->domain) )
-        hcr &= ~HCR_RW;
-    else
-        hcr |= HCR_RW;
-
-    WRITE_SYSREG(hcr, HCR_EL2);
-    isb();
-
     /* This is could trigger an hardware interrupt from the virtual
      * timer. The interrupt needs to be injected into the guest. */
     WRITE_SYSREG32(n->arch.cntkctl, CNTKCTL_EL1);
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 7fd5920..e068f74 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -44,6 +44,31 @@ void p2m_load_VTTBR(struct domain *d)
     isb(); /* Ensure update is visible */
 }
 
+void p2m_save_state(struct vcpu *p)
+{
+    p->arch.sctlr = READ_SYSREG(SCTLR_EL1);
+}
+
+void p2m_restore_state(struct vcpu *n)
+{
+    register_t hcr;
+
+    hcr = READ_SYSREG(HCR_EL2);
+    WRITE_SYSREG(hcr & ~HCR_VM, HCR_EL2);
+    isb();
+
+    p2m_load_VTTBR(n->domain);
+    isb();
+
+    if ( is_pv32_domain(n->domain) )
+        hcr &= ~HCR_RW;
+    else
+        hcr |= HCR_RW;
+
+    WRITE_SYSREG(hcr, HCR_EL2);
+    isb();
+}
+
 static int p2m_first_level_index(paddr_t addr)
 {
     /*
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index 3b39c45..e1013c8 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -75,6 +75,10 @@ int p2m_alloc_table(struct domain *d);
 /* */
 void p2m_load_VTTBR(struct domain *d);
 
+/* Context switch */
+void p2m_save_state(struct vcpu *p);
+void p2m_restore_state(struct vcpu *n);
+
 /* Look up the MFN corresponding to a domain's PFN. */
 paddr_t p2m_lookup(struct domain *d, paddr_t gpfn, p2m_type_t *t);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAMq-0005I3-98; Sat, 07 Jun 2014 06:44:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMo-0005Hk-Rl
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:39 +0000
Received: from [193.109.254.147:63366] by server-9.bemta-14.messagelabs.com id
	08/BE-03644-6D4B2935; Sat, 07 Jun 2014 06:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1402123476!9645221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26695 invoked from network); 7 Jun 2014 06:44:37 -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;
	7 Jun 2014 06:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMm-0000cg-7O
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMm-0005J9-5U
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:36 +0000
Date: Sat, 07 Jun 2014 06:44:36 +0000
Message-Id: <E1WtAMm-0005J9-5U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: Use p2m_restore_state in
	construct_dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b657cb9c00862b72a4ef8b0af996649d392f5fb7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Mar 19 15:43:38 2014 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:20:33 2014 +0100

    xen/arm: Use p2m_restore_state in construct_dom0
    
    The address translation functions used while building dom0 rely on certain EL1
    state being configured. In particular they are subject to the behaviour of
    SCTLR_EL1.M (stage 1 MMU enabled).
    
    The Xen (and Linux) boot protocol require that the kernel be entered with the
    MMU disabled but they don't say anything explicitly about exception levels
    other than the one which is active when entering the kernels. Arguably the
    protocol could be said to apply to all exception levels but in any case we
    should cope with this and setup the EL1 state as necessary.
    
    Fu Wei discovered this when booting Xen from grub.efi over UEFI, it's not
    clear whether grub or UEFI is responsible for leaving stage 1 MMU enabled.
    
    Use directly the newly created function p2m_restore_state to retrieve a
    correct EL1 state to translate an address.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Reported-by: Fu Wei <fu.wei@linaro.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit d6dd3a9ae7adead322e8ce96f83db96dce64c982)
    [ ijc -- adjusted because this and 278283cd0b81 were backported in the opposite
    	 order from their application to staging. The result is as if they had
             been backported in the correct order. ]
---
 xen/arch/arm/domain_build.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c1497f8..8cbd776 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1021,17 +1021,13 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    /* The following loads use the domain's p2m */
+    /*
+     * The following loads use the domain's p2m and require current to
+     * be a vcpu of the domain, temporarily switch
+     */
     saved_current = current;
-    p2m_load_VTTBR(d);
+    p2m_restore_state(v);
     set_current(v);
-#ifdef CONFIG_ARM_64
-    d->arch.type = kinfo.type;
-    if ( is_pv32_domain(d) )
-        WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2);
-    else
-        WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2);
-#endif
 
     /*
      * kernel_load will determine the placement of the initrd & fdt in
@@ -1044,7 +1040,7 @@ int construct_dom0(struct domain *d)
 
     /* Now that we are done restore the original p2m and current. */
     set_current(saved_current);
-    p2m_load_VTTBR(current->domain);
+    p2m_restore_state(saved_current);
 
     discard_initial_modules();
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAMq-0005I3-98; Sat, 07 Jun 2014 06:44:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMo-0005Hk-Rl
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:39 +0000
Received: from [193.109.254.147:63366] by server-9.bemta-14.messagelabs.com id
	08/BE-03644-6D4B2935; Sat, 07 Jun 2014 06:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1402123476!9645221!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26695 invoked from network); 7 Jun 2014 06:44:37 -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;
	7 Jun 2014 06:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMm-0000cg-7O
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMm-0005J9-5U
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:36 +0000
Date: Sat, 07 Jun 2014 06:44:36 +0000
Message-Id: <E1WtAMm-0005J9-5U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen/arm: Use p2m_restore_state in
	construct_dom0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b657cb9c00862b72a4ef8b0af996649d392f5fb7
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Mar 19 15:43:38 2014 +0000
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:20:33 2014 +0100

    xen/arm: Use p2m_restore_state in construct_dom0
    
    The address translation functions used while building dom0 rely on certain EL1
    state being configured. In particular they are subject to the behaviour of
    SCTLR_EL1.M (stage 1 MMU enabled).
    
    The Xen (and Linux) boot protocol require that the kernel be entered with the
    MMU disabled but they don't say anything explicitly about exception levels
    other than the one which is active when entering the kernels. Arguably the
    protocol could be said to apply to all exception levels but in any case we
    should cope with this and setup the EL1 state as necessary.
    
    Fu Wei discovered this when booting Xen from grub.efi over UEFI, it's not
    clear whether grub or UEFI is responsible for leaving stage 1 MMU enabled.
    
    Use directly the newly created function p2m_restore_state to retrieve a
    correct EL1 state to translate an address.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Reported-by: Fu Wei <fu.wei@linaro.org>
    Acked-by: Tim Deegan <tim@xen.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit d6dd3a9ae7adead322e8ce96f83db96dce64c982)
    [ ijc -- adjusted because this and 278283cd0b81 were backported in the opposite
    	 order from their application to staging. The result is as if they had
             been backported in the correct order. ]
---
 xen/arch/arm/domain_build.c |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index c1497f8..8cbd776 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1021,17 +1021,13 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    /* The following loads use the domain's p2m */
+    /*
+     * The following loads use the domain's p2m and require current to
+     * be a vcpu of the domain, temporarily switch
+     */
     saved_current = current;
-    p2m_load_VTTBR(d);
+    p2m_restore_state(v);
     set_current(v);
-#ifdef CONFIG_ARM_64
-    d->arch.type = kinfo.type;
-    if ( is_pv32_domain(d) )
-        WRITE_SYSREG(READ_SYSREG(HCR_EL2) & ~HCR_RW, HCR_EL2);
-    else
-        WRITE_SYSREG(READ_SYSREG(HCR_EL2) | HCR_RW, HCR_EL2);
-#endif
 
     /*
      * kernel_load will determine the placement of the initrd & fdt in
@@ -1044,7 +1040,7 @@ int construct_dom0(struct domain *d)
 
     /* Now that we are done restore the original p2m and current. */
     set_current(saved_current);
-    p2m_load_VTTBR(current->domain);
+    p2m_restore_state(saved_current);
 
     discard_initial_modules();
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAN0-0005K5-Du; Sat, 07 Jun 2014 06:44:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMz-0005Ji-1E
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:49 +0000
Received: from [85.158.139.211:9419] by server-3.bemta-5.messagelabs.com id
	0C/82-01676-0E4B2935; Sat, 07 Jun 2014 06:44:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1402123486!8619815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4664 invoked from network); 7 Jun 2014 06:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Jun 2014 06:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMw-0000cq-DB
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMw-0005JV-Ax
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:46 +0000
Date: Sat, 07 Jun 2014 06:44:46 +0000
Message-Id: <E1WtAMw-0005JV-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: correct backport of
	84ca4629d0aa
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0336012573cd98e373f908259f11abab3c1b2880
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 5 14:02:42 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 14:05:13 2014 +0100

    xen: arm: correct backport of 84ca4629d0aa
    
    This hunk from "Move p2m context save/restore in a separate
    function" was accidentally dropped in the backport done to 4.4 as
    commit 9ca83a4bd3bf.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index e068f74..bc81b67 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -65,6 +65,9 @@ void p2m_restore_state(struct vcpu *n)
     else
         hcr |= HCR_RW;
 
+    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
+    isb();
+
     WRITE_SYSREG(hcr, HCR_EL2);
     isb();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 07 06:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 07 Jun 2014 06:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WtAN0-0005K5-Du; Sat, 07 Jun 2014 06:44:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMz-0005Ji-1E
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:49 +0000
Received: from [85.158.139.211:9419] by server-3.bemta-5.messagelabs.com id
	0C/82-01676-0E4B2935; Sat, 07 Jun 2014 06:44:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1402123486!8619815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4664 invoked from network); 7 Jun 2014 06:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Jun 2014 06:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMw-0000cq-DB
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WtAMw-0005JV-Ax
	for xen-changelog@lists.xensource.com; Sat, 07 Jun 2014 06:44:46 +0000
Date: Sat, 07 Jun 2014 06:44:46 +0000
Message-Id: <E1WtAMw-0005JV-Ax@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: correct backport of
	84ca4629d0aa
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0336012573cd98e373f908259f11abab3c1b2880
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu Jun 5 14:02:42 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 14:05:13 2014 +0100

    xen: arm: correct backport of 84ca4629d0aa
    
    This hunk from "Move p2m context save/restore in a separate
    function" was accidentally dropped in the backport done to 4.4 as
    commit 9ca83a4bd3bf.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/p2m.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index e068f74..bc81b67 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -65,6 +65,9 @@ void p2m_restore_state(struct vcpu *n)
     else
         hcr |= HCR_RW;
 
+    WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1);
+    isb();
+
     WRITE_SYSREG(hcr, HCR_EL2);
     isb();
 }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteKQ-0002zy-It; Sun, 08 Jun 2014 14:44:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKP-0002zp-47
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:09 +0000
Received: from [193.109.254.147:65391] by server-7.bemta-14.messagelabs.com id
	93/4C-17726-8B674935; Sun, 08 Jun 2014 14:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1402238645!9887617!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5518 invoked from network); 8 Jun 2014 14:44:06 -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;
	8 Jun 2014 14:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKJ-00049p-VZ
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKJ-00034w-Gv
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:03 +0000
Date: Sun, 08 Jun 2014 14:44:03 +0000
Message-Id: <E1WteKJ-00034w-Gv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45ce6fb083335abf82f5b7d301bcc91261c94925
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:19:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:19:45 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 71db9fa..bf8d3de 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,6 +32,7 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
+#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -791,21 +792,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteKQ-0002zy-It; Sun, 08 Jun 2014 14:44:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKP-0002zp-47
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:09 +0000
Received: from [193.109.254.147:65391] by server-7.bemta-14.messagelabs.com id
	93/4C-17726-8B674935; Sun, 08 Jun 2014 14:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1402238645!9887617!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5518 invoked from network); 8 Jun 2014 14:44:06 -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;
	8 Jun 2014 14:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKJ-00049p-VZ
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKJ-00034w-Gv
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:03 +0000
Date: Sun, 08 Jun 2014 14:44:03 +0000
Message-Id: <E1WteKJ-00034w-Gv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45ce6fb083335abf82f5b7d301bcc91261c94925
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:19:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:19:45 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 71db9fa..bf8d3de 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,6 +32,7 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
+#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -791,21 +792,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteKa-00030y-Mw; Sun, 08 Jun 2014 14:44:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKY-00030i-U3
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:19 +0000
Received: from [85.158.137.68:5960] by server-4.bemta-3.messagelabs.com id
	5E/F0-17399-1C674935; Sun, 08 Jun 2014 14:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1402238655!8736647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9135 invoked from network); 8 Jun 2014 14:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKV-00049s-DE
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKV-00035L-6P
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:15 +0000
Date: Sun, 08 Jun 2014 14:44:15 +0000
Message-Id: <E1WteKV-00035L-6P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: fix mask applied to DMIBAR
	in desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bc830e4fea6f4ecc974dfe09fab27b01b9b633a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:21:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:21:12 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: f8ecf31c31906552522c2a1b0d1cada07d78876e
    master date: 2014-05-26 12:28:46 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index bfa25d7..c0f409f 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -474,7 +474,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000ULL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteKa-00030y-Mw; Sun, 08 Jun 2014 14:44:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKY-00030i-U3
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:19 +0000
Received: from [85.158.137.68:5960] by server-4.bemta-3.messagelabs.com id
	5E/F0-17399-1C674935; Sun, 08 Jun 2014 14:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1402238655!8736647!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9135 invoked from network); 8 Jun 2014 14:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKV-00049s-DE
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKV-00035L-6P
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:15 +0000
Date: Sun, 08 Jun 2014 14:44:15 +0000
Message-Id: <E1WteKV-00035L-6P@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: fix mask applied to DMIBAR
	in desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2bc830e4fea6f4ecc974dfe09fab27b01b9b633a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:21:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:21:12 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: f8ecf31c31906552522c2a1b0d1cada07d78876e
    master date: 2014-05-26 12:28:46 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index bfa25d7..c0f409f 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -474,7 +474,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000ULL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14: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.xen.org>)
	id 1WteKl-00032k-Pf; Sun, 08 Jun 2014 14:44:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKj-00032Y-Or
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:29 +0000
Received: from [85.158.143.35:24862] by server-2.bemta-4.messagelabs.com id
	A1/BF-06539-DC674935; Sun, 08 Jun 2014 14:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1402238665!9994813!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21701 invoked from network); 8 Jun 2014 14:44:26 -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;
	8 Jun 2014 14:44:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKf-0004A1-Jf
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKf-00035h-GQ
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:25 +0000
Date: Sun, 08 Jun 2014 14:44:25 +0000
Message-Id: <E1WteKf-00035h-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f9d3462a8fe6768e8230f1ee21251dee9f165fc7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:22:14 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:22:14 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6b4d71d028f445cba7426a144751fddc8bfdd67b
    master date: 2014-05-28 09:50:33 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 43bf5e5..f51db77 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -701,8 +701,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -713,6 +711,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14: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.xen.org>)
	id 1WteKl-00032k-Pf; Sun, 08 Jun 2014 14:44:31 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKj-00032Y-Or
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:29 +0000
Received: from [85.158.143.35:24862] by server-2.bemta-4.messagelabs.com id
	A1/BF-06539-DC674935; Sun, 08 Jun 2014 14:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1402238665!9994813!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21701 invoked from network); 8 Jun 2014 14:44:26 -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;
	8 Jun 2014 14:44:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKf-0004A1-Jf
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKf-00035h-GQ
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:25 +0000
Date: Sun, 08 Jun 2014 14:44:25 +0000
Message-Id: <E1WteKf-00035h-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f9d3462a8fe6768e8230f1ee21251dee9f165fc7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:22:14 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:22:14 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6b4d71d028f445cba7426a144751fddc8bfdd67b
    master date: 2014-05-28 09:50:33 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 43bf5e5..f51db77 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -701,8 +701,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -713,6 +711,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteKu-00034D-SA; Sun, 08 Jun 2014 14:44:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKs-00033r-QL
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:38 +0000
Received: from [193.109.254.147:57973] by server-8.bemta-14.messagelabs.com id
	03/C7-01877-6D674935; Sun, 08 Jun 2014 14:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1402238676!9777704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2637 invoked from network); 8 Jun 2014 14:44:37 -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;
	8 Jun 2014 14:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKp-0004A9-RN
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKp-00036A-MK
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:35 +0000
Date: Sun, 08 Jun 2014 14:44:35 +0000
Message-Id: <E1WteKp-00036A-MK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: don't use VA for cache flush
	when also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3706844342703b59f9d1fe2a1cc01abb93d94b26
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:22:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:22:49 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the previously
    commented out and now being re-enabled __set_fixmap(, 0, 0) there to
    undo the mapping resulted in the first of the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c              |    3 ++-
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index c0f409f..91b7612 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -482,7 +482,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
 
             set_fixmap_nocache(FIX_IOMMU_MMIO_BASE_0, pa);
             __set_bit(0x1c8 * 8 + 20, va);
-            /* __set_fixmap(FIX_IOMMU_MMIO_BASE_0, 0, 0); */
+            __set_fixmap(FIX_IOMMU_MMIO_BASE_0, 0, 0);
             printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
                    seg, bus, dev, func);
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteKu-00034D-SA; Sun, 08 Jun 2014 14:44:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKs-00033r-QL
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:38 +0000
Received: from [193.109.254.147:57973] by server-8.bemta-14.messagelabs.com id
	03/C7-01877-6D674935; Sun, 08 Jun 2014 14:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1402238676!9777704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2637 invoked from network); 8 Jun 2014 14:44:37 -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;
	8 Jun 2014 14:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKp-0004A9-RN
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKp-00036A-MK
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:35 +0000
Date: Sun, 08 Jun 2014 14:44:35 +0000
Message-Id: <E1WteKp-00036A-MK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: don't use VA for cache flush
	when also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3706844342703b59f9d1fe2a1cc01abb93d94b26
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:22:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:22:49 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the previously
    commented out and now being re-enabled __set_fixmap(, 0, 0) there to
    undo the mapping resulted in the first of the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c              |    3 ++-
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index c0f409f..91b7612 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -482,7 +482,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
 
             set_fixmap_nocache(FIX_IOMMU_MMIO_BASE_0, pa);
             __set_bit(0x1c8 * 8 + 20, va);
-            /* __set_fixmap(FIX_IOMMU_MMIO_BASE_0, 0, 0); */
+            __set_fixmap(FIX_IOMMU_MMIO_BASE_0, 0, 0);
             printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
                    seg, bus, dev, func);
         }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteL3-00035x-BT; Sun, 08 Jun 2014 14:44:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteL2-00035b-Hn
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:48 +0000
Received: from [85.158.137.68:54627] by server-3.bemta-3.messagelabs.com id
	02/C6-08149-FD674935; Sun, 08 Jun 2014 14:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1402238686!4308822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1675 invoked from network); 8 Jun 2014 14:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKz-0004AF-V9
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKz-00036g-U0
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:45 +0000
Date: Sun, 08 Jun 2014 14:44:45 +0000
Message-Id: <E1WteKz-00036g-U0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f4185f0c6c7800c86fa07b3115d4e14613efadc3
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 3 12:23:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:23:25 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
    master date: 2014-05-28 10:07:50 +0200
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 39de52d..5a7e0f6 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:44:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteL3-00035x-BT; Sun, 08 Jun 2014 14:44:49 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteL2-00035b-Hn
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:48 +0000
Received: from [85.158.137.68:54627] by server-3.bemta-3.messagelabs.com id
	02/C6-08149-FD674935; Sun, 08 Jun 2014 14:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1402238686!4308822!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1675 invoked from network); 8 Jun 2014 14:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKz-0004AF-V9
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteKz-00036g-U0
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:45 +0000
Date: Sun, 08 Jun 2014 14:44:45 +0000
Message-Id: <E1WteKz-00036g-U0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f4185f0c6c7800c86fa07b3115d4e14613efadc3
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 3 12:23:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:23:25 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
    master date: 2014-05-28 10:07:50 +0200
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 39de52d..5a7e0f6 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:45:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteLE-00039G-E5; Sun, 08 Jun 2014 14:45:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLC-00038j-Of
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:58 +0000
Received: from [85.158.139.211:47514] by server-13.bemta-5.messagelabs.com id
	74/62-16341-AE674935; Sun, 08 Jun 2014 14:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1402238696!8716201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25561 invoked from network); 8 Jun 2014 14:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLA-0004AO-3V
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLA-00037h-1U
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:56 +0000
Date: Sun, 08 Jun 2014 14:44:56 +0000
Message-Id: <E1WteLA-00037h-1U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46345224b938cd17e2440380b7430f86e93a3424
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 16:11:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 16:11:52 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
    master date: 2014-06-03 15:17:14 +0200
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index f44f3b9..87f656d 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -289,20 +289,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:45:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteLE-00039G-E5; Sun, 08 Jun 2014 14:45:00 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLC-00038j-Of
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:58 +0000
Received: from [85.158.139.211:47514] by server-13.bemta-5.messagelabs.com id
	74/62-16341-AE674935; Sun, 08 Jun 2014 14:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1402238696!8716201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25561 invoked from network); 8 Jun 2014 14:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLA-0004AO-3V
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLA-00037h-1U
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:44:56 +0000
Date: Sun, 08 Jun 2014 14:44:56 +0000
Message-Id: <E1WteLA-00037h-1U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46345224b938cd17e2440380b7430f86e93a3424
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 16:11:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 16:11:52 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
    master date: 2014-06-03 15:17:14 +0200
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index f44f3b9..87f656d 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -289,20 +289,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:45:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:45:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteLT-0003CA-IY; Sun, 08 Jun 2014 14:45:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLS-0003Bv-9o
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:14 +0000
Received: from [85.158.143.35:28145] by server-1.bemta-4.messagelabs.com id
	EE/C2-09853-9F674935; Sun, 08 Jun 2014 14:45:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1402238711!1935605!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13437 invoked from network); 8 Jun 2014 14:45:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:45:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLP-0004BN-Jm
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLK-00038K-A6
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:06 +0000
Date: Sun, 08 Jun 2014 14:45:06 +0000
Message-Id: <E1WteLK-00038K-A6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] Revert "ACPI/ERST: fix table
	mapping"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3eeb55368557548b1f5cd641af40292bd44fd766
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 4 15:36:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 15:36:25 2014 +0200

    Revert "ACPI/ERST: fix table mapping"
    
    This reverts commit 45ce6fb083335abf82f5b7d301bcc91261c94925
    (missing 32-bit code).
---
 xen/drivers/acpi/apei/erst.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index bf8d3de..71db9fa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,7 +32,6 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
-#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -792,27 +791,21 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
-	acpi_physical_address erst_addr;
-	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
+	status = acpi_get_table(ACPI_SIG_ERST, 0,
+				(struct acpi_table_header **)&erst_tab);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	}
-	if (ACPI_FAILURE(status)) {
+	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
-	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
-			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
-			 PAGE_HYPERVISOR);
-	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:45:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:45:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteLT-0003CA-IY; Sun, 08 Jun 2014 14:45:15 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLS-0003Bv-9o
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:14 +0000
Received: from [85.158.143.35:28145] by server-1.bemta-4.messagelabs.com id
	EE/C2-09853-9F674935; Sun, 08 Jun 2014 14:45:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1402238711!1935605!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13437 invoked from network); 8 Jun 2014 14:45:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:45:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLP-0004BN-Jm
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLK-00038K-A6
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:06 +0000
Date: Sun, 08 Jun 2014 14:45:06 +0000
Message-Id: <E1WteLK-00038K-A6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] Revert "ACPI/ERST: fix table
	mapping"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3eeb55368557548b1f5cd641af40292bd44fd766
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 4 15:36:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 15:36:25 2014 +0200

    Revert "ACPI/ERST: fix table mapping"
    
    This reverts commit 45ce6fb083335abf82f5b7d301bcc91261c94925
    (missing 32-bit code).
---
 xen/drivers/acpi/apei/erst.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index bf8d3de..71db9fa 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,7 +32,6 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
-#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -792,27 +791,21 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
-	acpi_physical_address erst_addr;
-	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
+	status = acpi_get_table(ACPI_SIG_ERST, 0,
+				(struct acpi_table_header **)&erst_tab);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	}
-	if (ACPI_FAILURE(status)) {
+	} else if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
-	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
-			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
-			 PAGE_HYPERVISOR);
-	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:45:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:45:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteLf-0003EA-Lb; Sun, 08 Jun 2014 14:45:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLe-0003Dw-O1
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:26 +0000
Received: from [85.158.139.211:41745] by server-11.bemta-5.messagelabs.com id
	38/0A-01425-60774935; Sun, 08 Jun 2014 14:45:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1402238722!5863206!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28276 invoked from network); 8 Jun 2014 14:45:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:45:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLa-0004BV-Hf
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLa-00038j-FZ
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:22 +0000
Date: Sun, 08 Jun 2014 14:45:22 +0000
Message-Id: <E1WteLa-00038j-FZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68dc110d63d24df71a0278812c2a4d99d3206faf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 4 17:20:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 17:20:38 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   28 +++++++++++++++++++++++++---
 xen/include/asm-x86/fixmap.h |    2 ++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 71db9fa..8af1263 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,6 +32,7 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
+#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -791,21 +792,42 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+#ifdef CONFIG_X86_32
+	if (erst_addr + erst_len > (DIRECTMAP_MBYTES << 20)) {
+		unsigned long offset = erst_addr & (PAGE_SIZE - 1);
+		unsigned long mapped_size = PAGE_SIZE - offset;
+
+		set_fixmap(FIX_ERST_LO, erst_addr);
+		if (mapped_size < erst_len)
+			set_fixmap(FIX_ERST_HI, erst_addr + PAGE_SIZE);
+		erst_tab = (void *)fix_to_virt(FIX_ERST_LO) + offset;
+	} else
+#endif
+	{
+		map_pages_to_xen((unsigned long)__va(erst_addr),
+				 PFN_DOWN(erst_addr),
+				 PFN_UP(erst_addr + erst_len)
+				 - PFN_DOWN(erst_addr),
+				 PAGE_HYPERVISOR);
+		erst_tab = __va(erst_addr);
+	}
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 0a7aafa..30c334f 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -39,6 +39,8 @@ enum fixed_addresses {
 #define FIX_VGC_BEGIN FIX_PAE_HIGHMEM_END
     FIX_DMAR_ZAP_HI,
     FIX_DMAR_ZAP_LO,
+    FIX_ERST_HI,
+    FIX_ERST_LO,
 #else
     FIX_VGC_END,
     FIX_VGC_BEGIN = FIX_VGC_END
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Sun Jun 08 14:45:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 08 Jun 2014 14:45:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WteLf-0003EA-Lb; Sun, 08 Jun 2014 14:45:27 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLe-0003Dw-O1
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:26 +0000
Received: from [85.158.139.211:41745] by server-11.bemta-5.messagelabs.com id
	38/0A-01425-60774935; Sun, 08 Jun 2014 14:45:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1402238722!5863206!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28276 invoked from network); 8 Jun 2014 14:45:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Jun 2014 14:45:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLa-0004BV-Hf
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WteLa-00038j-FZ
	for xen-changelog@lists.xensource.com; Sun, 08 Jun 2014 14:45:22 +0000
Date: Sun, 08 Jun 2014 14:45:22 +0000
Message-Id: <E1WteLa-00038j-FZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68dc110d63d24df71a0278812c2a4d99d3206faf
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 4 17:20:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 17:20:38 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   28 +++++++++++++++++++++++++---
 xen/include/asm-x86/fixmap.h |    2 ++
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 71db9fa..8af1263 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,6 +32,7 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
+#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -791,21 +792,42 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+#ifdef CONFIG_X86_32
+	if (erst_addr + erst_len > (DIRECTMAP_MBYTES << 20)) {
+		unsigned long offset = erst_addr & (PAGE_SIZE - 1);
+		unsigned long mapped_size = PAGE_SIZE - offset;
+
+		set_fixmap(FIX_ERST_LO, erst_addr);
+		if (mapped_size < erst_len)
+			set_fixmap(FIX_ERST_HI, erst_addr + PAGE_SIZE);
+		erst_tab = (void *)fix_to_virt(FIX_ERST_LO) + offset;
+	} else
+#endif
+	{
+		map_pages_to_xen((unsigned long)__va(erst_addr),
+				 PFN_DOWN(erst_addr),
+				 PFN_UP(erst_addr + erst_len)
+				 - PFN_DOWN(erst_addr),
+				 PAGE_HYPERVISOR);
+		erst_tab = __va(erst_addr);
+	}
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 0a7aafa..30c334f 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -39,6 +39,8 @@ enum fixed_addresses {
 #define FIX_VGC_BEGIN FIX_PAE_HIGHMEM_END
     FIX_DMAR_ZAP_HI,
     FIX_DMAR_ZAP_LO,
+    FIX_ERST_HI,
+    FIX_ERST_LO,
 #else
     FIX_VGC_END,
     FIX_VGC_BEGIN = FIX_VGC_END
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv6zz-0004qE-TO; Thu, 12 Jun 2014 15:33:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv6zy-0004q3-2W
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:06 +0000
Received: from [193.109.254.147:48830] by server-2.bemta-14.messagelabs.com id
	E8/2C-21684-138C9935; Thu, 12 Jun 2014 15:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1402587183!10860470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2014 invoked from network); 12 Jun 2014 15:33:04 -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;
	12 Jun 2014 15:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv6zv-0007ZZ-BK
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv6zv-0005q2-3X
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:03 +0000
Date: Thu, 12 Jun 2014 15:33:03 +0000
Message-Id: <E1Wv6zv-0005q2-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tmem: remove dumb check in
	do_tmem_destroy_pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 804d9af208c5c95156140b1c62cf8857ba250b03
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 4 11:13:32 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:45:43 2014 +0100

    tmem: remove dumb check in do_tmem_destroy_pool
    
    do_tmem_destroy_pool is checking if pools == NULL. But, pools is a fixed
    array.
    
    Clang 3.5 will fail to compile xen/common/tmem.c with the following error:
    tmem.c:1848:18: error: comparison of array 'client->pools' equal to a null
    pointer is always false [-Werror,-Wtautological-pointer-compare]
        if ( client->pools == NULL )
    
    Coverity-ID:1055632
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    (cherry picked from commit ac0f56a2fa407e0704fade12630a5a960dedce87)
    (cherry picked from commit 6ce0c3fca9bd1c0d45908452d6e5e9f7bf22f7b7)
---
 xen/common/tmem.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index a122651..b86daf2 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1867,8 +1867,6 @@ static NOINLINE int do_tmem_destroy_pool(uint32_t pool_id)
     client_t *client = tmh_client_from_current();
     pool_t *pool;
 
-    if ( client->pools == NULL )
-        return 0;
     if ( pool_id >= MAX_POOLS_PER_DOMAIN )
         return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv6zz-0004qE-TO; Thu, 12 Jun 2014 15:33:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv6zy-0004q3-2W
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:06 +0000
Received: from [193.109.254.147:48830] by server-2.bemta-14.messagelabs.com id
	E8/2C-21684-138C9935; Thu, 12 Jun 2014 15:33:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1402587183!10860470!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2014 invoked from network); 12 Jun 2014 15:33:04 -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;
	12 Jun 2014 15:33:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv6zv-0007ZZ-BK
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv6zv-0005q2-3X
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:03 +0000
Date: Thu, 12 Jun 2014 15:33:03 +0000
Message-Id: <E1Wv6zv-0005q2-3X@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tmem: remove dumb check in
	do_tmem_destroy_pool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 804d9af208c5c95156140b1c62cf8857ba250b03
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Fri Apr 4 11:13:32 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:45:43 2014 +0100

    tmem: remove dumb check in do_tmem_destroy_pool
    
    do_tmem_destroy_pool is checking if pools == NULL. But, pools is a fixed
    array.
    
    Clang 3.5 will fail to compile xen/common/tmem.c with the following error:
    tmem.c:1848:18: error: comparison of array 'client->pools' equal to a null
    pointer is always false [-Werror,-Wtautological-pointer-compare]
        if ( client->pools == NULL )
    
    Coverity-ID:1055632
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    (cherry picked from commit ac0f56a2fa407e0704fade12630a5a960dedce87)
    (cherry picked from commit 6ce0c3fca9bd1c0d45908452d6e5e9f7bf22f7b7)
---
 xen/common/tmem.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/common/tmem.c b/xen/common/tmem.c
index a122651..b86daf2 100644
--- a/xen/common/tmem.c
+++ b/xen/common/tmem.c
@@ -1867,8 +1867,6 @@ static NOINLINE int do_tmem_destroy_pool(uint32_t pool_id)
     client_t *client = tmh_client_from_current();
     pool_t *pool;
 
-    if ( client->pools == NULL )
-        return 0;
     if ( pool_id >= MAX_POOLS_PER_DOMAIN )
         return 0;
     if ( (pool = client->pools[pool_id]) == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv709-0004rJ-Vu; Thu, 12 Jun 2014 15:33:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv708-0004r6-6V
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:16 +0000
Received: from [193.109.254.147:53675] by server-13.bemta-14.messagelabs.com
	id 6E/7E-23211-B38C9935; Thu, 12 Jun 2014 15:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1402587193!7550552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27528 invoked from network); 12 Jun 2014 15:33:14 -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;
	12 Jun 2014 15:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv705-0007Zc-J6
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv705-0005qO-GG
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:13 +0000
Date: Thu, 12 Jun 2014 15:33:13 +0000
Message-Id: <E1Wv705-0005qO-GG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl_json: remove extra "break"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a14bb4db517ca076ad7d785be52d4bd7a6df6de9
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Apr 9 14:29:13 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:48:28 2014 +0100

    libxl_json: remove extra "break"
    
    ... otherwise JSON array elements are not freed and memory is leaked.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3eb54a2fdbc216b39dc2c0a86f11a32d4c838269)
    (cherry picked from commit d6eff6fcc05f7167e5b2232d3bc60047fffb8fc4)
---
 tools/libxl/libxl_json.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index c6ffb52..9762db8 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -285,7 +285,6 @@ void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj)
     }
     case JSON_ARRAY: {
         libxl__json_object *node = NULL;
-        break;
 
         for (idx = 0; idx < obj->u.array->count; idx++) {
             if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv709-0004rJ-Vu; Thu, 12 Jun 2014 15:33:17 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv708-0004r6-6V
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:16 +0000
Received: from [193.109.254.147:53675] by server-13.bemta-14.messagelabs.com
	id 6E/7E-23211-B38C9935; Thu, 12 Jun 2014 15:33:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1402587193!7550552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27528 invoked from network); 12 Jun 2014 15:33:14 -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;
	12 Jun 2014 15:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv705-0007Zc-J6
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv705-0005qO-GG
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:13 +0000
Date: Thu, 12 Jun 2014 15:33:13 +0000
Message-Id: <E1Wv705-0005qO-GG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] libxl_json: remove extra "break"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a14bb4db517ca076ad7d785be52d4bd7a6df6de9
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Wed Apr 9 14:29:13 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:48:28 2014 +0100

    libxl_json: remove extra "break"
    
    ... otherwise JSON array elements are not freed and memory is leaked.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    (cherry picked from commit 3eb54a2fdbc216b39dc2c0a86f11a32d4c838269)
    (cherry picked from commit d6eff6fcc05f7167e5b2232d3bc60047fffb8fc4)
---
 tools/libxl/libxl_json.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index c6ffb52..9762db8 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -285,7 +285,6 @@ void libxl__json_object_free(libxl__gc *gc, libxl__json_object *obj)
     }
     case JSON_ARRAY: {
         libxl__json_object *node = NULL;
-        break;
 
         for (idx = 0; idx < obj->u.array->count; idx++) {
             if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70K-0004t3-2L; Thu, 12 Jun 2014 15:33:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70I-0004sn-Gd
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:26 +0000
Received: from [193.109.254.147:54650] by server-2.bemta-14.messagelabs.com id
	9A/9C-21684-548C9935; Thu, 12 Jun 2014 15:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1402587204!6244819!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31811 invoked from network); 12 Jun 2014 15:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70F-0007Zl-T7
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70F-0005qw-OW
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:23 +0000
Date: Thu, 12 Jun 2014 15:33:23 +0000
Message-Id: <E1Wv70F-0005qw-OW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/pygrub: Fix error handling
	if no valid partitions are found
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0510345019777823419=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 11b2541f458a3d09c63980e669c166cf6e96980a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat May 10 02:18:33 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:50:05 2014 +0100

    tools/pygrub: Fix error handling if no valid partitions are found
    
    If no partitions at all are found, pygrub never creates the name 'fs',
    resulting in a NameError indicating the lack of fs, rather than a
    RuntimeError explaining that no partitions were found.
    
    Set fs to None right at the start, and use the pythonic idiom "if fs is None:"
    to protect against otherwise valid values for fs which compare equal to
    0/False.
    
    Reported-by: Sven Köhler <sven.koehler@gmail.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit d75215805ce6ed20b3807955fab6a7f7a3368bee)
    (cherry picked from commit 5ee75ef147f83457fa28d4d4374efcf066581e26)
---
 tools/pygrub/src/pygrub |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index bcdd602..2c6ca46 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -760,7 +760,7 @@ if __name__ == "__main__":
         usage()
         sys.exit(1)
     file = args[0]
-        
+    fs = None
     output = None
     entry = None
     interactive = True
@@ -873,7 +873,7 @@ if __name__ == "__main__":
         sys.exit(0)
 
     # Did looping through partitions find us a kernel?
-    if not fs:
+    if fs is None:
         raise RuntimeError, "Unable to find partition containing kernel"
 
     bootcfg["kernel"] = copy_from_image(fs, chosencfg["kernel"], "kernel",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70K-0004t3-2L; Thu, 12 Jun 2014 15:33:28 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70I-0004sn-Gd
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:26 +0000
Received: from [193.109.254.147:54650] by server-2.bemta-14.messagelabs.com id
	9A/9C-21684-548C9935; Thu, 12 Jun 2014 15:33:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1402587204!6244819!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31811 invoked from network); 12 Jun 2014 15:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:33:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70F-0007Zl-T7
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70F-0005qw-OW
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:23 +0000
Date: Thu, 12 Jun 2014 15:33:23 +0000
Message-Id: <E1Wv70F-0005qw-OW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/pygrub: Fix error handling
	if no valid partitions are found
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0510345019777823419=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 11b2541f458a3d09c63980e669c166cf6e96980a
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Sat May 10 02:18:33 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:50:05 2014 +0100

    tools/pygrub: Fix error handling if no valid partitions are found
    
    If no partitions at all are found, pygrub never creates the name 'fs',
    resulting in a NameError indicating the lack of fs, rather than a
    RuntimeError explaining that no partitions were found.
    
    Set fs to None right at the start, and use the pythonic idiom "if fs is None:"
    to protect against otherwise valid values for fs which compare equal to
    0/False.
    
    Reported-by: Sven Köhler <sven.koehler@gmail.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    (cherry picked from commit d75215805ce6ed20b3807955fab6a7f7a3368bee)
    (cherry picked from commit 5ee75ef147f83457fa28d4d4374efcf066581e26)
---
 tools/pygrub/src/pygrub |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index bcdd602..2c6ca46 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -760,7 +760,7 @@ if __name__ == "__main__":
         usage()
         sys.exit(1)
     file = args[0]
-        
+    fs = None
     output = None
     entry = None
     interactive = True
@@ -873,7 +873,7 @@ if __name__ == "__main__":
         sys.exit(0)
 
     # Did looping through partitions find us a kernel?
-    if not fs:
+    if fs is None:
         raise RuntimeError, "Unable to find partition containing kernel"
 
     bootcfg["kernel"] = copy_from_image(fs, chosencfg["kernel"], "kernel",
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15: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.xen.org>)
	id 1Wv70U-0004uj-57; Thu, 12 Jun 2014 15:33:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70S-0004uP-O3
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:37 +0000
Received: from [85.158.143.35:61214] by server-3.bemta-4.messagelabs.com id
	1A/24-13602-058C9935; Thu, 12 Jun 2014 15:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1402587214!10946073!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27858 invoked from network); 12 Jun 2014 15:33:35 -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;
	12 Jun 2014 15:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70Q-0007Zr-2J
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70Q-0005rK-0l
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:34 +0000
Date: Thu, 12 Jun 2014 15:33:34 +0000
Message-Id: <E1Wv70Q-0005rK-0l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/libxl: Don't read off the
	end of tinfo[]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50454d3a04026dcb090a5e509316e55d73a387ee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 18 15:59:05 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:51:31 2014 +0100

    tools/libxl: Don't read off the end of tinfo[]
    
    It is very common for BIOSes to advertise more cpus than are actually present
    on the system, and mark some of them as offline.  This is what Xen does to
    allow for later CPU hotplug, and what BIOSes common to multiple different
    systems do to to save fully rewriting the MADT in memory.
    
    An excerpt from `xl info` might look like:
    
    ...
    nr_cpus                : 2
    max_cpu_id             : 3
    ...
    
    Which shows 4 CPUs in the MADT, but only 2 online (as this particular box is
    the dual-core rather than the quad-core SKU of its particular brand)
    
    Because of the way Xen exposes this information, a libxl_cputopology array is
    bounded by 'nr_cpus', while cpu bitmaps are bounded by 'max_cpu_id + 1'.
    
    The current libxl code has two places which erroneously assume that a
    libxl_cputopology array is as long as the number of bits found in a cpu
    bitmap, and valgrind complains:
    
    ==14961== Invalid read of size 4
    ==14961==    at 0x407AB7F: libxl__get_numa_candidate (libxl_numa.c:230)
    ==14961==    by 0x407030B: libxl__build_pre (libxl_dom.c:167)
    ==14961==    by 0x406246F: libxl__domain_build (libxl_create.c:371)
    ...
    ==14961==  Address 0x4324788 is 8 bytes after a block of size 24 alloc'd
    ==14961==    at 0x402669D: calloc (in/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==14961==    by 0x4075BB9: libxl__zalloc (libxl_internal.c:83)
    ==14961==    by 0x4052F87: libxl_get_cpu_topology (libxl.c:4408)
    ==14961==    by 0x407A899: libxl__get_numa_candidate (libxl_numa.c:342)
    ...
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 81b03050485708698ce2245d9abefce07aafb704)
    (cherry picked from commit 3aaa40fd582764c89126d48a13931d2221e33e04)
---
 tools/libxl/libxl_numa.c  |    5 ++++-
 tools/libxl/libxl_utils.c |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c
index 20c99ac..4fac664 100644
--- a/tools/libxl/libxl_numa.c
+++ b/tools/libxl/libxl_numa.c
@@ -180,6 +180,7 @@ static int nodemap_to_nr_vcpus(libxl__gc *gc, int vcpus_on_node[],
 /* Number of vcpus able to run on the cpus of the various nodes
  * (reported by filling the array vcpus_on_node[]). */
 static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
+                             size_t tinfo_elements,
                              const libxl_bitmap *suitable_cpumap,
                              int vcpus_on_node[])
 {
@@ -222,6 +223,8 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
              */
             libxl_bitmap_set_none(&nodes_counted);
             libxl_for_each_set_bit(k, vinfo[j].cpumap) {
+                if (k >= tinfo_elements)
+                    break;
                 int node = tinfo[k].node;
 
                 if (libxl_bitmap_test(suitable_cpumap, k) &&
@@ -364,7 +367,7 @@ int libxl__get_numa_candidate(libxl__gc *gc,
      * all we have to do later is summing up the right elements of the
      * vcpus_on_node array.
      */
-    rc = nr_vcpus_on_nodes(gc, tinfo, suitable_cpumap, vcpus_on_node);
+    rc = nr_vcpus_on_nodes(gc, tinfo, nr_cpus, suitable_cpumap, vcpus_on_node);
     if (rc)
         goto out;
 
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 4309e5e..8f20fea 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -682,8 +682,11 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
     }
 
     libxl_bitmap_set_none(nodemap);
-    libxl_for_each_set_bit(i, *cpumap)
+    libxl_for_each_set_bit(i, *cpumap) {
+        if (i >= nr_cpus)
+            break;
         libxl_bitmap_set(nodemap, tinfo[i].node);
+    }
  out:
     libxl_cputopology_list_free(tinfo, nr_cpus);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15: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.xen.org>)
	id 1Wv70U-0004uj-57; Thu, 12 Jun 2014 15:33:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70S-0004uP-O3
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:37 +0000
Received: from [85.158.143.35:61214] by server-3.bemta-4.messagelabs.com id
	1A/24-13602-058C9935; Thu, 12 Jun 2014 15:33:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1402587214!10946073!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27858 invoked from network); 12 Jun 2014 15:33:35 -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;
	12 Jun 2014 15:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70Q-0007Zr-2J
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70Q-0005rK-0l
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:34 +0000
Date: Thu, 12 Jun 2014 15:33:34 +0000
Message-Id: <E1Wv70Q-0005rK-0l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] tools/libxl: Don't read off the
	end of tinfo[]
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50454d3a04026dcb090a5e509316e55d73a387ee
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Feb 18 15:59:05 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Thu May 22 16:51:31 2014 +0100

    tools/libxl: Don't read off the end of tinfo[]
    
    It is very common for BIOSes to advertise more cpus than are actually present
    on the system, and mark some of them as offline.  This is what Xen does to
    allow for later CPU hotplug, and what BIOSes common to multiple different
    systems do to to save fully rewriting the MADT in memory.
    
    An excerpt from `xl info` might look like:
    
    ...
    nr_cpus                : 2
    max_cpu_id             : 3
    ...
    
    Which shows 4 CPUs in the MADT, but only 2 online (as this particular box is
    the dual-core rather than the quad-core SKU of its particular brand)
    
    Because of the way Xen exposes this information, a libxl_cputopology array is
    bounded by 'nr_cpus', while cpu bitmaps are bounded by 'max_cpu_id + 1'.
    
    The current libxl code has two places which erroneously assume that a
    libxl_cputopology array is as long as the number of bits found in a cpu
    bitmap, and valgrind complains:
    
    ==14961== Invalid read of size 4
    ==14961==    at 0x407AB7F: libxl__get_numa_candidate (libxl_numa.c:230)
    ==14961==    by 0x407030B: libxl__build_pre (libxl_dom.c:167)
    ==14961==    by 0x406246F: libxl__domain_build (libxl_create.c:371)
    ...
    ==14961==  Address 0x4324788 is 8 bytes after a block of size 24 alloc'd
    ==14961==    at 0x402669D: calloc (in/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
    ==14961==    by 0x4075BB9: libxl__zalloc (libxl_internal.c:83)
    ==14961==    by 0x4052F87: libxl_get_cpu_topology (libxl.c:4408)
    ==14961==    by 0x407A899: libxl__get_numa_candidate (libxl_numa.c:342)
    ...
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    (cherry picked from commit 81b03050485708698ce2245d9abefce07aafb704)
    (cherry picked from commit 3aaa40fd582764c89126d48a13931d2221e33e04)
---
 tools/libxl/libxl_numa.c  |    5 ++++-
 tools/libxl/libxl_utils.c |    5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/libxl/libxl_numa.c b/tools/libxl/libxl_numa.c
index 20c99ac..4fac664 100644
--- a/tools/libxl/libxl_numa.c
+++ b/tools/libxl/libxl_numa.c
@@ -180,6 +180,7 @@ static int nodemap_to_nr_vcpus(libxl__gc *gc, int vcpus_on_node[],
 /* Number of vcpus able to run on the cpus of the various nodes
  * (reported by filling the array vcpus_on_node[]). */
 static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
+                             size_t tinfo_elements,
                              const libxl_bitmap *suitable_cpumap,
                              int vcpus_on_node[])
 {
@@ -222,6 +223,8 @@ static int nr_vcpus_on_nodes(libxl__gc *gc, libxl_cputopology *tinfo,
              */
             libxl_bitmap_set_none(&nodes_counted);
             libxl_for_each_set_bit(k, vinfo[j].cpumap) {
+                if (k >= tinfo_elements)
+                    break;
                 int node = tinfo[k].node;
 
                 if (libxl_bitmap_test(suitable_cpumap, k) &&
@@ -364,7 +367,7 @@ int libxl__get_numa_candidate(libxl__gc *gc,
      * all we have to do later is summing up the right elements of the
      * vcpus_on_node array.
      */
-    rc = nr_vcpus_on_nodes(gc, tinfo, suitable_cpumap, vcpus_on_node);
+    rc = nr_vcpus_on_nodes(gc, tinfo, nr_cpus, suitable_cpumap, vcpus_on_node);
     if (rc)
         goto out;
 
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 4309e5e..8f20fea 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -682,8 +682,11 @@ int libxl_cpumap_to_nodemap(libxl_ctx *ctx,
     }
 
     libxl_bitmap_set_none(nodemap);
-    libxl_for_each_set_bit(i, *cpumap)
+    libxl_for_each_set_bit(i, *cpumap) {
+        if (i >= nr_cpus)
+            break;
         libxl_bitmap_set(nodemap, tinfo[i].node);
+    }
  out:
     libxl_cputopology_list_free(tinfo, nr_cpus);
     return rc;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70f-0004wo-8G; Thu, 12 Jun 2014 15:33:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70e-0004wV-BA
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:48 +0000
Received: from [193.109.254.147:44699] by server-2.bemta-14.messagelabs.com id
	1E/1D-21684-B58C9935; Thu, 12 Jun 2014 15:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1402587224!10860526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3263 invoked from network); 12 Jun 2014 15:33:45 -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;
	12 Jun 2014 15:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70a-0007Zx-6t
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70a-0005rg-5e
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:44 +0000
Date: Thu, 12 Jun 2014 15:33:44 +0000
Message-Id: <E1Wv70a-0005rg-5e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm/rtc: don't run the vpt
	timer when !REG_B.PIE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eeda2d4916413a3445491124d3451773ac089ad5
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Fri May 23 15:22:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:22:21 2014 +0200

    x86/hvm/rtc: don't run the vpt timer when !REG_B.PIE
    
    If the guest has not asked for interrupts, don't run the vpt timer
    to generate them.  This is a prerequisite for a patch to simplify how
    the vpt interacts with the RTC, and also gets rid of a timer series in
    Xen in a case where it's unlikely to be needed.
    
    Instead, calculate the correct value for REG_C.PF whenever REG_C is
    read or PIE is enabled.  This allow a guest to poll for the PF bit
    while not asking for actual timer interrupts.  Such a guest would no
    longer get the benefit of the vpt's timer modes.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4c15a82f034c9c2213a18b6320834f3906d00ba9
    master date: 2014-02-25 09:26:45 +0100
---
 xen/arch/x86/hvm/rtc.c        |   53 +++++++++++++++++++++++++++++++---------
 xen/include/asm-x86/hvm/vpt.h |    3 +-
 2 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index cdedefe..1a731f7 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -94,7 +94,7 @@ bool_t rtc_periodic_interrupt(void *opaque)
     {
         /* VM is ignoring its RTC; no point in running the timer */
         destroy_periodic_time(&s->pt);
-        s->pt_code = 0;
+        s->period = 0;
     }
     if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
         ret = 0;
@@ -103,6 +103,24 @@ bool_t rtc_periodic_interrupt(void *opaque)
     return ret;
 }
 
+/* Check whether the REG_C.PF bit should have been set by a tick since
+ * the last time we looked. This is used to track ticks when REG_B.PIE
+ * is clear; when PIE is set, PF ticks are handled by the VPT callbacks.  */
+static void check_for_pf_ticks(RTCState *s)
+{
+    s_time_t now;
+
+    if ( s->period == 0 || (s->hw.cmos_data[RTC_REG_B] & RTC_PIE) )
+        return;
+
+    now = NOW();
+    if ( (now - s->start_time) / s->period
+         != (s->check_ticks_since - s->start_time) / s->period )
+        s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
+
+    s->check_ticks_since = now;
+}
+
 /* Enable/configure/disable the periodic timer based on the RTC_PIE and
  * RTC_RATE_SELECT settings */
 static void rtc_timer_update(RTCState *s)
@@ -125,24 +143,29 @@ static void rtc_timer_update(RTCState *s)
     case RTC_REF_CLCK_4MHZ:
         if ( period_code != 0 )
         {
-            if ( period_code != s->pt_code )
+            period = 1 << (period_code - 1); /* period in 32 Khz cycles */
+            period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
+            if ( period != s->period )
             {
-                s->pt_code = period_code;
-                period = 1 << (period_code - 1); /* period in 32 Khz cycles */
-                period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
+                s_time_t now = NOW();
+
+                s->period = period;
                 if ( v->domain->arch.hvm_domain.params[HVM_PARAM_VPT_ALIGN] )
                     delta = 0;
                 else
-                    delta = period - ((NOW() - s->start_time) % period);
-                create_periodic_time(v, &s->pt, delta, period,
-                                     RTC_IRQ, NULL, s);
+                    delta = period - ((now - s->start_time) % period);
+                if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
+                    create_periodic_time(v, &s->pt, delta, period,
+                                         RTC_IRQ, NULL, s);
+                else
+                    s->check_ticks_since = now;
             }
             break;
         }
         /* fall through */
     default:
         destroy_periodic_time(&s->pt);
-        s->pt_code = 0;
+        s->period = 0;
         break;
     }
 }
@@ -484,14 +507,19 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
             if ( orig & RTC_SET )
                 rtc_set_time(s);
         }
+        check_for_pf_ticks(s);
         s->hw.cmos_data[RTC_REG_B] = data;
         /*
          * If the interrupt is already set when the interrupt becomes
          * enabled, raise an interrupt immediately.
          */
         rtc_update_irq(s);
-        if ( (data & RTC_PIE) && !(orig & RTC_PIE) )
+        if ( (data ^ orig) & RTC_PIE )
+        {
+            destroy_periodic_time(&s->pt);
+            s->period = 0;
             rtc_timer_update(s);
+        }
         if ( (data ^ orig) & RTC_SET )
             check_update_timer(s);
         if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
@@ -645,6 +673,7 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
             ret |= RTC_UIP;
         break;
     case RTC_REG_C:
+        check_for_pf_ticks(s);
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
         if ( (ret & RTC_IRQF) && !rtc_mode_is(s, no_ack) )
@@ -652,7 +681,7 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
         rtc_update_irq(s);
         check_update_timer(s);
         alarm_timer_update(s);
-        rtc_timer_update(s);
+        s->pt_dead_ticks = 0;
         break;
     default:
         ret = s->hw.cmos_data[s->hw.cmos_index];
@@ -748,7 +777,7 @@ void rtc_reset(struct domain *d)
     RTCState *s = domain_vrtc(d);
 
     destroy_periodic_time(&s->pt);
-    s->pt_code = 0;
+    s->period = 0;
     s->pt.source = PTSRC_isa;
 }
 
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 87c3a66..9f48635 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -113,7 +113,8 @@ typedef struct RTCState {
     /* periodic timer */
     struct periodic_time pt;
     s_time_t start_time;
-    int pt_code;
+    s_time_t check_ticks_since;
+    int period;
     uint8_t pt_dead_ticks;
     uint32_t use_timer;
     spinlock_t lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70f-0004wo-8G; Thu, 12 Jun 2014 15:33:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70e-0004wV-BA
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:48 +0000
Received: from [193.109.254.147:44699] by server-2.bemta-14.messagelabs.com id
	1E/1D-21684-B58C9935; Thu, 12 Jun 2014 15:33:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1402587224!10860526!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3263 invoked from network); 12 Jun 2014 15:33:45 -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;
	12 Jun 2014 15:33:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70a-0007Zx-6t
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:44 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70a-0005rg-5e
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:44 +0000
Date: Thu, 12 Jun 2014 15:33:44 +0000
Message-Id: <E1Wv70a-0005rg-5e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm/rtc: don't run the vpt
	timer when !REG_B.PIE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eeda2d4916413a3445491124d3451773ac089ad5
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Fri May 23 15:22:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:22:21 2014 +0200

    x86/hvm/rtc: don't run the vpt timer when !REG_B.PIE
    
    If the guest has not asked for interrupts, don't run the vpt timer
    to generate them.  This is a prerequisite for a patch to simplify how
    the vpt interacts with the RTC, and also gets rid of a timer series in
    Xen in a case where it's unlikely to be needed.
    
    Instead, calculate the correct value for REG_C.PF whenever REG_C is
    read or PIE is enabled.  This allow a guest to poll for the PF bit
    while not asking for actual timer interrupts.  Such a guest would no
    longer get the benefit of the vpt's timer modes.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 4c15a82f034c9c2213a18b6320834f3906d00ba9
    master date: 2014-02-25 09:26:45 +0100
---
 xen/arch/x86/hvm/rtc.c        |   53 +++++++++++++++++++++++++++++++---------
 xen/include/asm-x86/hvm/vpt.h |    3 +-
 2 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index cdedefe..1a731f7 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -94,7 +94,7 @@ bool_t rtc_periodic_interrupt(void *opaque)
     {
         /* VM is ignoring its RTC; no point in running the timer */
         destroy_periodic_time(&s->pt);
-        s->pt_code = 0;
+        s->period = 0;
     }
     if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
         ret = 0;
@@ -103,6 +103,24 @@ bool_t rtc_periodic_interrupt(void *opaque)
     return ret;
 }
 
+/* Check whether the REG_C.PF bit should have been set by a tick since
+ * the last time we looked. This is used to track ticks when REG_B.PIE
+ * is clear; when PIE is set, PF ticks are handled by the VPT callbacks.  */
+static void check_for_pf_ticks(RTCState *s)
+{
+    s_time_t now;
+
+    if ( s->period == 0 || (s->hw.cmos_data[RTC_REG_B] & RTC_PIE) )
+        return;
+
+    now = NOW();
+    if ( (now - s->start_time) / s->period
+         != (s->check_ticks_since - s->start_time) / s->period )
+        s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
+
+    s->check_ticks_since = now;
+}
+
 /* Enable/configure/disable the periodic timer based on the RTC_PIE and
  * RTC_RATE_SELECT settings */
 static void rtc_timer_update(RTCState *s)
@@ -125,24 +143,29 @@ static void rtc_timer_update(RTCState *s)
     case RTC_REF_CLCK_4MHZ:
         if ( period_code != 0 )
         {
-            if ( period_code != s->pt_code )
+            period = 1 << (period_code - 1); /* period in 32 Khz cycles */
+            period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
+            if ( period != s->period )
             {
-                s->pt_code = period_code;
-                period = 1 << (period_code - 1); /* period in 32 Khz cycles */
-                period = DIV_ROUND(period * 1000000000ULL, 32768); /* in ns */
+                s_time_t now = NOW();
+
+                s->period = period;
                 if ( v->domain->arch.hvm_domain.params[HVM_PARAM_VPT_ALIGN] )
                     delta = 0;
                 else
-                    delta = period - ((NOW() - s->start_time) % period);
-                create_periodic_time(v, &s->pt, delta, period,
-                                     RTC_IRQ, NULL, s);
+                    delta = period - ((now - s->start_time) % period);
+                if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
+                    create_periodic_time(v, &s->pt, delta, period,
+                                         RTC_IRQ, NULL, s);
+                else
+                    s->check_ticks_since = now;
             }
             break;
         }
         /* fall through */
     default:
         destroy_periodic_time(&s->pt);
-        s->pt_code = 0;
+        s->period = 0;
         break;
     }
 }
@@ -484,14 +507,19 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
             if ( orig & RTC_SET )
                 rtc_set_time(s);
         }
+        check_for_pf_ticks(s);
         s->hw.cmos_data[RTC_REG_B] = data;
         /*
          * If the interrupt is already set when the interrupt becomes
          * enabled, raise an interrupt immediately.
          */
         rtc_update_irq(s);
-        if ( (data & RTC_PIE) && !(orig & RTC_PIE) )
+        if ( (data ^ orig) & RTC_PIE )
+        {
+            destroy_periodic_time(&s->pt);
+            s->period = 0;
             rtc_timer_update(s);
+        }
         if ( (data ^ orig) & RTC_SET )
             check_update_timer(s);
         if ( (data ^ orig) & (RTC_24H | RTC_DM_BINARY | RTC_SET) )
@@ -645,6 +673,7 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
             ret |= RTC_UIP;
         break;
     case RTC_REG_C:
+        check_for_pf_ticks(s);
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
         if ( (ret & RTC_IRQF) && !rtc_mode_is(s, no_ack) )
@@ -652,7 +681,7 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
         rtc_update_irq(s);
         check_update_timer(s);
         alarm_timer_update(s);
-        rtc_timer_update(s);
+        s->pt_dead_ticks = 0;
         break;
     default:
         ret = s->hw.cmos_data[s->hw.cmos_index];
@@ -748,7 +777,7 @@ void rtc_reset(struct domain *d)
     RTCState *s = domain_vrtc(d);
 
     destroy_periodic_time(&s->pt);
-    s->pt_code = 0;
+    s->period = 0;
     s->pt.source = PTSRC_isa;
 }
 
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 87c3a66..9f48635 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -113,7 +113,8 @@ typedef struct RTCState {
     /* periodic timer */
     struct periodic_time pt;
     s_time_t start_time;
-    int pt_code;
+    s_time_t check_ticks_since;
+    int period;
     uint8_t pt_dead_ticks;
     uint32_t use_timer;
     spinlock_t lock;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70o-0004yP-Av; Thu, 12 Jun 2014 15:33:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70n-0004yA-1L
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:57 +0000
Received: from [85.158.143.35:65006] by server-3.bemta-4.messagelabs.com id
	82/A4-13602-468C9935; Thu, 12 Jun 2014 15:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1402587234!10997139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26965 invoked from network); 12 Jun 2014 15:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70k-0007a3-Eh
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70k-0005sY-Cx
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:54 +0000
Date: Thu, 12 Jun 2014 15:33:54 +0000
Message-Id: <E1Wv70k-0005sY-Cx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm/rtc: inject RTC periodic
	interupts from the vpt code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0424cb9a343aba974832551ee841d8e43c22d1bd
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Fri May 23 15:23:23 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:23:23 2014 +0200

    x86/hvm/rtc: inject RTC periodic interupts from the vpt code
    
    Let the vpt code drive the RTC's timer interrupts directly, as it does
    for other periodic time sources, and fix up the register state in a
    vpt callback when the interrupt is injected.
    
    This fixes a hang seen on Windows 2003 in no-missed-ticks mode, where
    when a tick was pending, the early callback from the VPT code would
    always set REG_C.PF on every VMENTER; meanwhile the guest was in its
    interrupt handler reading REG_C in a loop and waiting to see it clear.
    
    One drawback is that a guest that attempts to suppress RTC periodic
    interrupts by failing to read REG_C will receive up to 10 spurious
    interrupts, even in 'strict' mode.  However:
     - since all previous RTC models have had this property (including
       the current one, since 'no-ack' mode is hard-coded on) we're
       pretty sure that all guests can handle this; and
     - we're already playing some other interesting games with this
       interrupt in the vpt code.
    
    One other corner case: a guest that enables the PF timer interrupt,
    masks the interupt in the APIC and then polls REG_C looking for PF
    will not see PF getting set.  The more likely case of enabling the
    timers and masking the interrupt with REG_B.PIE is already handled
    correctly.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c7e35c6ec705d777c0a11124ec28876f1468f2c5
    master date: 2014-02-25 09:29:26 +0100
---
 xen/arch/x86/hvm/rtc.c        |   25 +++++++++++--------------
 xen/arch/x86/hvm/vpt.c        |   40 ----------------------------------------
 xen/include/asm-x86/hvm/vpt.h |    1 -
 3 files changed, 11 insertions(+), 55 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 1a731f7..d641d95 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -78,29 +78,26 @@ static void rtc_update_irq(RTCState *s)
     hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
-bool_t rtc_periodic_interrupt(void *opaque)
+/* Called by the VPT code after it's injected a PF interrupt for us.
+ * Fix up the register state to reflect what happened. */
+static void rtc_pf_callback(struct vcpu *v, void *opaque)
 {
     RTCState *s = opaque;
-    bool_t ret;
 
     spin_lock(&s->lock);
-    ret = rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
-    if ( rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
-    {
-        s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
-        rtc_update_irq(s);
-    }
-    else if ( ++(s->pt_dead_ticks) >= 10 )
+
+    if ( !rtc_mode_is(s, no_ack)
+         && (s->hw.cmos_data[RTC_REG_C] & RTC_IRQF)
+         && ++(s->pt_dead_ticks) >= 10 )
     {
         /* VM is ignoring its RTC; no point in running the timer */
         destroy_periodic_time(&s->pt);
         s->period = 0;
     }
-    if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
-        ret = 0;
-    spin_unlock(&s->lock);
 
-    return ret;
+    s->hw.cmos_data[RTC_REG_C] |= RTC_PF|RTC_IRQF;
+
+    spin_unlock(&s->lock);
 }
 
 /* Check whether the REG_C.PF bit should have been set by a tick since
@@ -156,7 +153,7 @@ static void rtc_timer_update(RTCState *s)
                     delta = period - ((now - s->start_time) % period);
                 if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
                     create_periodic_time(v, &s->pt, delta, period,
-                                         RTC_IRQ, NULL, s);
+                                         RTC_IRQ, rtc_pf_callback, s);
                 else
                     s->check_ticks_since = now;
             }
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 1961bda..f7af688 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -231,12 +231,9 @@ int pt_update_irq(struct vcpu *v)
     struct periodic_time *pt, *temp, *earliest_pt;
     uint64_t max_lag;
     int irq, is_lapic;
-    void *pt_priv;
 
- rescan:
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
- rescan_locked:
     earliest_pt = NULL;
     max_lag = -1ULL;
     list_for_each_entry_safe ( pt, temp, head, list )
@@ -270,48 +267,11 @@ int pt_update_irq(struct vcpu *v)
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
     is_lapic = (earliest_pt->source == PTSRC_lapic);
-    pt_priv = earliest_pt->priv;
 
     spin_unlock(&v->arch.hvm_vcpu.tm_lock);
 
     if ( is_lapic )
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    else if ( irq == RTC_IRQ && pt_priv )
-    {
-        if ( !rtc_periodic_interrupt(pt_priv) )
-            irq = -1;
-
-        pt_lock(earliest_pt);
-
-        if ( irq < 0 && earliest_pt->pending_intr_nr )
-        {
-            /*
-             * RTC periodic timer runs without the corresponding interrupt
-             * being enabled - need to mimic enough of pt_intr_post() to keep
-             * things going.
-             */
-            earliest_pt->pending_intr_nr = 0;
-            earliest_pt->irq_issued = 0;
-            set_timer(&earliest_pt->timer, earliest_pt->scheduled);
-        }
-        else if ( irq >= 0 && pt_irq_masked(earliest_pt) )
-        {
-            if ( earliest_pt->on_list )
-            {
-                /* suspend timer emulation */
-                list_del(&earliest_pt->list);
-                earliest_pt->on_list = 0;
-            }
-            irq = -1;
-        }
-
-        /* Avoid dropping the lock if we can. */
-        if ( irq < 0 && v == earliest_pt->vcpu )
-            goto rescan_locked;
-        pt_unlock(earliest_pt);
-        if ( irq < 0 )
-            goto rescan;
-    }
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 9f48635..7d62653 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -184,7 +184,6 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
-bool_t rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:33:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:33:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70o-0004yP-Av; Thu, 12 Jun 2014 15:33:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70n-0004yA-1L
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:57 +0000
Received: from [85.158.143.35:65006] by server-3.bemta-4.messagelabs.com id
	82/A4-13602-468C9935; Thu, 12 Jun 2014 15:33:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1402587234!10997139!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26965 invoked from network); 12 Jun 2014 15:33:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:33:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70k-0007a3-Eh
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:54 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70k-0005sY-Cx
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:33:54 +0000
Date: Thu, 12 Jun 2014 15:33:54 +0000
Message-Id: <E1Wv70k-0005sY-Cx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm/rtc: inject RTC periodic
	interupts from the vpt code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0424cb9a343aba974832551ee841d8e43c22d1bd
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Fri May 23 15:23:23 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:23:23 2014 +0200

    x86/hvm/rtc: inject RTC periodic interupts from the vpt code
    
    Let the vpt code drive the RTC's timer interrupts directly, as it does
    for other periodic time sources, and fix up the register state in a
    vpt callback when the interrupt is injected.
    
    This fixes a hang seen on Windows 2003 in no-missed-ticks mode, where
    when a tick was pending, the early callback from the VPT code would
    always set REG_C.PF on every VMENTER; meanwhile the guest was in its
    interrupt handler reading REG_C in a loop and waiting to see it clear.
    
    One drawback is that a guest that attempts to suppress RTC periodic
    interrupts by failing to read REG_C will receive up to 10 spurious
    interrupts, even in 'strict' mode.  However:
     - since all previous RTC models have had this property (including
       the current one, since 'no-ack' mode is hard-coded on) we're
       pretty sure that all guests can handle this; and
     - we're already playing some other interesting games with this
       interrupt in the vpt code.
    
    One other corner case: a guest that enables the PF timer interrupt,
    masks the interupt in the APIC and then polls REG_C looking for PF
    will not see PF getting set.  The more likely case of enabling the
    timers and masking the interrupt with REG_B.PIE is already handled
    correctly.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: c7e35c6ec705d777c0a11124ec28876f1468f2c5
    master date: 2014-02-25 09:29:26 +0100
---
 xen/arch/x86/hvm/rtc.c        |   25 +++++++++++--------------
 xen/arch/x86/hvm/vpt.c        |   40 ----------------------------------------
 xen/include/asm-x86/hvm/vpt.h |    1 -
 3 files changed, 11 insertions(+), 55 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index 1a731f7..d641d95 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -78,29 +78,26 @@ static void rtc_update_irq(RTCState *s)
     hvm_isa_irq_assert(vrtc_domain(s), RTC_IRQ);
 }
 
-bool_t rtc_periodic_interrupt(void *opaque)
+/* Called by the VPT code after it's injected a PF interrupt for us.
+ * Fix up the register state to reflect what happened. */
+static void rtc_pf_callback(struct vcpu *v, void *opaque)
 {
     RTCState *s = opaque;
-    bool_t ret;
 
     spin_lock(&s->lock);
-    ret = rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF);
-    if ( rtc_mode_is(s, no_ack) || !(s->hw.cmos_data[RTC_REG_C] & RTC_PF) )
-    {
-        s->hw.cmos_data[RTC_REG_C] |= RTC_PF;
-        rtc_update_irq(s);
-    }
-    else if ( ++(s->pt_dead_ticks) >= 10 )
+
+    if ( !rtc_mode_is(s, no_ack)
+         && (s->hw.cmos_data[RTC_REG_C] & RTC_IRQF)
+         && ++(s->pt_dead_ticks) >= 10 )
     {
         /* VM is ignoring its RTC; no point in running the timer */
         destroy_periodic_time(&s->pt);
         s->period = 0;
     }
-    if ( !(s->hw.cmos_data[RTC_REG_C] & RTC_IRQF) )
-        ret = 0;
-    spin_unlock(&s->lock);
 
-    return ret;
+    s->hw.cmos_data[RTC_REG_C] |= RTC_PF|RTC_IRQF;
+
+    spin_unlock(&s->lock);
 }
 
 /* Check whether the REG_C.PF bit should have been set by a tick since
@@ -156,7 +153,7 @@ static void rtc_timer_update(RTCState *s)
                     delta = period - ((now - s->start_time) % period);
                 if ( s->hw.cmos_data[RTC_REG_B] & RTC_PIE )
                     create_periodic_time(v, &s->pt, delta, period,
-                                         RTC_IRQ, NULL, s);
+                                         RTC_IRQ, rtc_pf_callback, s);
                 else
                     s->check_ticks_since = now;
             }
diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c
index 1961bda..f7af688 100644
--- a/xen/arch/x86/hvm/vpt.c
+++ b/xen/arch/x86/hvm/vpt.c
@@ -231,12 +231,9 @@ int pt_update_irq(struct vcpu *v)
     struct periodic_time *pt, *temp, *earliest_pt;
     uint64_t max_lag;
     int irq, is_lapic;
-    void *pt_priv;
 
- rescan:
     spin_lock(&v->arch.hvm_vcpu.tm_lock);
 
- rescan_locked:
     earliest_pt = NULL;
     max_lag = -1ULL;
     list_for_each_entry_safe ( pt, temp, head, list )
@@ -270,48 +267,11 @@ int pt_update_irq(struct vcpu *v)
     earliest_pt->irq_issued = 1;
     irq = earliest_pt->irq;
     is_lapic = (earliest_pt->source == PTSRC_lapic);
-    pt_priv = earliest_pt->priv;
 
     spin_unlock(&v->arch.hvm_vcpu.tm_lock);
 
     if ( is_lapic )
         vlapic_set_irq(vcpu_vlapic(v), irq, 0);
-    else if ( irq == RTC_IRQ && pt_priv )
-    {
-        if ( !rtc_periodic_interrupt(pt_priv) )
-            irq = -1;
-
-        pt_lock(earliest_pt);
-
-        if ( irq < 0 && earliest_pt->pending_intr_nr )
-        {
-            /*
-             * RTC periodic timer runs without the corresponding interrupt
-             * being enabled - need to mimic enough of pt_intr_post() to keep
-             * things going.
-             */
-            earliest_pt->pending_intr_nr = 0;
-            earliest_pt->irq_issued = 0;
-            set_timer(&earliest_pt->timer, earliest_pt->scheduled);
-        }
-        else if ( irq >= 0 && pt_irq_masked(earliest_pt) )
-        {
-            if ( earliest_pt->on_list )
-            {
-                /* suspend timer emulation */
-                list_del(&earliest_pt->list);
-                earliest_pt->on_list = 0;
-            }
-            irq = -1;
-        }
-
-        /* Avoid dropping the lock if we can. */
-        if ( irq < 0 && v == earliest_pt->vcpu )
-            goto rescan_locked;
-        pt_unlock(earliest_pt);
-        if ( irq < 0 )
-            goto rescan;
-    }
     else
     {
         hvm_isa_irq_deassert(v->domain, irq);
diff --git a/xen/include/asm-x86/hvm/vpt.h b/xen/include/asm-x86/hvm/vpt.h
index 9f48635..7d62653 100644
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -184,7 +184,6 @@ void rtc_migrate_timers(struct vcpu *v);
 void rtc_deinit(struct domain *d);
 void rtc_reset(struct domain *d);
 void rtc_update_clock(struct domain *d);
-bool_t rtc_periodic_interrupt(void *);
 
 void pmtimer_init(struct vcpu *v);
 void pmtimer_deinit(struct domain *d);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:08 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70y-00050O-FW; Thu, 12 Jun 2014 15:34:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70x-000504-2M
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:07 +0000
Received: from [85.158.143.35:6415] by server-1.bemta-4.messagelabs.com id
	91/03-09853-E68C9935; Thu, 12 Jun 2014 15:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1402587244!10992055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9955 invoked from network); 12 Jun 2014 15:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70u-0007ac-Kc
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70u-0005t7-Iy
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:04 +0000
Date: Thu, 12 Jun 2014 15:34:04 +0000
Message-Id: <E1Wv70u-0005t7-Iy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm/rtc: always deassert the
	IRQ line when clearing REG_C.IRQF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb99d5a31ee76419e26e976b5ce1cb5e788bb3d5
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Fri May 23 15:24:09 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:24:09 2014 +0200

    x86/hvm/rtc: always deassert the IRQ line when clearing REG_C.IRQF
    
    Even in no-ack mode, there's no reason to leave the line asserted
    after an explicit ack of the interrupt.
    
    Furthermore, rtc_update_irq() is an unconditional noop having just cleared
    REG_C.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6d27a537727ca933bfef8ba01bc65847dc97cee1
    master date: 2014-02-25 09:30:21 +0100
---
 xen/arch/x86/hvm/rtc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index d641d95..639b4c5 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -673,9 +673,8 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
         check_for_pf_ticks(s);
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
-        if ( (ret & RTC_IRQF) && !rtc_mode_is(s, no_ack) )
+        if ( ret & RTC_IRQF )
             hvm_isa_irq_deassert(d, RTC_IRQ);
-        rtc_update_irq(s);
         check_update_timer(s);
         alarm_timer_update(s);
         s->pt_dead_ticks = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:08 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv70y-00050O-FW; Thu, 12 Jun 2014 15:34:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70x-000504-2M
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:07 +0000
Received: from [85.158.143.35:6415] by server-1.bemta-4.messagelabs.com id
	91/03-09853-E68C9935; Thu, 12 Jun 2014 15:34:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1402587244!10992055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9955 invoked from network); 12 Jun 2014 15:34:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70u-0007ac-Kc
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv70u-0005t7-Iy
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:04 +0000
Date: Thu, 12 Jun 2014 15:34:04 +0000
Message-Id: <E1Wv70u-0005t7-Iy@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/hvm/rtc: always deassert the
	IRQ line when clearing REG_C.IRQF
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cb99d5a31ee76419e26e976b5ce1cb5e788bb3d5
Author:     Tim Deegan <tim@xen.org>
AuthorDate: Fri May 23 15:24:09 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:24:09 2014 +0200

    x86/hvm/rtc: always deassert the IRQ line when clearing REG_C.IRQF
    
    Even in no-ack mode, there's no reason to leave the line asserted
    after an explicit ack of the interrupt.
    
    Furthermore, rtc_update_irq() is an unconditional noop having just cleared
    REG_C.
    
    Signed-off-by: Tim Deegan <tim@xen.org>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6d27a537727ca933bfef8ba01bc65847dc97cee1
    master date: 2014-02-25 09:30:21 +0100
---
 xen/arch/x86/hvm/rtc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c
index d641d95..639b4c5 100644
--- a/xen/arch/x86/hvm/rtc.c
+++ b/xen/arch/x86/hvm/rtc.c
@@ -673,9 +673,8 @@ static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
         check_for_pf_ticks(s);
         ret = s->hw.cmos_data[s->hw.cmos_index];
         s->hw.cmos_data[RTC_REG_C] = 0x00;
-        if ( (ret & RTC_IRQF) && !rtc_mode_is(s, no_ack) )
+        if ( ret & RTC_IRQF )
             hvm_isa_irq_deassert(d, RTC_IRQ);
-        rtc_update_irq(s);
         check_update_timer(s);
         alarm_timer_update(s);
         s->pt_dead_ticks = 0;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv719-00052T-IU; Thu, 12 Jun 2014 15:34:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv717-000524-TT
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:18 +0000
Received: from [85.158.137.68:32266] by server-9.bemta-3.messagelabs.com id
	A9/E3-30063-978C9935; Thu, 12 Jun 2014 15:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1402587254!9719072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5014 invoked from network); 12 Jun 2014 15:34:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv714-0007ai-QC
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv714-0005tZ-Oq
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:14 +0000
Date: Thu, 12 Jun 2014 15:34:14 +0000
Message-Id: <E1Wv714-0005tZ-Oq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: use native RDTSC(P) execution
	when guest and host frequencies are the same
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2dc6658490e1a3ab1b73cc484c1df463cc43f994
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri May 23 15:28:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:28:25 2014 +0200

    x86: use native RDTSC(P) execution when guest and host frequencies are the same
    
    We should be able to continue using native RDTSC(P) execution on
    HVM/PVH guests after migration if host and guest frequencies are
    equal (this includes the case when the frequencies are made equal
    by TSC scaling feature).
    
    This also allows us to revert main part of commit 4aab59a3 (svm: Do not
    intercept RDTSC(P) when TSC scaling is supported by hardware) which
    was wrong: while RDTSC intercepts were disabled domain's vtsc could
    still be set, leading to inconsistent view of guest's TSC.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 82713ec8d2b65d17f13e46a131e38bfe5baf8bd6
    master date: 2014-04-22 12:07:37 +0200
---
 xen/arch/x86/hvm/svm/svm.c |    2 +-
 xen/arch/x86/time.c        |   15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 3fc729c..c7ff72b 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -728,7 +728,7 @@ static void svm_set_rdtsc_exiting(struct vcpu *v, bool_t enable)
     general1_intercepts &= ~GENERAL1_INTERCEPT_RDTSC;
     general2_intercepts &= ~GENERAL2_INTERCEPT_RDTSCP;
 
-    if ( enable && !cpu_has_tsc_ratio )
+    if ( enable )
     {
         general1_intercepts |= GENERAL1_INTERCEPT_RDTSC;
         general2_intercepts |= GENERAL2_INTERCEPT_RDTSCP;
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bce4105..f394ac1 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -37,6 +37,7 @@
 #include <asm/hpet.h>
 #include <io_ports.h>
 #include <asm/setup.h> /* for early_time_init */
+#include <asm/hvm/svm/svm.h> /* for cpu_has_tsc_ratio */
 #include <public/arch-x86/cpuid.h>
 
 /* opt_clocksource: Force clocksource to one of: pit, hpet, cyclone, acpi. */
@@ -1922,10 +1923,16 @@ void tsc_set_info(struct domain *d,
         d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
         d->arch.tsc_khz = gtsc_khz ? gtsc_khz : cpu_khz;
         set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000 );
-        /* use native TSC if initial host has safe TSC, has not migrated
-         * yet and tsc_khz == cpu_khz */
-        if ( host_tsc_is_safe() && incarnation == 0 &&
-                d->arch.tsc_khz == cpu_khz )
+        /*
+         * Use native TSC if the host has safe TSC and:
+         *  HVM/PVH: host and guest frequencies are the same (either
+         *           "naturally" or via TSC scaling)
+         *  PV: guest has not migrated yet (and thus arch.tsc_khz == cpu_khz)
+         */
+        if ( host_tsc_is_safe() &&
+             ((is_hvm_domain(d) &&
+               (d->arch.tsc_khz == cpu_khz || cpu_has_tsc_ratio)) ||
+              incarnation == 0) )
             d->arch.vtsc = 0;
         else 
             d->arch.ns_to_vtsc = scale_reciprocal(d->arch.vtsc_to_ns);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv719-00052T-IU; Thu, 12 Jun 2014 15:34:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv717-000524-TT
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:18 +0000
Received: from [85.158.137.68:32266] by server-9.bemta-3.messagelabs.com id
	A9/E3-30063-978C9935; Thu, 12 Jun 2014 15:34:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1402587254!9719072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5014 invoked from network); 12 Jun 2014 15:34:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv714-0007ai-QC
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv714-0005tZ-Oq
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:14 +0000
Date: Thu, 12 Jun 2014 15:34:14 +0000
Message-Id: <E1Wv714-0005tZ-Oq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: use native RDTSC(P) execution
	when guest and host frequencies are the same
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2dc6658490e1a3ab1b73cc484c1df463cc43f994
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Fri May 23 15:28:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:28:25 2014 +0200

    x86: use native RDTSC(P) execution when guest and host frequencies are the same
    
    We should be able to continue using native RDTSC(P) execution on
    HVM/PVH guests after migration if host and guest frequencies are
    equal (this includes the case when the frequencies are made equal
    by TSC scaling feature).
    
    This also allows us to revert main part of commit 4aab59a3 (svm: Do not
    intercept RDTSC(P) when TSC scaling is supported by hardware) which
    was wrong: while RDTSC intercepts were disabled domain's vtsc could
    still be set, leading to inconsistent view of guest's TSC.
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    master commit: 82713ec8d2b65d17f13e46a131e38bfe5baf8bd6
    master date: 2014-04-22 12:07:37 +0200
---
 xen/arch/x86/hvm/svm/svm.c |    2 +-
 xen/arch/x86/time.c        |   15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 3fc729c..c7ff72b 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -728,7 +728,7 @@ static void svm_set_rdtsc_exiting(struct vcpu *v, bool_t enable)
     general1_intercepts &= ~GENERAL1_INTERCEPT_RDTSC;
     general2_intercepts &= ~GENERAL2_INTERCEPT_RDTSCP;
 
-    if ( enable && !cpu_has_tsc_ratio )
+    if ( enable )
     {
         general1_intercepts |= GENERAL1_INTERCEPT_RDTSC;
         general2_intercepts |= GENERAL2_INTERCEPT_RDTSCP;
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index bce4105..f394ac1 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -37,6 +37,7 @@
 #include <asm/hpet.h>
 #include <io_ports.h>
 #include <asm/setup.h> /* for early_time_init */
+#include <asm/hvm/svm/svm.h> /* for cpu_has_tsc_ratio */
 #include <public/arch-x86/cpuid.h>
 
 /* opt_clocksource: Force clocksource to one of: pit, hpet, cyclone, acpi. */
@@ -1922,10 +1923,16 @@ void tsc_set_info(struct domain *d,
         d->arch.vtsc_offset = get_s_time() - elapsed_nsec;
         d->arch.tsc_khz = gtsc_khz ? gtsc_khz : cpu_khz;
         set_time_scale(&d->arch.vtsc_to_ns, d->arch.tsc_khz * 1000 );
-        /* use native TSC if initial host has safe TSC, has not migrated
-         * yet and tsc_khz == cpu_khz */
-        if ( host_tsc_is_safe() && incarnation == 0 &&
-                d->arch.tsc_khz == cpu_khz )
+        /*
+         * Use native TSC if the host has safe TSC and:
+         *  HVM/PVH: host and guest frequencies are the same (either
+         *           "naturally" or via TSC scaling)
+         *  PV: guest has not migrated yet (and thus arch.tsc_khz == cpu_khz)
+         */
+        if ( host_tsc_is_safe() &&
+             ((is_hvm_domain(d) &&
+               (d->arch.tsc_khz == cpu_khz || cpu_has_tsc_ratio)) ||
+              incarnation == 0) )
             d->arch.vtsc = 0;
         else 
             d->arch.ns_to_vtsc = scale_reciprocal(d->arch.vtsc_to_ns);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71I-00053n-LJ; Thu, 12 Jun 2014 15:34:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71H-00053W-Hj
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:27 +0000
Received: from [85.158.139.211:18225] by server-1.bemta-5.messagelabs.com id
	E9/93-01663-288C9935; Thu, 12 Jun 2014 15:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1402587265!9630077!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1314 invoked from network); 12 Jun 2014 15:34:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71E-0007ao-VR
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71E-0005tv-Tj
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:24 +0000
Date: Thu, 12 Jun 2014 15:34:24 +0000
Message-Id: <E1Wv71E-0005tv-Tj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: load current_vmcs only
	when it exists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ecc692b21befcd5f7df87829650a69894b0f9cfc
Author:     Edmund H White <edmund.h.white@intel.com>
AuthorDate: Fri May 23 15:29:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:29:43 2014 +0200

    Nested VMX: load current_vmcs only when it exists
    
    There may not have valid vmcs on current CPU. So only load it when it exists.
    
    This original fixing is from Edmud <edmund.h.white@intel.com>.
    
    Signed-off-by: Edmund H White <edmund.h.white@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 99c03bc6a1f8c6722926d2db781ece045f9d09ae
    master date: 2014-05-12 11:59:19 +0200
---
 xen/arch/x86/hvm/vmx/vmcs.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 822e817..c51fa68 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -818,8 +818,12 @@ void virtual_vmcs_enter(void *vvmcs)
 
 void virtual_vmcs_exit(void *vvmcs)
 {
+    struct vmcs_struct *cur = this_cpu(current_vmcs);
+
     __vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
-    __vmptrld(virt_to_maddr(this_cpu(current_vmcs)));
+    if ( cur )
+        __vmptrld(virt_to_maddr(cur));
+
 }
 
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71I-00053n-LJ; Thu, 12 Jun 2014 15:34:28 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71H-00053W-Hj
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:27 +0000
Received: from [85.158.139.211:18225] by server-1.bemta-5.messagelabs.com id
	E9/93-01663-288C9935; Thu, 12 Jun 2014 15:34:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1402587265!9630077!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1314 invoked from network); 12 Jun 2014 15:34:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71E-0007ao-VR
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71E-0005tv-Tj
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:24 +0000
Date: Thu, 12 Jun 2014 15:34:24 +0000
Message-Id: <E1Wv71E-0005tv-Tj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] Nested VMX: load current_vmcs only
	when it exists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ecc692b21befcd5f7df87829650a69894b0f9cfc
Author:     Edmund H White <edmund.h.white@intel.com>
AuthorDate: Fri May 23 15:29:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:29:43 2014 +0200

    Nested VMX: load current_vmcs only when it exists
    
    There may not have valid vmcs on current CPU. So only load it when it exists.
    
    This original fixing is from Edmud <edmund.h.white@intel.com>.
    
    Signed-off-by: Edmund H White <edmund.h.white@intel.com>
    Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 99c03bc6a1f8c6722926d2db781ece045f9d09ae
    master date: 2014-05-12 11:59:19 +0200
---
 xen/arch/x86/hvm/vmx/vmcs.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 822e817..c51fa68 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -818,8 +818,12 @@ void virtual_vmcs_enter(void *vvmcs)
 
 void virtual_vmcs_exit(void *vvmcs)
 {
+    struct vmcs_struct *cur = this_cpu(current_vmcs);
+
     __vmpclear(pfn_to_paddr(domain_page_map_to_mfn(vvmcs)));
-    __vmptrld(virt_to_maddr(this_cpu(current_vmcs)));
+    if ( cur )
+        __vmptrld(virt_to_maddr(cur));
+
 }
 
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding)
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71S-00055R-OA; Thu, 12 Jun 2014 15:34:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71R-00055C-GI
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:37 +0000
Received: from [85.158.143.35:33365] by server-1.bemta-4.messagelabs.com id
	C2/D3-09853-C88C9935; Thu, 12 Jun 2014 15:34:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1402587275!11009253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13927 invoked from network); 12 Jun 2014 15:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71P-0007au-59
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71P-0005uI-3U
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:35 +0000
Date: Thu, 12 Jun 2014 15:34:35 +0000
Message-Id: <E1Wv71P-0005uI-3U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/MCE: bypass uninitialized vcpu
	in vMCE injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84d7bd515e96f61b01e2e9092f2dce05b263d025
Author:     Kai Huang <kai.huang@linux.intel.com>
AuthorDate: Fri May 23 15:30:22 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:30:22 2014 +0200

    x86/MCE: bypass uninitialized vcpu in vMCE injection
    
    Dom0 may bring up less number of vCPUs than xen hypervisor actually created for
    it, and in this case, on Intel platform, vMCE injection to dom0 will fail due to
    injecting vMCE to uninitialized vcpu, and cause dom0 crash.
    
    Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: a07084525c126c596326dc1442dd218f522f51b4
    master date: 2014-05-14 10:54:39 +0200
---
 xen/arch/x86/cpu/mcheck/vmce.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index af3b491..58afe28 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -357,6 +357,10 @@ int inject_vmce(struct domain *d, int vcpu)
         if ( vcpu != VMCE_INJECT_BROADCAST && vcpu != v->vcpu_id )
             continue;
 
+        /* Don't inject to uninitialized VCPU. */
+        if ( !v->is_initialised )
+            continue;
+
         if ( (is_hvm_domain(d) ||
               guest_has_trap_callback(d, v->vcpu_id, TRAP_machine_check)) &&
              !test_and_set_bool(v->mce_pending) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71S-00055R-OA; Thu, 12 Jun 2014 15:34:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71R-00055C-GI
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:37 +0000
Received: from [85.158.143.35:33365] by server-1.bemta-4.messagelabs.com id
	C2/D3-09853-C88C9935; Thu, 12 Jun 2014 15:34:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1402587275!11009253!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13927 invoked from network); 12 Jun 2014 15:34:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71P-0007au-59
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71P-0005uI-3U
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:35 +0000
Date: Thu, 12 Jun 2014 15:34:35 +0000
Message-Id: <E1Wv71P-0005uI-3U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/MCE: bypass uninitialized vcpu
	in vMCE injection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84d7bd515e96f61b01e2e9092f2dce05b263d025
Author:     Kai Huang <kai.huang@linux.intel.com>
AuthorDate: Fri May 23 15:30:22 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:30:22 2014 +0200

    x86/MCE: bypass uninitialized vcpu in vMCE injection
    
    Dom0 may bring up less number of vCPUs than xen hypervisor actually created for
    it, and in this case, on Intel platform, vMCE injection to dom0 will fail due to
    injecting vMCE to uninitialized vcpu, and cause dom0 crash.
    
    Signed-off-by: Kai Huang <kai.huang@linux.intel.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: a07084525c126c596326dc1442dd218f522f51b4
    master date: 2014-05-14 10:54:39 +0200
---
 xen/arch/x86/cpu/mcheck/vmce.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/vmce.c b/xen/arch/x86/cpu/mcheck/vmce.c
index af3b491..58afe28 100644
--- a/xen/arch/x86/cpu/mcheck/vmce.c
+++ b/xen/arch/x86/cpu/mcheck/vmce.c
@@ -357,6 +357,10 @@ int inject_vmce(struct domain *d, int vcpu)
         if ( vcpu != VMCE_INJECT_BROADCAST && vcpu != v->vcpu_id )
             continue;
 
+        /* Don't inject to uninitialized VCPU. */
+        if ( !v->is_initialised )
+            continue;
+
         if ( (is_hvm_domain(d) ||
               guest_has_trap_callback(d, v->vcpu_id, TRAP_machine_check)) &&
              !test_and_set_bool(v->mce_pending) )
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71d-00057E-R2; Thu, 12 Jun 2014 15:34:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71c-00056r-0C
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:48 +0000
Received: from [85.158.139.211:14648] by server-9.bemta-5.messagelabs.com id
	BF/5D-04350-798C9935; Thu, 12 Jun 2014 15:34:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1402587285!4339286!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27290 invoked from network); 12 Jun 2014 15:34:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71Z-0007b0-Ah
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71Z-0005uh-9e
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:45 +0000
Date: Thu, 12 Jun 2014 15:34:45 +0000
Message-Id: <E1Wv71Z-0005uh-9e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: apply quirks at device setup
	time rather than only at boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 25bb52410273c7246b8f07a50b1dd0c2329e94e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 23 15:31:02 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:31:02 2014 +0200

    VT-d: apply quirks at device setup time rather than only at boot
    
    Accessing extended config space may not be possible at boot time, e.g.
    when the memory space used by MMCFG is reserved only via ACPI tables,
    but not in the E820/UEFI memory maps (which we need Dom0 to tell us
    about). Consequently the change here still leaves the issue unaddressed
    for systems where the extended config space remains inaccessible (due
    to firmware bugs, i.e. not properly reserving the address space of
    those regions).
    
    With the respective messages now potentially getting logged more than
    once, we ought to consider whether we should issue them only if we in
    fact were required to do any masking (i.e. if the relevant mask bits
    weren't already set).
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 5786718fbaafbe47d72cc1512cd93de79b8fc2fa
    master date: 2014-05-20 15:53:20 +0200
---
 xen/drivers/passthrough/vtd/extern.h |    2 +-
 xen/drivers/passthrough/vtd/iommu.c  |   12 ++++++------
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 14cd90e..afe7faf 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -99,7 +99,7 @@ void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
 void vtd_ops_postamble_quirk(struct iommu* iommu);
 void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
-void pci_vtd_quirk(struct pci_dev *pdev);
+void pci_vtd_quirk(const struct pci_dev *);
 int platform_supports_intremap(void);
 int platform_supports_x2apic(void);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 7ba1be7..61740d2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1475,6 +1475,9 @@ static int domain_context_mapping(
         break;
     }
 
+    if ( !ret && devfn == pdev->devfn )
+        pci_vtd_quirk(pdev);
+
     return ret;
 }
 
@@ -1905,6 +1908,8 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     struct acpi_drhd_unit *drhd = acpi_find_matched_drhd_unit(pdev);
     int ret = drhd ? ats_device(pdev, drhd) : -ENODEV;
 
+    pci_vtd_quirk(pdev);
+
     if ( ret <= 0 )
         return ret;
 
@@ -1976,12 +1981,7 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 
 static int __init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
 {
-    int err;
-
-    err = domain_context_mapping(pdev->domain, devfn, pdev);
-    if ( !err && devfn == pdev->devfn )
-        pci_vtd_quirk(pdev);
-    return err;
+    return domain_context_mapping(pdev->domain, devfn, pdev);
 }
 
 void clear_fault_bits(struct iommu *iommu)
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 2bbcc21..7cbe0ad 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -385,7 +385,7 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
  *   - This can cause system failure upon non-fatal VT-d faults
  *   - Potential security issue if malicious guest trigger VT-d faults
  */
-void __init pci_vtd_quirk(struct pci_dev *pdev)
+void pci_vtd_quirk(const struct pci_dev *pdev)
 {
     int seg = pdev->seg;
     int bus = pdev->bus;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71d-00057E-R2; Thu, 12 Jun 2014 15:34:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71c-00056r-0C
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:48 +0000
Received: from [85.158.139.211:14648] by server-9.bemta-5.messagelabs.com id
	BF/5D-04350-798C9935; Thu, 12 Jun 2014 15:34:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1402587285!4339286!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27290 invoked from network); 12 Jun 2014 15:34:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71Z-0007b0-Ah
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71Z-0005uh-9e
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:45 +0000
Date: Thu, 12 Jun 2014 15:34:45 +0000
Message-Id: <E1Wv71Z-0005uh-9e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: apply quirks at device setup
	time rather than only at boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 25bb52410273c7246b8f07a50b1dd0c2329e94e1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 23 15:31:02 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:31:02 2014 +0200

    VT-d: apply quirks at device setup time rather than only at boot
    
    Accessing extended config space may not be possible at boot time, e.g.
    when the memory space used by MMCFG is reserved only via ACPI tables,
    but not in the E820/UEFI memory maps (which we need Dom0 to tell us
    about). Consequently the change here still leaves the issue unaddressed
    for systems where the extended config space remains inaccessible (due
    to firmware bugs, i.e. not properly reserving the address space of
    those regions).
    
    With the respective messages now potentially getting logged more than
    once, we ought to consider whether we should issue them only if we in
    fact were required to do any masking (i.e. if the relevant mask bits
    weren't already set).
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 5786718fbaafbe47d72cc1512cd93de79b8fc2fa
    master date: 2014-05-20 15:53:20 +0200
---
 xen/drivers/passthrough/vtd/extern.h |    2 +-
 xen/drivers/passthrough/vtd/iommu.c  |   12 ++++++------
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 14cd90e..afe7faf 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -99,7 +99,7 @@ void platform_quirks_init(void);
 void vtd_ops_preamble_quirk(struct iommu* iommu);
 void vtd_ops_postamble_quirk(struct iommu* iommu);
 void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map);
-void pci_vtd_quirk(struct pci_dev *pdev);
+void pci_vtd_quirk(const struct pci_dev *);
 int platform_supports_intremap(void);
 int platform_supports_x2apic(void);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 7ba1be7..61740d2 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1475,6 +1475,9 @@ static int domain_context_mapping(
         break;
     }
 
+    if ( !ret && devfn == pdev->devfn )
+        pci_vtd_quirk(pdev);
+
     return ret;
 }
 
@@ -1905,6 +1908,8 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     struct acpi_drhd_unit *drhd = acpi_find_matched_drhd_unit(pdev);
     int ret = drhd ? ats_device(pdev, drhd) : -ENODEV;
 
+    pci_vtd_quirk(pdev);
+
     if ( ret <= 0 )
         return ret;
 
@@ -1976,12 +1981,7 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
 
 static int __init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
 {
-    int err;
-
-    err = domain_context_mapping(pdev->domain, devfn, pdev);
-    if ( !err && devfn == pdev->devfn )
-        pci_vtd_quirk(pdev);
-    return err;
+    return domain_context_mapping(pdev->domain, devfn, pdev);
 }
 
 void clear_fault_bits(struct iommu *iommu)
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 2bbcc21..7cbe0ad 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -385,7 +385,7 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
  *   - This can cause system failure upon non-fatal VT-d faults
  *   - Potential security issue if malicious guest trigger VT-d faults
  */
-void __init pci_vtd_quirk(struct pci_dev *pdev)
+void pci_vtd_quirk(const struct pci_dev *pdev)
 {
     int seg = pdev->seg;
     int bus = pdev->bus;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71n-00058v-Tl; Thu, 12 Jun 2014 15:34:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71m-00058a-GZ
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:58 +0000
Received: from [85.158.137.68:39454] by server-9.bemta-3.messagelabs.com id
	A3/25-30063-1A8C9935; Thu, 12 Jun 2014 15:34:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1402587295!9706102!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19710 invoked from network); 12 Jun 2014 15:34:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71j-0007b6-Fk
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71j-0005vp-EF
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:55 +0000
Date: Thu, 12 Jun 2014 15:34:55 +0000
Message-Id: <E1Wv71j-0005vp-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: extend error report masking
	workaround to newer chipsets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fcd2acf15077328d38f3d7a7bcad57dc91f37a1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 23 15:31:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:31:35 2014 +0200

    VT-d: extend error report masking workaround to newer chipsets
    
    Add two more PCI IDs to the set that has been taken care of with a
    different workaround long before XSA-59, and (for constency with the
    newer workarounds) log a message here too.
    
    Also move the function wide comment to the cases it applies to; this
    should really have been done by d061d200 ("VT-d: suppress UR signaling
    for server chipsets").
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 04734664eb20c3bf239e473af182bb7ab901d779
    master date: 2014-05-20 15:54:01 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 7cbe0ad..d917b2f 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -379,12 +379,6 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
     }
 }
 
-/*
- * Mask reporting Intel VT-d faults to IOH core logic:
- *   - Some platform escalates VT-d faults to platform errors 
- *   - This can cause system failure upon non-fatal VT-d faults
- *   - Potential security issue if malicious guest trigger VT-d faults
- */
 void pci_vtd_quirk(const struct pci_dev *pdev)
 {
     int seg = pdev->seg;
@@ -402,10 +396,20 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
 
     switch ( pci_conf_read16(seg, bus, dev, func, PCI_DEVICE_ID) )
     {
+    /*
+     * Mask reporting Intel VT-d faults to IOH core logic:
+     *   - Some platform escalates VT-d faults to platform errors.
+     *   - This can cause system failure upon non-fatal VT-d faults.
+     *   - Potential security issue if malicious guest trigger VT-d faults.
+     */
+    case 0x0e28: /* Xeon-E5v2 (IvyBridge) */
     case 0x342e: /* Tylersburg chipset (Nehalem / Westmere systems) */
+    case 0x3728: /* Xeon C5500/C3500 (JasperForest) */
     case 0x3c28: /* Sandybridge */
         val = pci_conf_read32(seg, bus, dev, func, 0x1AC);
         pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31));
+        printk(XENLOG_INFO "Masked VT-d error signaling on %04x:%02x:%02x.%u\n",
+               seg, bus, dev, func);
         break;
 
     /* Tylersburg (EP)/Boxboro (MP) chipsets (NHM-EP/EX, WSM-EP/EX) */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:34:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:34:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv71n-00058v-Tl; Thu, 12 Jun 2014 15:34:59 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71m-00058a-GZ
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:58 +0000
Received: from [85.158.137.68:39454] by server-9.bemta-3.messagelabs.com id
	A3/25-30063-1A8C9935; Thu, 12 Jun 2014 15:34:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1402587295!9706102!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19710 invoked from network); 12 Jun 2014 15:34:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:34:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71j-0007b6-Fk
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71j-0005vp-EF
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:34:55 +0000
Date: Thu, 12 Jun 2014 15:34:55 +0000
Message-Id: <E1Wv71j-0005vp-EF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: extend error report masking
	workaround to newer chipsets
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4fcd2acf15077328d38f3d7a7bcad57dc91f37a1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri May 23 15:31:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:31:35 2014 +0200

    VT-d: extend error report masking workaround to newer chipsets
    
    Add two more PCI IDs to the set that has been taken care of with a
    different workaround long before XSA-59, and (for constency with the
    newer workarounds) log a message here too.
    
    Also move the function wide comment to the cases it applies to; this
    should really have been done by d061d200 ("VT-d: suppress UR signaling
    for server chipsets").
    
    This is CVE-2013-3495 / XSA-59.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 04734664eb20c3bf239e473af182bb7ab901d779
    master date: 2014-05-20 15:54:01 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 7cbe0ad..d917b2f 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -379,12 +379,6 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map)
     }
 }
 
-/*
- * Mask reporting Intel VT-d faults to IOH core logic:
- *   - Some platform escalates VT-d faults to platform errors 
- *   - This can cause system failure upon non-fatal VT-d faults
- *   - Potential security issue if malicious guest trigger VT-d faults
- */
 void pci_vtd_quirk(const struct pci_dev *pdev)
 {
     int seg = pdev->seg;
@@ -402,10 +396,20 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
 
     switch ( pci_conf_read16(seg, bus, dev, func, PCI_DEVICE_ID) )
     {
+    /*
+     * Mask reporting Intel VT-d faults to IOH core logic:
+     *   - Some platform escalates VT-d faults to platform errors.
+     *   - This can cause system failure upon non-fatal VT-d faults.
+     *   - Potential security issue if malicious guest trigger VT-d faults.
+     */
+    case 0x0e28: /* Xeon-E5v2 (IvyBridge) */
     case 0x342e: /* Tylersburg chipset (Nehalem / Westmere systems) */
+    case 0x3728: /* Xeon C5500/C3500 (JasperForest) */
     case 0x3c28: /* Sandybridge */
         val = pci_conf_read32(seg, bus, dev, func, 0x1AC);
         pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31));
+        printk(XENLOG_INFO "Masked VT-d error signaling on %04x:%02x:%02x.%u\n",
+               seg, bus, dev, func);
         break;
 
     /* Tylersburg (EP)/Boxboro (MP) chipsets (NHM-EP/EX, WSM-EP/EX) */
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv723-0005Au-0Q; Thu, 12 Jun 2014 15:35:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv721-0005Af-G2
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:13 +0000
Received: from [193.109.254.147:16062] by server-15.bemta-14.messagelabs.com
	id 19/BE-15813-0B8C9935; Thu, 12 Jun 2014 15:35:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1402587311!10895501!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22186 invoked from network); 12 Jun 2014 15:35:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71y-0007bf-Rl
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71t-0005x5-NC
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:05 +0000
Date: Thu, 12 Jun 2014 15:35:05 +0000
Message-Id: <E1Wv71t-0005x5-NC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] move domain to cpupool0 before
	destroying it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2666609f62712657ba99f7474ed5017853f2a7de
Author:     Juergen Gross <juergen.gross@ts.fujitsu.com>
AuthorDate: Fri May 23 15:32:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:32:03 2014 +0200

    move domain to cpupool0 before destroying it
    
    Currently when a domain is destroyed it is removed from the domain_list
    before all of it's resources, including the cpupool membership, are freed.
    This can lead to a situation where the domain is still member of a cpupool
    without for_each_domain_in_cpupool() (or even for_each_domain()) being
    able to find it any more. This in turn can result in rejection of removing
    the last cpu from a cpupool, because there seems to be still a domain in
    the cpupool, even if it can't be found by scanning through all domains.
    
    This situation can be avoided by moving the domain to be destroyed to
    cpupool0 first and then remove it from this cpupool BEFORE deleting it from
    the domain_list. As cpupool0 is always active and a domain without any cpupool
    membership is implicitly regarded as belonging to cpupool0, this poses no
    problem.
    
    Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: bac6334b51d9bcfe57ecf4a4cb5288348fcf044a
    master date: 2014-05-20 15:55:42 +0200
---
 xen/common/domain.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index df17ece..e1a2376 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -530,6 +530,8 @@ int domain_kill(struct domain *d)
             BUG_ON(rc != -EAGAIN);
             break;
         }
+        if ( sched_move_domain(d, cpupool0) )
+            return -EAGAIN;
         for_each_vcpu ( d, v )
             unmap_vcpu_info(v);
         d->is_dying = DOMDYING_dead;
@@ -712,8 +714,6 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     sched_destroy_domain(d);
 
-    cpupool_rm_domain(d);
-
     /* Free page used by xen oprofile buffer. */
 #ifdef CONFIG_XENOPROF
     free_xenoprof_pages(d);
@@ -760,6 +760,8 @@ void domain_destroy(struct domain *d)
     if ( _atomic_read(old) != 0 )
         return;
 
+    cpupool_rm_domain(d);
+
     /* Delete from task list and task hashtable. */
     TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id);
     spin_lock(&domlist_update_lock);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv723-0005Au-0Q; Thu, 12 Jun 2014 15:35:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv721-0005Af-G2
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:13 +0000
Received: from [193.109.254.147:16062] by server-15.bemta-14.messagelabs.com
	id 19/BE-15813-0B8C9935; Thu, 12 Jun 2014 15:35:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1402587311!10895501!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22186 invoked from network); 12 Jun 2014 15:35:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71y-0007bf-Rl
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv71t-0005x5-NC
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:05 +0000
Date: Thu, 12 Jun 2014 15:35:05 +0000
Message-Id: <E1Wv71t-0005x5-NC@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] move domain to cpupool0 before
	destroying it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2666609f62712657ba99f7474ed5017853f2a7de
Author:     Juergen Gross <juergen.gross@ts.fujitsu.com>
AuthorDate: Fri May 23 15:32:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri May 23 15:32:03 2014 +0200

    move domain to cpupool0 before destroying it
    
    Currently when a domain is destroyed it is removed from the domain_list
    before all of it's resources, including the cpupool membership, are freed.
    This can lead to a situation where the domain is still member of a cpupool
    without for_each_domain_in_cpupool() (or even for_each_domain()) being
    able to find it any more. This in turn can result in rejection of removing
    the last cpu from a cpupool, because there seems to be still a domain in
    the cpupool, even if it can't be found by scanning through all domains.
    
    This situation can be avoided by moving the domain to be destroyed to
    cpupool0 first and then remove it from this cpupool BEFORE deleting it from
    the domain_list. As cpupool0 is always active and a domain without any cpupool
    membership is implicitly regarded as belonging to cpupool0, this poses no
    problem.
    
    Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    master commit: bac6334b51d9bcfe57ecf4a4cb5288348fcf044a
    master date: 2014-05-20 15:55:42 +0200
---
 xen/common/domain.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index df17ece..e1a2376 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -530,6 +530,8 @@ int domain_kill(struct domain *d)
             BUG_ON(rc != -EAGAIN);
             break;
         }
+        if ( sched_move_domain(d, cpupool0) )
+            return -EAGAIN;
         for_each_vcpu ( d, v )
             unmap_vcpu_info(v);
         d->is_dying = DOMDYING_dead;
@@ -712,8 +714,6 @@ static void complete_domain_destroy(struct rcu_head *head)
 
     sched_destroy_domain(d);
 
-    cpupool_rm_domain(d);
-
     /* Free page used by xen oprofile buffer. */
 #ifdef CONFIG_XENOPROF
     free_xenoprof_pages(d);
@@ -760,6 +760,8 @@ void domain_destroy(struct domain *d)
     if ( _atomic_read(old) != 0 )
         return;
 
+    cpupool_rm_domain(d);
+
     /* Delete from task list and task hashtable. */
     TRACE_1D(TRC_SCHED_DOM_REM, d->domain_id);
     spin_lock(&domlist_update_lock);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:35 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72N-0005DT-5n; Thu, 12 Jun 2014 15:35:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72M-0005DL-2t
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:34 +0000
Received: from [85.158.137.68:30259] by server-10.bemta-3.messagelabs.com id
	9D/FF-16608-5C8C9935; Thu, 12 Jun 2014 15:35:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1402587331!9738763!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1834 invoked from network); 12 Jun 2014 15:35:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72J-0007bo-Cg
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72J-0005yO-4V
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:31 +0000
Date: Thu, 12 Jun 2014 15:35:31 +0000
Message-Id: <E1Wv72J-0005yO-4V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: fix mask applied to DMIBAR
	in desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fbe9076a7e63f0b8b41afb1f129158d0e5ced181
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:15:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:15:21 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: f8ecf31c31906552522c2a1b0d1cada07d78876e
    master date: 2014-05-26 12:28:46 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index d917b2f..33f3942 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000UL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:35 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72N-0005DT-5n; Thu, 12 Jun 2014 15:35:35 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72M-0005DL-2t
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:34 +0000
Received: from [85.158.137.68:30259] by server-10.bemta-3.messagelabs.com id
	9D/FF-16608-5C8C9935; Thu, 12 Jun 2014 15:35:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1402587331!9738763!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1834 invoked from network); 12 Jun 2014 15:35:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72J-0007bo-Cg
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72J-0005yO-4V
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:31 +0000
Date: Thu, 12 Jun 2014 15:35:31 +0000
Message-Id: <E1Wv72J-0005yO-4V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: fix mask applied to DMIBAR
	in desktop chipset XSA-59 workaround
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fbe9076a7e63f0b8b41afb1f129158d0e5ced181
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:15:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:15:21 2014 +0200

    VT-d: fix mask applied to DMIBAR in desktop chipset XSA-59 workaround
    
    In commit  ("VT-d: suppress UR signaling for desktop chipsets")
    the mask applied to the value read from DMIBAR is to narrow, only the
    comment accompanying it was correct. Fix that and tag the literal
    number as "long" at once to avoid eventual compiler warnings.
    
    The widest possible value so far is 39 bits; all chipsets covered here
    but having less than this number of bits have the remaining bits marked
    reserved (zero), and hence there's no need for making the mask chipset
    specific.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: f8ecf31c31906552522c2a1b0d1cada07d78876e
    master date: 2014-05-26 12:28:46 +0200
---
 xen/drivers/passthrough/vtd/quirks.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index d917b2f..33f3942 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -467,7 +467,7 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     case 0xc00: case 0xc04: case 0xc08: /* Haswell */
         bar = pci_conf_read32(seg, bus, dev, func, 0x6c);
         bar = (bar << 32) | pci_conf_read32(seg, bus, dev, func, 0x68);
-        pa = bar & 0x7fffff000; /* bits 12...38 */
+        pa = bar & 0x7ffffff000UL; /* bits 12...38 */
         if ( (bar & 1) && pa &&
              page_is_ram_type(paddr_to_pfn(pa), RAM_TYPE_RESERVED) )
         {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72X-0005Ea-8N; Thu, 12 Jun 2014 15:35:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72W-0005EO-4r
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:44 +0000
Received: from [85.158.139.211:42445] by server-14.bemta-5.messagelabs.com id
	C9/72-27057-FC8C9935; Thu, 12 Jun 2014 15:35:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1402587341!9616156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27968 invoked from network); 12 Jun 2014 15:35:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72T-0007bu-IF
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72T-0005yt-Gj
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:41 +0000
Date: Thu, 12 Jun 2014 15:35:41 +0000
Message-Id: <E1Wv72T-0005yt-Gj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1051e3749ececb967273c87f848d2772bc8fb71
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:16:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:16:19 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6b4d71d028f445cba7426a144751fddc8bfdd67b
    master date: 2014-05-28 09:50:33 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 1294561..5e02ac8 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72X-0005Ea-8N; Thu, 12 Jun 2014 15:35:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72W-0005EO-4r
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:44 +0000
Received: from [85.158.139.211:42445] by server-14.bemta-5.messagelabs.com id
	C9/72-27057-FC8C9935; Thu, 12 Jun 2014 15:35:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1402587341!9616156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27968 invoked from network); 12 Jun 2014 15:35:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72T-0007bu-IF
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72T-0005yt-Gj
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:41 +0000
Date: Thu, 12 Jun 2014 15:35:41 +0000
Message-Id: <E1Wv72T-0005yt-Gj@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] AMD IOMMU: don't free page table
	prematurely
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b1051e3749ececb967273c87f848d2772bc8fb71
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:16:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:16:19 2014 +0200

    AMD IOMMU: don't free page table prematurely
    
    iommu_merge_pages() still wants to look at the next level page table,
    the TLB flush necessary before freeing too happens in that function,
    and if it fails no free should happen at all. Hence the freeing must
    be done after that function returned successfully, not before it's
    being called.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    Tested-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
    master commit: 6b4d71d028f445cba7426a144751fddc8bfdd67b
    master date: 2014-05-28 09:50:33 +0200
---
 xen/drivers/passthrough/amd/iommu_map.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_map.c b/xen/drivers/passthrough/amd/iommu_map.c
index 1294561..5e02ac8 100644
--- a/xen/drivers/passthrough/amd/iommu_map.c
+++ b/xen/drivers/passthrough/amd/iommu_map.c
@@ -691,8 +691,6 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
         if ( !iommu_update_pde_count(d, pt_mfn[merge_level],
                                      gfn, mfn, merge_level) )
             break;
-        /* Deallocate lower level page table */
-        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
 
         if ( iommu_merge_pages(d, pt_mfn[merge_level], gfn, 
                                flags, merge_level) )
@@ -703,6 +701,9 @@ int amd_iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn,
             domain_crash(d);
             return -EFAULT;
         }
+
+        /* Deallocate lower level page table */
+        free_amd_iommu_pgtable(mfn_to_page(pt_mfn[merge_level - 1]));
     }
 
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72i-0005GL-Ay; Thu, 12 Jun 2014 15:35:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72g-0005Fv-Ij
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:54 +0000
Received: from [193.109.254.147:25498] by server-7.bemta-14.messagelabs.com id
	1E/53-17726-9D8C9935; Thu, 12 Jun 2014 15:35:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1402587351!10792849!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7926 invoked from network); 12 Jun 2014 15:35:52 -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;
	12 Jun 2014 15:35:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72d-0007c0-OE
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72d-000601-Mf
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:51 +0000
Date: Thu, 12 Jun 2014 15:35:51 +0000
Message-Id: <E1Wv72d-000601-Mf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't use VA for cache flush
	when also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7db17e89d11470e0bbcb145273279e3d5537a491
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:16:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:16:52 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72i-0005GL-Ay; Thu, 12 Jun 2014 15:35:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72g-0005Fv-Ij
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:54 +0000
Received: from [193.109.254.147:25498] by server-7.bemta-14.messagelabs.com id
	1E/53-17726-9D8C9935; Thu, 12 Jun 2014 15:35:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1402587351!10792849!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7926 invoked from network); 12 Jun 2014 15:35:52 -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;
	12 Jun 2014 15:35:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72d-0007c0-OE
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72d-000601-Mf
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:51 +0000
Date: Thu, 12 Jun 2014 15:35:51 +0000
Message-Id: <E1Wv72d-000601-Mf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: don't use VA for cache flush
	when also flushing TLB
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7db17e89d11470e0bbcb145273279e3d5537a491
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:16:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:16:52 2014 +0200

    x86: don't use VA for cache flush when also flushing TLB
    
    Doing both flushes at once is a strong indication for the address
    mapping to either having got dropped (in which case the cache flush,
    when done via INVLPG, would fault) or its physical address having
    changed (in which case the cache flush would end up being done on the
    wrong address range). There is no adverse effect (other than the
    obvious performance one) using WBINVD in this case regardless of the
    range's size; only map_pages_to_xen() uses combined flushes at present.
    
    This problem was observed with the 2nd try backport of d6cb14b3 ("VT-d:
    suppress UR signaling for desktop chipsets") to 4.2 (where ioremap()
    needs to be replaced with set_fixmap_nocache(); the now commented out
    __set_fixmap(, 0, 0) there to undo the mapping resulted in the first of
    the above two scenarios).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    master commit: 50df6f7429f73364bbddb0970a3a34faa01a7790
    master date: 2014-05-28 09:51:07 +0200
---
 xen/arch/x86/flushtlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index e0388e7..1b75652 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -152,7 +152,8 @@ void flush_area_local(const void *va, unsigned int flags)
         if ( order < (BITS_PER_LONG - PAGE_SHIFT) )
             sz = 1UL << (order + PAGE_SHIFT);
 
-        if ( c->x86_clflush_size && c->x86_cache_size && sz &&
+        if ( !(flags & (FLUSH_TLB|FLUSH_TLB_GLOBAL)) &&
+             c->x86_clflush_size && c->x86_cache_size && sz &&
              ((sz >> 10) < c->x86_cache_size) )
         {
             va = (const void *)((unsigned long)va & ~(sz - 1));
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72k-0005H2-DF; Thu, 12 Jun 2014 15:35:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72i-0005GB-50
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:56 +0000
Received: from [85.158.139.211:28375] by server-8.bemta-5.messagelabs.com id
	FF/AB-11310-BD8C9935; Thu, 12 Jun 2014 15:35:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1402587321!6279355!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31130 invoked from network); 12 Jun 2014 15:35:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv729-0007bl-19
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv728-0005xm-Vx
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:21 +0000
Date: Thu, 12 Jun 2014 15:35:20 +0000
Message-Id: <E1Wv728-0005xm-Vx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8376bafa49183a55103051522ff917a8840b1664
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:14:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:14:31 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 98f73d9..e4463ff 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,6 +32,7 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
+#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -760,21 +761,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:35:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:35:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72k-0005H2-DF; Thu, 12 Jun 2014 15:35:58 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72i-0005GB-50
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:56 +0000
Received: from [85.158.139.211:28375] by server-8.bemta-5.messagelabs.com id
	FF/AB-11310-BD8C9935; Thu, 12 Jun 2014 15:35:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1402587321!6279355!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31130 invoked from network); 12 Jun 2014 15:35:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:35:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv729-0007bl-19
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv728-0005xm-Vx
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:35:21 +0000
Date: Thu, 12 Jun 2014 15:35:20 +0000
Message-Id: <E1Wv728-0005xm-Vx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] ACPI/ERST: fix table mapping
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8376bafa49183a55103051522ff917a8840b1664
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 12:14:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:14:31 2014 +0200

    ACPI/ERST: fix table mapping
    
    acpi_get_table(), when executed before reaching SYS_STATE_active, will
    return a mapping valid only until the next invocation of that funciton.
    Consequently storing the returned pointer for later use is incorrect.
    Copy the logic used in VT-d's DMAR handling.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: fca69b1fc606ece62430076ca4a157e4bed749a8
    master date: 2014-05-26 12:25:01 +0200
---
 xen/drivers/acpi/apei/erst.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/apei/erst.c b/xen/drivers/acpi/apei/erst.c
index 98f73d9..e4463ff 100644
--- a/xen/drivers/acpi/apei/erst.c
+++ b/xen/drivers/acpi/apei/erst.c
@@ -32,6 +32,7 @@
 #include <xen/string.h>
 #include <xen/types.h>
 #include <xen/spinlock.h>
+#include <xen/mm.h>
 #include <xen/cper.h>
 #include <asm/fixmap.h>
 #include <asm/io.h>
@@ -760,21 +761,27 @@ int __init erst_init(void)
 {
 	int rc = 0;
 	acpi_status status;
+	acpi_physical_address erst_addr;
+	acpi_native_uint erst_len;
 	struct apei_exec_context ctx;
 
 	if (acpi_disabled)
 		return -ENODEV;
 
-	status = acpi_get_table(ACPI_SIG_ERST, 0,
-				(struct acpi_table_header **)&erst_tab);
+	status = acpi_get_table_phys(ACPI_SIG_ERST, 0, &erst_addr, &erst_len);
 	if (status == AE_NOT_FOUND) {
 		printk(KERN_INFO "ERST table was not found\n");
 		return -ENODEV;
-	} else if (ACPI_FAILURE(status)) {
+	}
+	if (ACPI_FAILURE(status)) {
 		const char *msg = acpi_format_exception(status);
 		printk(KERN_WARNING "Failed to get ERST table: %s\n", msg);
 		return -EINVAL;
 	}
+	map_pages_to_xen((unsigned long)__va(erst_addr), PFN_DOWN(erst_addr),
+			 PFN_UP(erst_addr + erst_len) - PFN_DOWN(erst_addr),
+			 PAGE_HYPERVISOR);
+	erst_tab = __va(erst_addr);
 
 	rc = erst_check_table(erst_tab);
 	if (rc) {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:36:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:36:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72s-0005Ib-Fr; Thu, 12 Jun 2014 15:36:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72q-0005IH-Fc
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:04 +0000
Received: from [193.109.254.147:32163] by server-5.bemta-14.messagelabs.com id
	BC/12-26413-3E8C9935; Thu, 12 Jun 2014 15:36:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1402587362!10888730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26147 invoked from network); 12 Jun 2014 15:36:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:36:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72n-0007cg-UF
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72n-00060p-SO
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:01 +0000
Date: Thu, 12 Jun 2014 15:36:01 +0000
Message-Id: <E1Wv72n-00060p-SO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac62dbd1b6bb84ac6abc751e0be73649c833f70f
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 3 12:17:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:17:38 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
    master date: 2014-05-28 10:07:50 +0200
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 9ed74e9..b9ed8a3 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:36:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:36:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv72s-0005Ib-Fr; Thu, 12 Jun 2014 15:36:06 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72q-0005IH-Fc
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:04 +0000
Received: from [193.109.254.147:32163] by server-5.bemta-14.messagelabs.com id
	BC/12-26413-3E8C9935; Thu, 12 Jun 2014 15:36:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1402587362!10888730!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26147 invoked from network); 12 Jun 2014 15:36:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:36:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72n-0007cg-UF
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72n-00060p-SO
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:01 +0000
Date: Thu, 12 Jun 2014 15:36:01 +0000
Message-Id: <E1Wv72n-00060p-SO@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] timers: set the deadline more
	accurately
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ac62dbd1b6bb84ac6abc751e0be73649c833f70f
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 3 12:17:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:17:38 2014 +0200

    timers: set the deadline more accurately
    
    Program the timer to the deadline of the closest timer if it is further
    than 50us ahead, otherwise set it 50us ahead.  This way a single event
    fires on time rather than 50us late (as it would have previously) while
    still preventing too many timer wakeups in the case of having many
    timers scheduled close together.
    
    (where 50us is the timer_slop)
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: 054b6dfb61eab00d86ddd5d0ac508f5302da0d52
    master date: 2014-05-28 10:07:50 +0200
---
 xen/common/timer.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/timer.c b/xen/common/timer.c
index 9ed74e9..b9ed8a3 100644
--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -492,8 +492,9 @@ static void timer_softirq_action(void)
         deadline = heap[1]->expires;
     if ( (ts->list != NULL) && (ts->list->expires < deadline) )
         deadline = ts->list->expires;
+    now = NOW();
     this_cpu(timer_deadline) =
-        (deadline == STIME_MAX) ? 0 : deadline + timer_slop;
+        (deadline == STIME_MAX) ? 0 : MAX(deadline, now + timer_slop);
 
     if ( !reprogram_timer(this_cpu(timer_deadline)) )
         raise_softirq(TIMER_SOFTIRQ);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:36:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:36:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv731-0005Kt-VN; Thu, 12 Jun 2014 15:36:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv730-0005KO-F8
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:14 +0000
Received: from [193.109.254.147:33102] by server-13.bemta-14.messagelabs.com
	id D8/F2-23211-DE8C9935; Thu, 12 Jun 2014 15:36:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1402587372!5470988!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30183 invoked from network); 12 Jun 2014 15:36:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:36:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72y-0007cm-3O
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72y-00061W-1M
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:12 +0000
Date: Thu, 12 Jun 2014 15:36:12 +0000
Message-Id: <E1Wv72y-00061W-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21dec63dd70968d94c96fd51a5b21be93e0ab6a9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 16:10:59 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 16:10:59 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
    master date: 2014-06-03 15:17:14 +0200
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 6a6fb68..a12aaa1 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -289,20 +289,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Thu Jun 12 15:36:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 12 Jun 2014 15:36:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wv731-0005Kt-VN; Thu, 12 Jun 2014 15:36:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv730-0005KO-F8
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:14 +0000
Received: from [193.109.254.147:33102] by server-13.bemta-14.messagelabs.com
	id D8/F2-23211-DE8C9935; Thu, 12 Jun 2014 15:36:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1402587372!5470988!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30183 invoked from network); 12 Jun 2014 15:36:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Jun 2014 15:36:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72y-0007cm-3O
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wv72y-00061W-1M
	for xen-changelog@lists.xensource.com; Thu, 12 Jun 2014 15:36:12 +0000
Date: Thu, 12 Jun 2014 15:36:12 +0000
Message-Id: <E1Wv72y-00061W-1M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 21dec63dd70968d94c96fd51a5b21be93e0ab6a9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 16:10:59 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 16:10:59 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
    master date: 2014-06-03 15:17:14 +0200
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 6a6fb68..a12aaa1 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -289,20 +289,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 15 16:44:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 15 Jun 2014 16:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwDXM-0000WR-LU; Sun, 15 Jun 2014 16:44:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXK-0000WM-Op
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:06 +0000
Received: from [85.158.139.211:6120] by server-11.bemta-5.messagelabs.com id
	2B/BF-01425-65DCD935; Sun, 15 Jun 2014 16:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1402850643!10035913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29818 invoked from network); 15 Jun 2014 16:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Jun 2014 16:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXH-0005oM-GH
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXH-0002Gt-Af
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:03 +0000
Date: Sun, 15 Jun 2014 16:44:03 +0000
Message-Id: <E1WwDXH-0002Gt-Af@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update to
	1.7.5-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81f5fc9e4b8421965dbaf0b202bfc73dc6c0452a
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Thu May 15 14:01:59 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Jun 13 09:23:51 2014 +0000

    seabios: update to 1.7.5-rc1
    
    Code grew a bit, had to disable CONFIG_USB_UAS to make the
    bios for the old machine types continue top fit into 128k.
    
    git shortlog since 1.7.4:
    
    Eric Northup (2):
          init_virtio_blk, init_virtio_scsi: reset HBA on error
          vp_init_simple: enable PCI bus-mastering before relying on DMA.
    
    Gabriel L. Somlo (1):
          SMBIOS: Check for aggregate tables & entry point in fw_cfg
    
    Gerd Hoffmann (4):
          smbios: catch zero-length strings
          pci: improve io address space allocation
          xhci: allocate scratch pad buffers
          vga: rework bar detection, add virtio-vga
    
    Johannes Krampf (5):
          build: Remove unneccesary semicolons from acpi_extract scripts.
          build: Make print statements in scripts python3 compatible.
          build: Be explicit that we want integers when dividing for python3 compat.
          build: Avoid sort() on unordered classes for python3 compatibility.
          build: Be careful with unicode and byte strings for python3 compatibility.
    
    Kevin O'Connor (79):
          build: Don't trash the .config file when src/Kconfig changes.
          Remove the pmm handle argument from _malloc().
          Clear the total block transfer count on error.
          Remove unnecesary updates of the disk op->count field.
          Always perform thread cleanup on MainThread stack.
          pvscsi: Don't store reference to struct pci_device.
          pvscsi: Always run entirely in 32bit mode.
          pvscsi: Remove use of LOWFLAT and GLOBALFLAT macros.
          usb: Replace EHCI to UHCI/OHCI synchronization with new scheme.
          Minor - pciinit.c - order header files and use static on local functions.
          Minor - fix misspelling in romfile.c comment.
          ehci: memset the qTD structures in ehci_alloc_intr_pipe
          build: Update kconfig to version in Linux 3.13.
          scripts: Allow encodeint.py to take integers in hex notation.
          coreboot: Support alternative locations for CBFS.
          debug: Add runtime option to not report the debug serial port to the OS.
          debug: Only call serial_debug_preinit() at startup.
          debug: Unify the SeaBIOS debug version banner.
          xhci: Use 64bit writes to ERDP register.
          xhci: Fix incorrect direction setting on status transmissions.
          xhci: Set the interval parameter on interrupt pipes.
          xhci: Verify PAGESIZE register before initializing driver.
          xhci: Allocate and free the xhci inctx structure on each use.
          xhci: Move set_address code from xhci_control to xhci_alloc_pipe.
          xhci: Eliminate 'struct xhci_device'.
          xhci: Support xhci controllers with 64 byte contexts.
          xhci: Allow the XHCI USB controller to be enabled for coreboot.
          xhci: Don't use a dummy endpoint count in configure command.
          xhci: Report the "protocol defined" and PSIC bits of extended capabilities.
          xhci: Support USB hubs on xhci controllers.
          Add call32_params() helper function.
          Add space between DTYPE_* definitions.
          xhci: Run the XHCI driver entirely in 32bit mode.
          Remove pci_writel() and pci_readl() functions.
          xhci: Check if scratch pad allocation fails.
          Increase maximum size of permanent high memory area.
          usb: USB 3 devices encode bMaxPacketSize0 field.
          usb: Move default pipe max packet size code from xhci to main code.
          xhci: Use the same endpoint initialization code in xhci_alloc_pipe()
          xhci: Add copyright notice to usb-xhci.c
          vgabios: Make sure exported structs use PACKED.
          vgabios: Simplify the bios save state area.
          vgabios: Simplify save/restore mechanism.
          vgabios: Attempt to detect old x86emu and force a fault.
          vgabios: Don't interpret TAB character.
          vgabios: Refactor write_teletype and write_chars.
          vgabios: Make sure stdvga_list_modes() doesn't overrun the buffer.
          coreboot: Add support for a "links" file to have aliases in CBFS.
          Enhance nullTrailingSpace() so that it can also skip leading spaces.
          coreboot: Move links file processing to its own function.
          vgabios: Fix PMM allocation request size.
          smbios: Default all values to zero.
          usb: Only disable HID devices if both USB_MOUSE and USB_KEYBOARD are off.
          Minor - fix some typos in comments.
          Replace CONFIG_THREAD_OPTIONROMS with a runtime config setting.
          acpi: Move acpi parsing logic from acpi.c to biostables.c / paravirt.c.
          smbios: Move smbios parsing logic from smbios.c to biostables.c.
          Move PirAddr definition from pirtable.c to biostables.c.
          Use biostables.c for copying bios tables even when generating them.
          Document no new changes to pirtable.c, mptable.c, acpi.c, and smbios.c.
          apm: Remove old Bochs mechanism for shutdown/suspend/standby.
          Minor - remove unused includes from pci.c.
          vgabios: Add option to control use of standard VGA IO ports.
          vgabios: Split vgafb_scroll() into separate move and clear functions.
          vgabios: Rewrite vgafb.c graphics operations to set of 4 standard operators.
          vgabios: Introduce text_address().
          vgabios: Add support for manipulating framebuffers in high memory.
          Set the color attribute when calling vgabios print character.
          vgabios: PMM scan was incorrectly depending on a zero %ds segment.
          coreboot: Make coreboot table searching available to other code.
          vgabios: Initial support for coreboot native vga vgabios.
          Minor - replace some tab characters that slipped into the code.
          Factor out smbios table walking from display_uuid to smbios_next().
          vgabios: Define PlatformRunningOn to make compile happy.
          If an int 1587 call is made from an option rom, stay in bigreal mode.
          xhci: Use msleep() instead of mdelay() for port status delay.
          build: Make sure romlayout.o is recompiled on Kconfig change.
          Fix int 1589 calls when CONFIG_ENTRY_EXTRASTACK is enabled.
          acpi: Fix acpi dsdt compile warning.
    
    Laszlo Ersek (1):
          init_virtio_scsi(): reset the HBA before freeing its virtio ring
    
    Marcel Apfelbaum (3):
          resume: restore piix pm config registers after resume
          hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attached
          hw/pci: check if pci2pci bridges implement optional limit registers
    
    Roger Pau Monne (1):
          ld: don't hardcode "-melf_i386"
    
    Sander Eikelenboom (1):
          Prevent build failure by not splitting line in the middle of arguments to checkrom.py script
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/acpi-dsdt.aml      |  Bin 4407 -> 4405 bytes
 pc-bios/bios-256k.bin      |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin           |  Bin 131072 -> 131072 bytes
 pc-bios/vgabios-cirrus.bin |  Bin 36864 -> 37376 bytes
 pc-bios/vgabios-qxl.bin    |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-stdvga.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-vmware.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios.bin        |  Bin 36864 -> 36864 bytes
 roms/config.seabios-128k   |    3 ++-
 roms/seabios               |    2 +-
 10 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pc-bios/acpi-dsdt.aml b/pc-bios/acpi-dsdt.aml
index cfd16d7..558c10f 100644
Binary files a/pc-bios/acpi-dsdt.aml and b/pc-bios/acpi-dsdt.aml differ
diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin
index 93202c5..3e60a3d 100644
Binary files a/pc-bios/bios-256k.bin and b/pc-bios/bios-256k.bin differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d7899bd..d360d0a 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index d8cb9d2..2ddef2e 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index fe57401..f84a984 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
index 2aa659c..833c464 100644
Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
index bed7068..c4bf322 100644
Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index 928095f..55c6db3 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
diff --git a/roms/config.seabios-128k b/roms/config.seabios-128k
index 41f8381..e653c75 100644
--- a/roms/config.seabios-128k
+++ b/roms/config.seabios-128k
@@ -1,6 +1,7 @@
 # for qemu machine types 1.7 + older
-# need to turn off features (xhci) to make it fit into 128k
+# need to turn off features (xhci,uas) to make it fit into 128k
 CONFIG_QEMU=y
 CONFIG_ROM_SIZE=128
 CONFIG_XEN=n
 CONFIG_USB_XHCI=n
+CONFIG_USB_UAS=n
diff --git a/roms/seabios b/roms/seabios
index 96917a8..b1d4dc9 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 96917a8ed761f017fc8c72ba3b9181fbac03ac59
+Subproject commit b1d4dc908401719c5de78c25313cf82c7cd1d602
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Sun Jun 15 16:44:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 15 Jun 2014 16:44:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwDXM-0000WR-LU; Sun, 15 Jun 2014 16:44:08 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXK-0000WM-Op
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:06 +0000
Received: from [85.158.139.211:6120] by server-11.bemta-5.messagelabs.com id
	2B/BF-01425-65DCD935; Sun, 15 Jun 2014 16:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1402850643!10035913!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29818 invoked from network); 15 Jun 2014 16:44:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Jun 2014 16:44:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXH-0005oM-GH
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXH-0002Gt-Af
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:03 +0000
Date: Sun, 15 Jun 2014 16:44:03 +0000
Message-Id: <E1WwDXH-0002Gt-Af@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update to
	1.7.5-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 81f5fc9e4b8421965dbaf0b202bfc73dc6c0452a
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Thu May 15 14:01:59 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Jun 13 09:23:51 2014 +0000

    seabios: update to 1.7.5-rc1
    
    Code grew a bit, had to disable CONFIG_USB_UAS to make the
    bios for the old machine types continue top fit into 128k.
    
    git shortlog since 1.7.4:
    
    Eric Northup (2):
          init_virtio_blk, init_virtio_scsi: reset HBA on error
          vp_init_simple: enable PCI bus-mastering before relying on DMA.
    
    Gabriel L. Somlo (1):
          SMBIOS: Check for aggregate tables & entry point in fw_cfg
    
    Gerd Hoffmann (4):
          smbios: catch zero-length strings
          pci: improve io address space allocation
          xhci: allocate scratch pad buffers
          vga: rework bar detection, add virtio-vga
    
    Johannes Krampf (5):
          build: Remove unneccesary semicolons from acpi_extract scripts.
          build: Make print statements in scripts python3 compatible.
          build: Be explicit that we want integers when dividing for python3 compat.
          build: Avoid sort() on unordered classes for python3 compatibility.
          build: Be careful with unicode and byte strings for python3 compatibility.
    
    Kevin O'Connor (79):
          build: Don't trash the .config file when src/Kconfig changes.
          Remove the pmm handle argument from _malloc().
          Clear the total block transfer count on error.
          Remove unnecesary updates of the disk op->count field.
          Always perform thread cleanup on MainThread stack.
          pvscsi: Don't store reference to struct pci_device.
          pvscsi: Always run entirely in 32bit mode.
          pvscsi: Remove use of LOWFLAT and GLOBALFLAT macros.
          usb: Replace EHCI to UHCI/OHCI synchronization with new scheme.
          Minor - pciinit.c - order header files and use static on local functions.
          Minor - fix misspelling in romfile.c comment.
          ehci: memset the qTD structures in ehci_alloc_intr_pipe
          build: Update kconfig to version in Linux 3.13.
          scripts: Allow encodeint.py to take integers in hex notation.
          coreboot: Support alternative locations for CBFS.
          debug: Add runtime option to not report the debug serial port to the OS.
          debug: Only call serial_debug_preinit() at startup.
          debug: Unify the SeaBIOS debug version banner.
          xhci: Use 64bit writes to ERDP register.
          xhci: Fix incorrect direction setting on status transmissions.
          xhci: Set the interval parameter on interrupt pipes.
          xhci: Verify PAGESIZE register before initializing driver.
          xhci: Allocate and free the xhci inctx structure on each use.
          xhci: Move set_address code from xhci_control to xhci_alloc_pipe.
          xhci: Eliminate 'struct xhci_device'.
          xhci: Support xhci controllers with 64 byte contexts.
          xhci: Allow the XHCI USB controller to be enabled for coreboot.
          xhci: Don't use a dummy endpoint count in configure command.
          xhci: Report the "protocol defined" and PSIC bits of extended capabilities.
          xhci: Support USB hubs on xhci controllers.
          Add call32_params() helper function.
          Add space between DTYPE_* definitions.
          xhci: Run the XHCI driver entirely in 32bit mode.
          Remove pci_writel() and pci_readl() functions.
          xhci: Check if scratch pad allocation fails.
          Increase maximum size of permanent high memory area.
          usb: USB 3 devices encode bMaxPacketSize0 field.
          usb: Move default pipe max packet size code from xhci to main code.
          xhci: Use the same endpoint initialization code in xhci_alloc_pipe()
          xhci: Add copyright notice to usb-xhci.c
          vgabios: Make sure exported structs use PACKED.
          vgabios: Simplify the bios save state area.
          vgabios: Simplify save/restore mechanism.
          vgabios: Attempt to detect old x86emu and force a fault.
          vgabios: Don't interpret TAB character.
          vgabios: Refactor write_teletype and write_chars.
          vgabios: Make sure stdvga_list_modes() doesn't overrun the buffer.
          coreboot: Add support for a "links" file to have aliases in CBFS.
          Enhance nullTrailingSpace() so that it can also skip leading spaces.
          coreboot: Move links file processing to its own function.
          vgabios: Fix PMM allocation request size.
          smbios: Default all values to zero.
          usb: Only disable HID devices if both USB_MOUSE and USB_KEYBOARD are off.
          Minor - fix some typos in comments.
          Replace CONFIG_THREAD_OPTIONROMS with a runtime config setting.
          acpi: Move acpi parsing logic from acpi.c to biostables.c / paravirt.c.
          smbios: Move smbios parsing logic from smbios.c to biostables.c.
          Move PirAddr definition from pirtable.c to biostables.c.
          Use biostables.c for copying bios tables even when generating them.
          Document no new changes to pirtable.c, mptable.c, acpi.c, and smbios.c.
          apm: Remove old Bochs mechanism for shutdown/suspend/standby.
          Minor - remove unused includes from pci.c.
          vgabios: Add option to control use of standard VGA IO ports.
          vgabios: Split vgafb_scroll() into separate move and clear functions.
          vgabios: Rewrite vgafb.c graphics operations to set of 4 standard operators.
          vgabios: Introduce text_address().
          vgabios: Add support for manipulating framebuffers in high memory.
          Set the color attribute when calling vgabios print character.
          vgabios: PMM scan was incorrectly depending on a zero %ds segment.
          coreboot: Make coreboot table searching available to other code.
          vgabios: Initial support for coreboot native vga vgabios.
          Minor - replace some tab characters that slipped into the code.
          Factor out smbios table walking from display_uuid to smbios_next().
          vgabios: Define PlatformRunningOn to make compile happy.
          If an int 1587 call is made from an option rom, stay in bigreal mode.
          xhci: Use msleep() instead of mdelay() for port status delay.
          build: Make sure romlayout.o is recompiled on Kconfig change.
          Fix int 1589 calls when CONFIG_ENTRY_EXTRASTACK is enabled.
          acpi: Fix acpi dsdt compile warning.
    
    Laszlo Ersek (1):
          init_virtio_scsi(): reset the HBA before freeing its virtio ring
    
    Marcel Apfelbaum (3):
          resume: restore piix pm config registers after resume
          hw/pci: reserve IO and mem for pci-2-pci bridges with no devices attached
          hw/pci: check if pci2pci bridges implement optional limit registers
    
    Roger Pau Monne (1):
          ld: don't hardcode "-melf_i386"
    
    Sander Eikelenboom (1):
          Prevent build failure by not splitting line in the middle of arguments to checkrom.py script
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/acpi-dsdt.aml      |  Bin 4407 -> 4405 bytes
 pc-bios/bios-256k.bin      |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin           |  Bin 131072 -> 131072 bytes
 pc-bios/vgabios-cirrus.bin |  Bin 36864 -> 37376 bytes
 pc-bios/vgabios-qxl.bin    |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-stdvga.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-vmware.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios.bin        |  Bin 36864 -> 36864 bytes
 roms/config.seabios-128k   |    3 ++-
 roms/seabios               |    2 +-
 10 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/pc-bios/acpi-dsdt.aml b/pc-bios/acpi-dsdt.aml
index cfd16d7..558c10f 100644
Binary files a/pc-bios/acpi-dsdt.aml and b/pc-bios/acpi-dsdt.aml differ
diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin
index 93202c5..3e60a3d 100644
Binary files a/pc-bios/bios-256k.bin and b/pc-bios/bios-256k.bin differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d7899bd..d360d0a 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index d8cb9d2..2ddef2e 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index fe57401..f84a984 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
index 2aa659c..833c464 100644
Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
index bed7068..c4bf322 100644
Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index 928095f..55c6db3 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
diff --git a/roms/config.seabios-128k b/roms/config.seabios-128k
index 41f8381..e653c75 100644
--- a/roms/config.seabios-128k
+++ b/roms/config.seabios-128k
@@ -1,6 +1,7 @@
 # for qemu machine types 1.7 + older
-# need to turn off features (xhci) to make it fit into 128k
+# need to turn off features (xhci,uas) to make it fit into 128k
 CONFIG_QEMU=y
 CONFIG_ROM_SIZE=128
 CONFIG_XEN=n
 CONFIG_USB_XHCI=n
+CONFIG_USB_UAS=n
diff --git a/roms/seabios b/roms/seabios
index 96917a8..b1d4dc9 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit 96917a8ed761f017fc8c72ba3b9181fbac03ac59
+Subproject commit b1d4dc908401719c5de78c25313cf82c7cd1d602
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Sun Jun 15 16:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 15 Jun 2014 16:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwDXV-0000X2-Pd; Sun, 15 Jun 2014 16:44:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXU-0000Wo-LG
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:16 +0000
Received: from [85.158.137.68:7347] by server-16.bemta-3.messagelabs.com id
	4C/A9-13481-F5DCD935; Sun, 15 Jun 2014 16:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1402850654!10205816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30512 invoked from network); 15 Jun 2014 16:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Jun 2014 16:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXR-0005oP-QE
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXR-0002HI-KI
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:13 +0000
Date: Sun, 15 Jun 2014 16:44:13 +0000
Message-Id: <E1WwDXR-0002HI-KI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update to 1.7.5
	final
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d9251f642047974d206b04638ca098917980302
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jun 2 16:49:00 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Jun 13 09:23:57 2014 +0000

    seabios: update to 1.7.5 final
    
    git shortlog since -rc1:
    
    Gerd Hoffmann (2):
          acpi: remove PORT_ACPI_PM_BASE constant
          Allow using full io region on q35.
    
    Kevin O'Connor (2):
          vgabios: Add debug message if x86emu leal check triggers.
          python3 fixes for vgabios and csm builds.
    
    Paolo Bonzini (1):
          smm: remove code to handle ACPI disable/enable
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/bios-256k.bin      |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin           |  Bin 131072 -> 131072 bytes
 pc-bios/vgabios-cirrus.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-qxl.bin    |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-stdvga.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-vmware.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios.bin        |  Bin 36864 -> 37376 bytes
 roms/seabios               |    2 +-
 8 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin
index 3e60a3d..09686a3 100644
Binary files a/pc-bios/bios-256k.bin and b/pc-bios/bios-256k.bin differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d360d0a..2314027 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index 2ddef2e..57a5f95 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index f84a984..ed79993 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
index 833c464..d3579b4 100644
Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
index c4bf322..f89845e 100644
Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index 55c6db3..d3038f4 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
diff --git a/roms/seabios b/roms/seabios
index b1d4dc9..e51488c 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit b1d4dc908401719c5de78c25313cf82c7cd1d602
+Subproject commit e51488c5f8800a52ac5c8da7a31b85cca5cc95d2
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Sun Jun 15 16:44:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 15 Jun 2014 16:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwDXV-0000X2-Pd; Sun, 15 Jun 2014 16:44:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXU-0000Wo-LG
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:16 +0000
Received: from [85.158.137.68:7347] by server-16.bemta-3.messagelabs.com id
	4C/A9-13481-F5DCD935; Sun, 15 Jun 2014 16:44:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1402850654!10205816!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30512 invoked from network); 15 Jun 2014 16:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Jun 2014 16:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXR-0005oP-QE
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WwDXR-0002HI-KI
	for xen-changelog@lists.xensource.com; Sun, 15 Jun 2014 16:44:13 +0000
Date: Sun, 15 Jun 2014 16:44:13 +0000
Message-Id: <E1WwDXR-0002HI-KI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-upstream-unstable] seabios: update to 1.7.5
	final
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7d9251f642047974d206b04638ca098917980302
Author:     Gerd Hoffmann <kraxel@redhat.com>
AuthorDate: Mon Jun 2 16:49:00 2014 +0200
Commit:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
CommitDate: Fri Jun 13 09:23:57 2014 +0000

    seabios: update to 1.7.5 final
    
    git shortlog since -rc1:
    
    Gerd Hoffmann (2):
          acpi: remove PORT_ACPI_PM_BASE constant
          Allow using full io region on q35.
    
    Kevin O'Connor (2):
          vgabios: Add debug message if x86emu leal check triggers.
          python3 fixes for vgabios and csm builds.
    
    Paolo Bonzini (1):
          smm: remove code to handle ACPI disable/enable
    
    Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 pc-bios/bios-256k.bin      |  Bin 262144 -> 262144 bytes
 pc-bios/bios.bin           |  Bin 131072 -> 131072 bytes
 pc-bios/vgabios-cirrus.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-qxl.bin    |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-stdvga.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios-vmware.bin |  Bin 37376 -> 37376 bytes
 pc-bios/vgabios.bin        |  Bin 36864 -> 37376 bytes
 roms/seabios               |    2 +-
 8 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pc-bios/bios-256k.bin b/pc-bios/bios-256k.bin
index 3e60a3d..09686a3 100644
Binary files a/pc-bios/bios-256k.bin and b/pc-bios/bios-256k.bin differ
diff --git a/pc-bios/bios.bin b/pc-bios/bios.bin
index d360d0a..2314027 100644
Binary files a/pc-bios/bios.bin and b/pc-bios/bios.bin differ
diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin
index 2ddef2e..57a5f95 100644
Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ
diff --git a/pc-bios/vgabios-qxl.bin b/pc-bios/vgabios-qxl.bin
index f84a984..ed79993 100644
Binary files a/pc-bios/vgabios-qxl.bin and b/pc-bios/vgabios-qxl.bin differ
diff --git a/pc-bios/vgabios-stdvga.bin b/pc-bios/vgabios-stdvga.bin
index 833c464..d3579b4 100644
Binary files a/pc-bios/vgabios-stdvga.bin and b/pc-bios/vgabios-stdvga.bin differ
diff --git a/pc-bios/vgabios-vmware.bin b/pc-bios/vgabios-vmware.bin
index c4bf322..f89845e 100644
Binary files a/pc-bios/vgabios-vmware.bin and b/pc-bios/vgabios-vmware.bin differ
diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin
index 55c6db3..d3038f4 100644
Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ
diff --git a/roms/seabios b/roms/seabios
index b1d4dc9..e51488c 160000
--- a/roms/seabios
+++ b/roms/seabios
@@ -1 +1 @@
-Subproject commit b1d4dc908401719c5de78c25313cf82c7cd1d602
+Subproject commit e51488c5f8800a52ac5c8da7a31b85cca5cc95d2
--
generated by git-patchbot for /home/xen/git/qemu-upstream-unstable.git

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

From xen-changelog-bounces@lists.xen.org Mon Jun 16 14:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jun 2014 14:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwXcq-0003kE-HU; Mon, 16 Jun 2014 14:11:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXco-0003k9-97
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:11:06 +0000
Received: from [193.109.254.147:34773] by server-10.bemta-14.messagelabs.com
	id A3/8B-04546-9FAFE935; Mon, 16 Jun 2014 14:11:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1402927863!11584356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3931 invoked from network); 16 Jun 2014 14:11:04 -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;
	16 Jun 2014 14:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXcl-00014u-I7
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXcl-0000Z7-Ah
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:11:03 +0000
Message-Id: <E1WwXcl-0000Z7-Ah@xenbits.xen.org>
Date: Mon, 16 Jun 2014 14:11:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] set panic notifier priority to
	minimum
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2282941337864018682=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

# HG changeset patch
# User Andrew Jones <drjones@redhat.com>
# Date 1402927235 -7200
# Node ID e2384c98bb97ba12cbe0da3f661ec71dcb7748c3
# Parent  52cb9a45cf3deb321d5b24d5c4c302a67ede16b1
set panic notifier priority to minimum

Execution is not going to continue after telling Xen about the crash.
Let other panic notifiers run by postponing the final hypercall as much
as possible.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krcmár <rkrcmar@redhat.com>

Also cover ia64.

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


diff -r 52cb9a45cf3d -r e2384c98bb97 arch/i386/kernel/setup-xen.c
--- a/arch/i386/kernel/setup-xen.c	Tue Apr 01 10:54:24 2014 +0200
+++ b/arch/i386/kernel/setup-xen.c	Mon Jun 16 16:00:35 2014 +0200
@@ -80,7 +80,8 @@ void __init find_max_pfn(void);
 
 static int xen_panic_event(struct notifier_block *, unsigned long, void *);
 static struct notifier_block xen_panic_block = {
-	xen_panic_event, NULL, 0 /* try to go last */
+	.notifier_call = xen_panic_event,
+	.priority = INT_MIN /* try to go last */
 };
 
 extern char hypercall_page[PAGE_SIZE];
diff -r 52cb9a45cf3d -r e2384c98bb97 arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c	Tue Apr 01 10:54:24 2014 +0200
+++ b/arch/ia64/kernel/setup.c	Mon Jun 16 16:00:35 2014 +0200
@@ -96,7 +96,8 @@ xen_panic_event(struct notifier_block *t
 }
 
 static struct notifier_block xen_panic_block = {
-	xen_panic_event, NULL, 0 /* try to go last */
+	.notifier_call = xen_panic_event,
+	.priority = INT_MIN /* try to go last */
 };
 
 void xen_pm_power_off(void)
diff -r 52cb9a45cf3d -r e2384c98bb97 arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c	Tue Apr 01 10:54:24 2014 +0200
+++ b/arch/x86_64/kernel/setup-xen.c	Mon Jun 16 16:00:35 2014 +0200
@@ -93,7 +93,8 @@ EXPORT_SYMBOL(hypercall_page);
 
 static int xen_panic_event(struct notifier_block *, unsigned long, void *);
 static struct notifier_block xen_panic_block = {
-	xen_panic_event, NULL, 0 /* try to go last */
+	.notifier_call = xen_panic_event,
+	.priority = INT_MIN /* try to go last */
 };
 
 unsigned long *phys_to_machine_mapping;


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

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

From xen-changelog-bounces@lists.xen.org Mon Jun 16 14:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jun 2014 14:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwXcq-0003kE-HU; Mon, 16 Jun 2014 14:11:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXco-0003k9-97
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:11:06 +0000
Received: from [193.109.254.147:34773] by server-10.bemta-14.messagelabs.com
	id A3/8B-04546-9FAFE935; Mon, 16 Jun 2014 14:11:05 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1402927863!11584356!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3931 invoked from network); 16 Jun 2014 14:11:04 -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;
	16 Jun 2014 14:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXcl-00014u-I7
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXcl-0000Z7-Ah
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:11:03 +0000
Message-Id: <E1WwXcl-0000Z7-Ah@xenbits.xen.org>
Date: Mon, 16 Jun 2014 14:11:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] set panic notifier priority to
	minimum
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2282941337864018682=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

# HG changeset patch
# User Andrew Jones <drjones@redhat.com>
# Date 1402927235 -7200
# Node ID e2384c98bb97ba12cbe0da3f661ec71dcb7748c3
# Parent  52cb9a45cf3deb321d5b24d5c4c302a67ede16b1
set panic notifier priority to minimum

Execution is not going to continue after telling Xen about the crash.
Let other panic notifiers run by postponing the final hypercall as much
as possible.

Signed-off-by: Andrew Jones <drjones@redhat.com>
Signed-off-by: Radim Krcmár <rkrcmar@redhat.com>

Also cover ia64.

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


diff -r 52cb9a45cf3d -r e2384c98bb97 arch/i386/kernel/setup-xen.c
--- a/arch/i386/kernel/setup-xen.c	Tue Apr 01 10:54:24 2014 +0200
+++ b/arch/i386/kernel/setup-xen.c	Mon Jun 16 16:00:35 2014 +0200
@@ -80,7 +80,8 @@ void __init find_max_pfn(void);
 
 static int xen_panic_event(struct notifier_block *, unsigned long, void *);
 static struct notifier_block xen_panic_block = {
-	xen_panic_event, NULL, 0 /* try to go last */
+	.notifier_call = xen_panic_event,
+	.priority = INT_MIN /* try to go last */
 };
 
 extern char hypercall_page[PAGE_SIZE];
diff -r 52cb9a45cf3d -r e2384c98bb97 arch/ia64/kernel/setup.c
--- a/arch/ia64/kernel/setup.c	Tue Apr 01 10:54:24 2014 +0200
+++ b/arch/ia64/kernel/setup.c	Mon Jun 16 16:00:35 2014 +0200
@@ -96,7 +96,8 @@ xen_panic_event(struct notifier_block *t
 }
 
 static struct notifier_block xen_panic_block = {
-	xen_panic_event, NULL, 0 /* try to go last */
+	.notifier_call = xen_panic_event,
+	.priority = INT_MIN /* try to go last */
 };
 
 void xen_pm_power_off(void)
diff -r 52cb9a45cf3d -r e2384c98bb97 arch/x86_64/kernel/setup-xen.c
--- a/arch/x86_64/kernel/setup-xen.c	Tue Apr 01 10:54:24 2014 +0200
+++ b/arch/x86_64/kernel/setup-xen.c	Mon Jun 16 16:00:35 2014 +0200
@@ -93,7 +93,8 @@ EXPORT_SYMBOL(hypercall_page);
 
 static int xen_panic_event(struct notifier_block *, unsigned long, void *);
 static struct notifier_block xen_panic_block = {
-	xen_panic_event, NULL, 0 /* try to go last */
+	.notifier_call = xen_panic_event,
+	.priority = INT_MIN /* try to go last */
 };
 
 unsigned long *phys_to_machine_mapping;


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

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

From xen-changelog-bounces@lists.xen.org Mon Jun 16 14:22:08 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jun 2014 14:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwXnT-00046N-26; Mon, 16 Jun 2014 14:22:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXnR-00046A-D4
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:22:06 +0000
Received: from [85.158.143.35:37521] by server-1.bemta-4.messagelabs.com id
	F3/58-09496-C8DFE935; Mon, 16 Jun 2014 14:22:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1402928522!11677810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24022 invoked from network); 16 Jun 2014 14:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Jun 2014 14:22: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 1WwXnO-0001Ae-Lt
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXnO-0000tN-Iy
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:22:02 +0000
Message-Id: <E1WwXnO-0000tN-Iy@xenbits.xen.org>
Date: Mon, 16 Jun 2014 14:22:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] use global sys_reboot()
	declaration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1402927893 -7200
# Node ID 0251893a7d5a99e7574e7fd645cc126b2f641103
# Parent  e2384c98bb97ba12cbe0da3f661ec71dcb7748c3
use global sys_reboot() declaration

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


diff -r e2384c98bb97 -r 0251893a7d5a drivers/xen/core/reboot.c
--- a/drivers/xen/core/reboot.c	Mon Jun 16 16:00:35 2014 +0200
+++ b/drivers/xen/core/reboot.c	Mon Jun 16 16:11:33 2014 +0200
@@ -4,6 +4,7 @@
 #include <linux/unistd.h>
 #include <linux/module.h>
 #include <linux/reboot.h>
+#include <linux/syscalls.h>
 #include <linux/sysrq.h>
 #include <asm/hypervisor.h>
 #include <xen/xenbus.h>
@@ -46,9 +47,6 @@ static int shutdown_process(void *__unus
 				"PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
 	static char *poweroff_argv[] = { "/sbin/poweroff", NULL };
 
-	extern asmlinkage long sys_reboot(int magic1, int magic2,
-					  unsigned int cmd, void *arg);
-
 	if ((shutting_down == SHUTDOWN_POWEROFF) ||
 	    (shutting_down == SHUTDOWN_HALT)) {
 		if (call_usermodehelper("/sbin/poweroff", poweroff_argv,

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

From xen-changelog-bounces@lists.xen.org Mon Jun 16 14:22:08 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 16 Jun 2014 14:22:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WwXnT-00046N-26; Mon, 16 Jun 2014 14:22:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXnR-00046A-D4
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:22:06 +0000
Received: from [85.158.143.35:37521] by server-1.bemta-4.messagelabs.com id
	F3/58-09496-C8DFE935; Mon, 16 Jun 2014 14:22:04 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1402928522!11677810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24022 invoked from network); 16 Jun 2014 14:22:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Jun 2014 14:22: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 1WwXnO-0001Ae-Lt
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:22:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1WwXnO-0000tN-Iy
	for xen-changelog@lists.xensource.com; Mon, 16 Jun 2014 14:22:02 +0000
Message-Id: <E1WwXnO-0000tN-Iy@xenbits.xen.org>
Date: Mon, 16 Jun 2014 14:22:02 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] use global sys_reboot()
	declaration
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jan Beulich <jbeulich@suse.com>
# Date 1402927893 -7200
# Node ID 0251893a7d5a99e7574e7fd645cc126b2f641103
# Parent  e2384c98bb97ba12cbe0da3f661ec71dcb7748c3
use global sys_reboot() declaration

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


diff -r e2384c98bb97 -r 0251893a7d5a drivers/xen/core/reboot.c
--- a/drivers/xen/core/reboot.c	Mon Jun 16 16:00:35 2014 +0200
+++ b/drivers/xen/core/reboot.c	Mon Jun 16 16:11:33 2014 +0200
@@ -4,6 +4,7 @@
 #include <linux/unistd.h>
 #include <linux/module.h>
 #include <linux/reboot.h>
+#include <linux/syscalls.h>
 #include <linux/sysrq.h>
 #include <asm/hypervisor.h>
 #include <xen/xenbus.h>
@@ -46,9 +47,6 @@ static int shutdown_process(void *__unus
 				"PATH=/sbin:/usr/sbin:/bin:/usr/bin", NULL };
 	static char *poweroff_argv[] = { "/sbin/poweroff", NULL };
 
-	extern asmlinkage long sys_reboot(int magic1, int magic2,
-					  unsigned int cmd, void *arg);
-
 	if ((shutting_down == SHUTDOWN_POWEROFF) ||
 	    (shutting_down == SHUTDOWN_HALT)) {
 		if (call_usermodehelper("/sbin/poweroff", poweroff_argv,

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

From xen-changelog-bounces@lists.xen.org Wed Jun 18 22:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jun 2014 22:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxO4S-0004yk-RM; Wed, 18 Jun 2014 22:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4R-0004yM-LX
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:07 +0000
Received: from [85.158.137.68:39538] by server-3.bemta-3.messagelabs.com id
	B6/DF-08149-A7E02A35; Wed, 18 Jun 2014 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403129464!10851067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2702 invoked from network); 18 Jun 2014 22:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jun 2014 22:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4N-00009M-Nz
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4N-0004Me-Gm
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:03 +0000
Date: Wed, 18 Jun 2014 22:11:03 +0000
Message-Id: <E1WxO4N-0004Me-Gm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.5-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c8dc2c1d745f438a486dfebbc3b6266c916313d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:06:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:06:54 2014 +0200

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

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

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

From xen-changelog-bounces@lists.xen.org Wed Jun 18 22:11:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jun 2014 22:11:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxO4S-0004yk-RM; Wed, 18 Jun 2014 22:11:08 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4R-0004yM-LX
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:07 +0000
Received: from [85.158.137.68:39538] by server-3.bemta-3.messagelabs.com id
	B6/DF-08149-A7E02A35; Wed, 18 Jun 2014 22:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403129464!10851067!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2702 invoked from network); 18 Jun 2014 22:11:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jun 2014 22:11:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4N-00009M-Nz
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4N-0004Me-Gm
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:03 +0000
Date: Wed, 18 Jun 2014 22:11:03 +0000
Message-Id: <E1WxO4N-0004Me-Gm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] update Xen version to 4.2.5-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c8dc2c1d745f438a486dfebbc3b6266c916313d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:06:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:06:54 2014 +0200

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

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

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

From xen-changelog-bounces@lists.xen.org Wed Jun 18 22:11:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jun 2014 22:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxO4a-00051F-Ty; Wed, 18 Jun 2014 22:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4a-000517-Ba
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:16 +0000
Received: from [85.158.139.211:39270] by server-6.bemta-5.messagelabs.com id
	A0/7D-25531-38E02A35; Wed, 18 Jun 2014 22:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403129474!10756995!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4821 invoked from network); 18 Jun 2014 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jun 2014 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4X-00009P-Uh
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4X-0004N7-SK
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:13 +0000
Date: Wed, 18 Jun 2014 22:11:13 +0000
Message-Id: <E1WxO4X-0004N7-SK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83b88fd9c80d0bd147c77a2708326790a693a5ee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:07:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:07:28 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 5cba5e0..c32bbe1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1254,7 +1254,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1421,6 +1424,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Wed Jun 18 22:11:16 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 18 Jun 2014 22:11:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxO4a-00051F-Ty; Wed, 18 Jun 2014 22:11:16 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4a-000517-Ba
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:16 +0000
Received: from [85.158.139.211:39270] by server-6.bemta-5.messagelabs.com id
	A0/7D-25531-38E02A35; Wed, 18 Jun 2014 22:11:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403129474!10756995!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4821 invoked from network); 18 Jun 2014 22:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	18 Jun 2014 22:11:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4X-00009P-Uh
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxO4X-0004N7-SK
	for xen-changelog@lists.xensource.com; Wed, 18 Jun 2014 22:11:13 +0000
Date: Wed, 18 Jun 2014 22:11:13 +0000
Message-Id: <E1WxO4X-0004N7-SK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 83b88fd9c80d0bd147c77a2708326790a693a5ee
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:07:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:07:28 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 5cba5e0..c32bbe1 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1254,7 +1254,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1421,6 +1424,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU2E-0000MF-8R; Thu, 19 Jun 2014 04:33:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2C-0000M8-5o
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:12 +0000
Received: from [193.109.254.147:26805] by server-5.bemta-14.messagelabs.com id
	82/8B-26413-70862A35; Thu, 19 Jun 2014 04:33:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403152386!12248596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1965 invoked from network); 19 Jun 2014 04:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU26-0002PN-JC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU26-0007KQ-CY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:06 +0000
Date: Thu, 19 Jun 2014 04:33:06 +0000
Message-Id: <E1WxU26-0007KQ-CY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ioreq-server: add support for multiple
	servers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 434ae6517af2388572fa24c6c9904822cc75180b
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon Jun 2 09:40:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 09:58:56 2014 +0200

    ioreq-server: add support for multiple servers
    
    The previous single ioreq server that was created on demand now
    becomes the default server and an API is created to allow secondary
    servers, which handle specific IO ranges or PCI devices, to be added.
    
    When the guest issues an IO the list of secondary servers is checked
    for a matching IO range or PCI device. If none is found then the IO
    is passed to the default server.
    
    Secondary servers use guest pages to communicate with emulators, in
    the same way as the default server. These pages need to be in the
    guest physmap otherwise there is no suitable reference that can be
    queried by an emulator in order to map them. Therefore a pool of
    pages in the current E820 reserved region, just below the special
    pages is used. Secondary servers allocate from and free to this pool
    as they are created and destroyed.
    
    The size of the pool is currently hardcoded in the domain build at a
    value of 8. This should be sufficient for now and both the location and
    size of the pool can be modified in future without any need to change the
    API.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    Fix build errors in xen/xsm/dummy.c and xen/xsm/flask/hooks.c with XSM
    enabled.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_domain.c          |  224 ++++++++++
 tools/libxc/xc_domain_restore.c  |   48 ++
 tools/libxc/xc_domain_save.c     |   24 +
 tools/libxc/xc_hvm_build_x86.c   |   50 ++-
 tools/libxc/xc_private.c         |   16 +-
 tools/libxc/xenctrl.h            |  143 ++++++-
 tools/libxc/xg_save_restore.h    |    3 +
 xen/arch/x86/hvm/hvm.c           |  908 ++++++++++++++++++++++++++++++++++----
 xen/arch/x86/hvm/io.c            |    2 +-
 xen/include/asm-x86/hvm/domain.h |   26 +-
 xen/include/asm-x86/hvm/hvm.h    |    1 +
 xen/include/public/hvm/hvm_op.h  |  120 +++++
 xen/include/public/hvm/ioreq.h   |    9 +-
 xen/include/public/hvm/params.h  |    5 +-
 xen/include/xen/list.h           |    9 +
 xen/include/xsm/dummy.h          |    6 +
 xen/include/xsm/xsm.h            |    6 +
 xen/xsm/dummy.c                  |    1 +
 xen/xsm/flask/hooks.c            |    6 +
 19 files changed, 1498 insertions(+), 109 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 369c3f3..a8c9f81 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1284,6 +1284,230 @@ int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long
     return rc;
 }
 
+int xc_hvm_create_ioreq_server(xc_interface *xch,
+                               domid_t domid,
+                               ioservid_t *id)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_create_ioreq_server_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_create_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    *id = arg->id;
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_get_ioreq_server_info(xc_interface *xch,
+                                 domid_t domid,
+                                 ioservid_t id,
+                                 xen_pfn_t *ioreq_pfn,
+                                 xen_pfn_t *bufioreq_pfn,
+                                 evtchn_port_t *bufioreq_port)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_get_ioreq_server_info_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_get_ioreq_server_info;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+    if ( rc != 0 )
+        goto done;
+
+    if ( ioreq_pfn )
+        *ioreq_pfn = arg->ioreq_pfn;
+
+    if ( bufioreq_pfn )
+        *bufioreq_pfn = arg->bufioreq_pfn;
+
+    if ( bufioreq_port )
+        *bufioreq_port = arg->bufioreq_port;
+
+done:
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_map_io_range_to_ioreq_server(xc_interface *xch, domid_t domid,
+                                        ioservid_t id, int is_mmio,
+                                        uint64_t start, uint64_t end)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_map_io_range_to_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = is_mmio ? HVMOP_IO_RANGE_MEMORY : HVMOP_IO_RANGE_PORT;
+    arg->start = start;
+    arg->end = end;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface *xch, domid_t domid,
+                                            ioservid_t id, int is_mmio,
+                                            uint64_t start, uint64_t end)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_unmap_io_range_from_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = is_mmio ? HVMOP_IO_RANGE_MEMORY : HVMOP_IO_RANGE_PORT;
+    arg->start = start;
+    arg->end = end;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
+                                      ioservid_t id, uint16_t segment,
+                                      uint8_t bus, uint8_t device,
+                                      uint8_t function)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    if (device > 0x1f || function > 0x7) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_map_io_range_to_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = HVMOP_IO_RANGE_PCI;
+
+    /*
+     * The underlying hypercall will deal with ranges of PCI SBDF
+     * but, for simplicity, the API only uses singletons.
+     */
+    arg->start = arg->end = HVMOP_PCI_SBDF((uint64_t)segment,
+                                           (uint64_t)bus,
+                                           (uint64_t)device,
+                                           (uint64_t)function);
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
+                                          ioservid_t id, uint16_t segment,
+                                          uint8_t bus, uint8_t device,
+                                          uint8_t function)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    if (device > 0x1f || function > 0x7) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_unmap_io_range_from_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = HVMOP_IO_RANGE_PCI;
+    arg->start = arg->end = HVMOP_PCI_SBDF((uint64_t)segment,
+                                           (uint64_t)bus,
+                                           (uint64_t)device,
+                                           (uint64_t)function);
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_destroy_ioreq_server(xc_interface *xch,
+                                domid_t domid,
+                                ioservid_t id)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_destroy_ioreq_server_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_destroy_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
 int xc_domain_setdebugging(xc_interface *xch,
                            uint32_t domid,
                            unsigned int enable)
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index bcb0ae0..89af1ad 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -38,6 +38,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include "xg_private.h"
 #include "xg_save_restore.h"
@@ -740,6 +741,8 @@ typedef struct {
     uint64_t acpi_ioport_location;
     uint64_t viridian;
     uint64_t vm_generationid_addr;
+    uint64_t ioreq_server_pfn;
+    uint64_t nr_ioreq_server_pages;
 
     struct toolstack_data_t tdata;
 } pagebuf_t;
@@ -990,6 +993,26 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx,
         DPRINTF("read generation id buffer address");
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_HVM_IOREQ_SERVER_PFN:
+        /* Skip padding 4 bytes then read the ioreq server gmfn base. */
+        if ( RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the ioreq server gmfn base");
+            return -1;
+        }
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
+    case XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES:
+        /* Skip padding 4 bytes then read the ioreq server gmfn count. */
+        if ( RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint64_t)) )
+        {
+            PERROR("error read the ioreq server gmfn count");
+            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);
@@ -1748,6 +1771,31 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     if (pagebuf.viridian != 0)
         xc_set_hvm_param(xch, dom, HVM_PARAM_VIRIDIAN, 1);
 
+    /*
+     * If we are migrating in from a host that does not support
+     * secondary emulators then nr_ioreq_server_pages will be 0, since
+     * there will be no XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk in
+     * the image.
+     * If we are migrating from a host that does support secondary
+     * emulators then the XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk
+     * will exist and is guaranteed to have a non-zero value. The
+     * existence of that chunk also implies the existence of the
+     * XC_SAVE_ID_HVM_IOREQ_SERVER_PFN chunk, which is also guaranteed
+     * to have a non-zero value.
+     */
+    if (!pagebuf.nr_ioreq_server_pages ^ !pagebuf.ioreq_server_pfn) {
+        ERROR("Inconsistent IOREQ Server settings (nr=%"PRIx64", pfn=%"PRIx64")",
+              pagebuf.nr_ioreq_server_pages, pagebuf.ioreq_server_pfn);
+    } else {
+        if (pagebuf.nr_ioreq_server_pages != 0 &&
+            pagebuf.ioreq_server_pfn != 0) {
+            xc_set_hvm_param(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES, 
+                             pagebuf.nr_ioreq_server_pages);
+            xc_set_hvm_param(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
+                             pagebuf.ioreq_server_pfn);
+        }
+    }
+
     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 --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 71f9b59..acf3685 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1737,6 +1737,30 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             PERROR("Error when writing the viridian flag");
             goto out;
         }
+
+        chunk.id = XC_SAVE_ID_HVM_IOREQ_SERVER_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the ioreq server gmfn base");
+            goto out;
+        }
+
+        chunk.id = XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the ioreq server gmfn count");
+            goto out;
+        }
     }
 
     if ( callbacks != NULL && callbacks->toolstack_save != NULL )
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 43103b9..ed1069b 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -49,6 +49,9 @@
 #define NR_SPECIAL_PAGES     8
 #define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
 
+#define NR_IOREQ_SERVER_PAGES 8
+#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
+
 #define VGA_HOLE_SIZE (0x20)
 
 static int modules_init(struct xc_hvm_build_args *args,
@@ -114,7 +117,7 @@ static void build_hvm_info(void *hvm_info_page, uint64_t mem_size,
     /* Memory parameters. */
     hvm_info->low_mem_pgend = lowmem_end >> PAGE_SHIFT;
     hvm_info->high_mem_pgend = highmem_end >> PAGE_SHIFT;
-    hvm_info->reserved_mem_pgstart = special_pfn(0);
+    hvm_info->reserved_mem_pgstart = ioreq_server_pfn(0);
 
     /* Finish with the checksum. */
     for ( i = 0, sum = 0; i < hvm_info->length; i++ )
@@ -257,6 +260,8 @@ static int setup_guest(xc_interface *xch,
         stat_1gb_pages = 0;
     int pod_mode = 0;
     int claim_enabled = args->claim_enabled;
+    xen_pfn_t special_array[NR_SPECIAL_PAGES];
+    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
 
     if ( nr_pages > target_pages )
         pod_mode = XENMEMF_populate_on_demand;
@@ -469,18 +474,19 @@ static int setup_guest(xc_interface *xch,
 
     /* Allocate and clear special pages. */
     for ( i = 0; i < NR_SPECIAL_PAGES; i++ )
+        special_array[i] = special_pfn(i);
+
+    rc = xc_domain_populate_physmap_exact(xch, dom, NR_SPECIAL_PAGES, 0, 0,
+                                          special_array);
+    if ( rc != 0 )
     {
-        xen_pfn_t pfn = special_pfn(i);
-        rc = xc_domain_populate_physmap_exact(xch, dom, 1, 0, 0, &pfn);
-        if ( rc != 0 )
-        {
-            PERROR("Could not allocate %d'th special page.", i);
-            goto error_out;
-        }
-        if ( xc_clear_domain_page(xch, dom, special_pfn(i)) )
-            goto error_out;
+        PERROR("Could not allocate special pages.");
+        goto error_out;
     }
 
+    if ( xc_clear_domain_pages(xch, dom, special_pfn(0), NR_SPECIAL_PAGES) )
+            goto error_out;
+
     xc_set_hvm_param(xch, dom, HVM_PARAM_STORE_PFN,
                      special_pfn(SPECIALPAGE_XENSTORE));
     xc_set_hvm_param(xch, dom, HVM_PARAM_BUFIOREQ_PFN,
@@ -497,6 +503,30 @@ static int setup_guest(xc_interface *xch,
                      special_pfn(SPECIALPAGE_SHARING));
 
     /*
+     * Allocate and clear additional ioreq server pages. The default
+     * server will use the IOREQ and BUFIOREQ special pages above.
+     */
+    for ( i = 0; i < NR_IOREQ_SERVER_PAGES; i++ )
+        ioreq_server_array[i] = ioreq_server_pfn(i);
+
+    rc = xc_domain_populate_physmap_exact(xch, dom, NR_IOREQ_SERVER_PAGES, 0, 0,
+                                          ioreq_server_array);
+    if ( rc != 0 )
+    {
+        PERROR("Could not allocate ioreq server pages.");
+        goto error_out;
+    }
+
+    if ( xc_clear_domain_pages(xch, dom, ioreq_server_pfn(0), NR_IOREQ_SERVER_PAGES) )
+            goto error_out;
+
+    /* Tell the domain where the pages are and how many there are */
+    xc_set_hvm_param(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
+                     ioreq_server_pfn(0));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+                     NR_IOREQ_SERVER_PAGES);
+
+    /*
      * Identity-map page table is required for running with CR0.PG=0 when
      * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
      */
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 10e7e20..a3da614 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -628,17 +628,19 @@ int xc_copy_to_domain_page(xc_interface *xch,
     return 0;
 }
 
-int xc_clear_domain_page(xc_interface *xch,
-                         uint32_t domid,
-                         unsigned long dst_pfn)
+int xc_clear_domain_pages(xc_interface *xch,
+                          uint32_t domid,
+                          unsigned long dst_pfn,
+                          int num)
 {
+    size_t size = num * PAGE_SIZE;
     void *vaddr = xc_map_foreign_range(
-        xch, domid, PAGE_SIZE, PROT_WRITE, dst_pfn);
+        xch, domid, size, PROT_WRITE, dst_pfn);
     if ( vaddr == NULL )
         return -1;
-    memset(vaddr, 0, PAGE_SIZE);
-    munmap(vaddr, PAGE_SIZE);
-    xc_domain_cacheflush(xch, domid, dst_pfn, 1);
+    memset(vaddr, 0, size);
+    munmap(vaddr, size);
+    xc_domain_cacheflush(xch, domid, dst_pfn, num);
     return 0;
 }
 
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 02129f7..3260a56 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1393,8 +1393,14 @@ int xc_get_pfn_list(xc_interface *xch, uint32_t domid, uint64_t *pfn_buf,
 int xc_copy_to_domain_page(xc_interface *xch, uint32_t domid,
                            unsigned long dst_pfn, const char *src_page);
 
-int xc_clear_domain_page(xc_interface *xch, uint32_t domid,
-                         unsigned long dst_pfn);
+int xc_clear_domain_pages(xc_interface *xch, uint32_t domid,
+                          unsigned long dst_pfn, int num);
+
+static inline int xc_clear_domain_page(xc_interface *xch, uint32_t domid,
+                                       unsigned long dst_pfn)
+{
+    return xc_clear_domain_pages(xch, domid, dst_pfn, 1);
+}
 
 int xc_mmuext_op(xc_interface *xch, struct mmuext_op *op, unsigned int nr_ops,
                  domid_t dom);
@@ -1787,6 +1793,129 @@ void xc_clear_last_error(xc_interface *xch);
 int xc_set_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long value);
 int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long *value);
 
+/*
+ * IOREQ Server API. (See section on IOREQ Servers in public/hvm_op.h).
+ */
+
+/**
+ * This function instantiates an IOREQ Server.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id pointer to an ioservid_t to receive the IOREQ Server id.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_create_ioreq_server(xc_interface *xch,
+                               domid_t domid,
+                               ioservid_t *id);
+
+/**
+ * This function retrieves the necessary information to allow an
+ * emulator to use an IOREQ Server.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm ioreq_pfn pointer to a xen_pfn_t to receive the synchronous ioreq gmfn
+ * @parm bufioreq_pfn pointer to a xen_pfn_t to receive the buffered ioreq gmfn
+ * @parm bufioreq_port pointer to a evtchn_port_t to receive the buffered ioreq event channel
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_get_ioreq_server_info(xc_interface *xch,
+                                 domid_t domid,
+                                 ioservid_t id,
+                                 xen_pfn_t *ioreq_pfn,
+                                 xen_pfn_t *bufioreq_pfn,
+                                 evtchn_port_t *bufioreq_port);
+
+/**
+ * This function registers a range of memory or I/O ports for emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm is_mmio is this a range of ports or memory
+ * @parm start start of range
+ * @parm end end of range (inclusive).
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_map_io_range_to_ioreq_server(xc_interface *xch,
+                                        domid_t domid,
+                                        ioservid_t id,
+                                        int is_mmio,
+                                        uint64_t start,
+                                        uint64_t end);
+
+/**
+ * This function deregisters a range of memory or I/O ports for emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm is_mmio is this a range of ports or memory
+ * @parm start start of range
+ * @parm end end of range (inclusive).
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface *xch,
+                                            domid_t domid,
+                                            ioservid_t id,
+                                            int is_mmio,
+                                            uint64_t start,
+                                            uint64_t end);
+
+/**
+ * This function registers a PCI device for config space emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm segment the PCI segment of the device
+ * @parm bus the PCI bus of the device
+ * @parm device the 'slot' number of the device
+ * @parm function the function number of the device
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch,
+                                      domid_t domid,
+                                      ioservid_t id,
+                                      uint16_t segment,
+                                      uint8_t bus,
+                                      uint8_t device,
+                                      uint8_t function);
+
+/**
+ * This function deregisters a PCI device for config space emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm segment the PCI segment of the device
+ * @parm bus the PCI bus of the device
+ * @parm device the 'slot' number of the device
+ * @parm function the function number of the device
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch,
+                                          domid_t domid,
+                                          ioservid_t id,
+                                          uint16_t segment,
+                                          uint8_t bus,
+                                          uint8_t device,
+                                          uint8_t function);
+
+/**
+ * This function destroys an IOREQ Server.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_destroy_ioreq_server(xc_interface *xch,
+                                domid_t domid,
+                                ioservid_t id);
+
 /* HVM guest pass-through */
 int xc_assign_device(xc_interface *xch,
                      uint32_t domid,
@@ -2425,3 +2554,13 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
 int xc_kexec_unload(xc_interface *xch, int type);
 
 #endif /* XENCTRL_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h
index f859621..69ea64e 100644
--- a/tools/libxc/xg_save_restore.h
+++ b/tools/libxc/xg_save_restore.h
@@ -259,6 +259,9 @@
 #define XC_SAVE_ID_HVM_ACCESS_RING_PFN  -16
 #define XC_SAVE_ID_HVM_SHARING_RING_PFN -17
 #define XC_SAVE_ID_TOOLSTACK          -18 /* Optional toolstack specific info */
+/* These are a pair; it is an error for one to exist without the other */
+#define XC_SAVE_ID_HVM_IOREQ_SERVER_PFN -19
+#define XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES -20
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index efbf6d9..6020ea8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -66,6 +66,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
+#include <xen/rangeset.h>
 
 bool_t __read_mostly hvm_enabled;
 
@@ -375,27 +376,35 @@ static ioreq_t *get_ioreq(struct hvm_ioreq_server *s, struct vcpu *v)
 
 bool_t hvm_io_pending(struct vcpu *v)
 {
-    struct hvm_ioreq_server *s = v->domain->arch.hvm_domain.ioreq_server;
-    ioreq_t *p;
+    struct domain *d = v->domain;
+    struct hvm_ioreq_server *s;
 
-    if ( !s )
-        return 0;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        ioreq_t *p = get_ioreq(s, v);
 
-    p = get_ioreq(s, v);
-    return p->state != STATE_IOREQ_NONE;
+        if ( p->state != STATE_IOREQ_NONE )
+            return 1;
+    }
+
+    return 0;
 }
 
 void hvm_do_resume(struct vcpu *v)
 {
     struct domain *d = v->domain;
-    struct hvm_ioreq_server *s = d->arch.hvm_domain.ioreq_server;
+    struct hvm_ioreq_server *s;
 
     check_wakeup_from_wait();
 
     if ( is_hvm_vcpu(v) )
         pt_restore_timer(v);
 
-    if ( s )
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
     {
         ioreq_t *p = get_ioreq(s, v);
 
@@ -430,6 +439,32 @@ void hvm_do_resume(struct vcpu *v)
     }
 }
 
+static int hvm_alloc_ioreq_gmfn(struct domain *d, unsigned long *gmfn)
+{
+    unsigned int i;
+    int rc;
+
+    rc = -ENOMEM;
+    for ( i = 0; i < sizeof(d->arch.hvm_domain.ioreq_gmfn.mask) * 8; i++ )
+    {
+        if ( test_and_clear_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask) )
+        {
+            *gmfn = d->arch.hvm_domain.ioreq_gmfn.base + i;
+            rc = 0;
+            break;
+        }
+    }
+
+    return rc;
+}
+
+static void hvm_free_ioreq_gmfn(struct domain *d, unsigned long gmfn)
+{
+    unsigned int i = gmfn - d->arch.hvm_domain.ioreq_gmfn.base;
+
+    clear_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask);
+}
+
 void destroy_ring_for_helper(
     void **_va, struct page_info *page)
 {
@@ -514,6 +549,7 @@ static int hvm_map_ioreq_page(
 
     iorp->va = va;
     iorp->page = page;
+    iorp->gmfn = gmfn;
 
     return 0;
 }
@@ -544,6 +580,18 @@ static int hvm_print_line(
     return X86EMUL_OKAY;
 }
 
+static int hvm_access_cf8(
+    int dir, uint32_t port, uint32_t bytes, uint32_t *val)
+{
+    struct domain *d = current->domain;
+
+    if ( dir == IOREQ_WRITE && bytes == 4 )
+        d->arch.hvm_domain.pci_cf8 = *val;
+
+    /* We always need to fall through to the catch all emulator */
+    return X86EMUL_UNHANDLEABLE;
+}
+
 static int handle_pvh_io(
     int dir, uint32_t port, uint32_t bytes, uint32_t *val)
 {
@@ -572,7 +620,7 @@ static void hvm_update_ioreq_evtchn(struct hvm_ioreq_server *s,
 }
 
 static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
-                                     struct vcpu *v)
+                                     bool_t is_default, struct vcpu *v)
 {
     struct hvm_ioreq_vcpu *sv;
     int rc;
@@ -600,8 +648,9 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
             goto fail3;
 
         s->bufioreq_evtchn = rc;
-        d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN] =
-            s->bufioreq_evtchn;
+        if ( is_default )
+            d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN] =
+                s->bufioreq_evtchn;
     }
 
     sv->vcpu = v;
@@ -678,41 +727,132 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
     spin_unlock(&s->lock);
 }
 
-static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s)
+static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
+                                      bool_t is_default)
 {
     struct domain *d = s->domain;
-    unsigned long pfn;
+    unsigned long ioreq_pfn, bufioreq_pfn;
     int rc;
 
-    pfn = d->arch.hvm_domain.params[HVM_PARAM_IOREQ_PFN];
-    rc = hvm_map_ioreq_page(s, 0, pfn);
+    if ( is_default )
+    {
+        ioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_IOREQ_PFN];
+        bufioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_PFN];
+    }
+    else
+    {
+        rc = hvm_alloc_ioreq_gmfn(d, &ioreq_pfn);
+        if ( rc )
+            goto fail1;
+
+        rc = hvm_alloc_ioreq_gmfn(d, &bufioreq_pfn);
+        if ( rc )
+            goto fail2;
+    }
+
+    rc = hvm_map_ioreq_page(s, 0, ioreq_pfn);
     if ( rc )
-        return rc;
+        goto fail3;
 
-    pfn = d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_PFN];
-    rc = hvm_map_ioreq_page(s, 1, pfn);
+    rc = hvm_map_ioreq_page(s, 1, bufioreq_pfn);
     if ( rc )
-        goto fail;
+        goto fail4;
 
     return 0;
 
-fail:
+fail4:
     hvm_unmap_ioreq_page(s, 0);
+
+fail3:
+    if ( !is_default )
+        hvm_free_ioreq_gmfn(d, bufioreq_pfn);
+
+fail2:
+    if ( !is_default )
+        hvm_free_ioreq_gmfn(d, ioreq_pfn);
+
+fail1:
     return rc;
 }
 
-static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s)
+static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s, 
+                                         bool_t is_default)
 {
+    struct domain *d = s->domain;
+
     hvm_unmap_ioreq_page(s, 1);
     hvm_unmap_ioreq_page(s, 0);
+
+    if ( !is_default )
+    {
+        hvm_free_ioreq_gmfn(d, s->bufioreq.gmfn);
+        hvm_free_ioreq_gmfn(d, s->ioreq.gmfn);
+    }
+}
+
+static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s, 
+                                            bool_t is_default)
+{
+    unsigned int i;
+    int rc;
+
+    if ( is_default )
+        goto done;
+
+    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
+    {
+        char *name;
+
+        rc = asprintf(&name, "ioreq_server %d %s", s->id,
+                      (i == HVMOP_IO_RANGE_PORT) ? "port" :
+                      (i == HVMOP_IO_RANGE_MEMORY) ? "memory" :
+                      (i == HVMOP_IO_RANGE_PCI) ? "pci" :
+                      "");
+        if ( rc )
+            goto fail;
+
+        s->range[i] = rangeset_new(s->domain, name,
+                                   RANGESETF_prettyprint_hex);
+
+        xfree(name);
+
+        rc = -ENOMEM;
+        if ( !s->range[i] )
+            goto fail;
+
+        rangeset_limit(s->range[i], MAX_NR_IO_RANGES);
+    }
+
+ done:
+    return 0;
+
+ fail:
+    while ( --i >= 0 )
+        rangeset_destroy(s->range[i]);
+
+    return rc;
+}
+
+static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s, 
+                                            bool_t is_default)
+{
+    unsigned int i;
+
+    if ( is_default )
+        return;
+
+    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
+        rangeset_destroy(s->range[i]);
 }
 
 static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
-                                 domid_t domid)
+                                 domid_t domid, bool_t is_default,
+                                 ioservid_t id)
 {
     struct vcpu *v;
     int rc;
 
+    s->id = id;
     s->domain = d;
     s->domid = domid;
 
@@ -720,33 +860,71 @@ static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
     INIT_LIST_HEAD(&s->ioreq_vcpu_list);
     spin_lock_init(&s->bufioreq_lock);
 
-    rc = hvm_ioreq_server_map_pages(s);
+    rc = hvm_ioreq_server_alloc_rangesets(s, is_default);
     if ( rc )
-        return rc;
+        goto fail1;
+
+    rc = hvm_ioreq_server_map_pages(s, is_default);
+    if ( rc )
+        goto fail2;
 
     for_each_vcpu ( d, v )
     {
-        rc = hvm_ioreq_server_add_vcpu(s, v);
+        rc = hvm_ioreq_server_add_vcpu(s, is_default, v);
         if ( rc )
-            goto fail;
+            goto fail3;
     }
 
     return 0;
 
- fail:
+ fail3:
     hvm_ioreq_server_remove_all_vcpus(s);
-    hvm_ioreq_server_unmap_pages(s);
+    hvm_ioreq_server_unmap_pages(s, is_default);
+
+ fail2:
+    hvm_ioreq_server_free_rangesets(s, is_default);
 
+ fail1:
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     return rc;
 }
 
-static void hvm_ioreq_server_deinit(struct hvm_ioreq_server *s)
+static void hvm_ioreq_server_deinit(struct hvm_ioreq_server *s,
+                                    bool_t is_default)
 {
     hvm_ioreq_server_remove_all_vcpus(s);
-    hvm_ioreq_server_unmap_pages(s);
+    hvm_ioreq_server_unmap_pages(s, is_default);
+    hvm_ioreq_server_free_rangesets(s, is_default);
 }
 
-static int hvm_create_ioreq_server(struct domain *d, domid_t domid)
+static ioservid_t next_ioservid(struct domain *d)
+{
+    struct hvm_ioreq_server *s;
+    ioservid_t id;
+    
+    ASSERT(spin_is_locked(&d->arch.hvm_domain.ioreq_server.lock));
+
+    id = d->arch.hvm_domain.ioreq_server.id;
+
+ again:
+    id++;
+
+    /* Check for uniqueness */
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( id == s->id )
+            goto again;
+    }
+
+    d->arch.hvm_domain.ioreq_server.id = id;
+
+    return id;
+}
+
+static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
+                                   bool_t is_default, ioservid_t *id)
 {
     struct hvm_ioreq_server *s;
     int rc;
@@ -757,25 +935,34 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid)
         goto fail1;
 
     domain_pause(d);
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
 
     rc = -EEXIST;
-    if ( d->arch.hvm_domain.ioreq_server != NULL )
+    if ( is_default && d->arch.hvm_domain.default_ioreq_server != NULL )
         goto fail2;
 
-    rc = hvm_ioreq_server_init(s, d, domid);
+    rc = hvm_ioreq_server_init(s, d, domid, is_default,
+                               next_ioservid(d));
     if ( rc )
-        goto fail2;
+        goto fail3;
 
-    d->arch.hvm_domain.ioreq_server = s;
+    list_add(&s->list_entry,
+             &d->arch.hvm_domain.ioreq_server.list);
 
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    if ( is_default )
+        d->arch.hvm_domain.default_ioreq_server = s;
+
+    if ( id )
+        *id = s->id;
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     domain_unpause(d);
 
     return 0;
 
+ fail3:
  fail2:
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     domain_unpause(d);
 
     xfree(s);
@@ -783,24 +970,252 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid)
     return rc;
 }
 
-static void hvm_destroy_ioreq_server(struct domain *d)
+static int hvm_destroy_ioreq_server(struct domain *d, ioservid_t id)
 {
     struct hvm_ioreq_server *s;
+    int rc;
 
-    domain_pause(d);
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id != id )
+            continue;
+
+        domain_pause(d);
+
+        list_del(&s->list_entry);
+        
+        hvm_ioreq_server_deinit(s, 0);
+
+        domain_unpause(d);
+
+        xfree(s);
+
+        rc = 0;
+        break;
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static int hvm_get_ioreq_server_info(struct domain *d, ioservid_t id,
+                                     unsigned long *ioreq_pfn,
+                                     unsigned long *bufioreq_pfn,
+                                     evtchn_port_t *bufioreq_port)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
 
-    s = d->arch.hvm_domain.ioreq_server;
-    if ( s )
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
     {
-        d->arch.hvm_domain.ioreq_server = NULL;
-        hvm_ioreq_server_deinit(s);
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id != id )
+            continue;
+
+        *ioreq_pfn = s->ioreq.gmfn;
+        *bufioreq_pfn = s->bufioreq.gmfn;
+        *bufioreq_port = s->bufioreq_evtchn;
+
+        rc = 0;
+        break;
     }
 
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
-    domain_unpause(d);
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
 
-    xfree(s);
+    return rc;
+}
+
+static int hvm_map_io_range_to_ioreq_server(struct domain *d, ioservid_t id,
+                                            uint32_t type, uint64_t start, uint64_t end)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id == id )
+        {
+            struct rangeset *r;
+
+            switch ( type )
+            {
+            case HVMOP_IO_RANGE_PORT:
+            case HVMOP_IO_RANGE_MEMORY:
+            case HVMOP_IO_RANGE_PCI:
+                r = s->range[type];
+                break;
+
+            default:
+                r = NULL;
+                break;
+            }
+
+            rc = -EINVAL;
+            if ( !r )
+                break;
+
+            rc = -EEXIST;
+            if ( rangeset_overlaps_range(r, start, end) )
+                break;
+
+            rc = rangeset_add_range(r, start, end);
+            break;
+        }
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static int hvm_unmap_io_range_from_ioreq_server(struct domain *d, ioservid_t id,
+                                                uint32_t type, uint64_t start, uint64_t end)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id == id )
+        {
+            struct rangeset *r;
+
+            switch ( type )
+            {
+            case HVMOP_IO_RANGE_PORT:
+            case HVMOP_IO_RANGE_MEMORY:
+            case HVMOP_IO_RANGE_PCI:
+                r = s->range[type];
+                break;
+
+            default:
+                r = NULL;
+                break;
+            }
+
+            rc = -EINVAL;
+            if ( !r )
+                break;
+
+            rc = -ENOENT;
+            if ( !rangeset_contains_range(r, start, end) )
+                break;
+
+            rc = rangeset_remove_range(r, start, end);
+            break;
+        }
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static int hvm_all_ioreq_servers_add_vcpu(struct domain *d, struct vcpu *v)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
+
+        rc = hvm_ioreq_server_add_vcpu(s, is_default, v);
+        if ( rc )
+            goto fail;
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return 0;
+
+ fail:
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+        hvm_ioreq_server_remove_vcpu(s, v);
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static void hvm_all_ioreq_servers_remove_vcpu(struct domain *d, struct vcpu *v)
+{
+    struct hvm_ioreq_server *s;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+        hvm_ioreq_server_remove_vcpu(s, v);
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+}
+
+static void hvm_destroy_all_ioreq_servers(struct domain *d)
+{
+    struct hvm_ioreq_server *s, *next;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    /* No need to domain_pause() as the domain is being torn down */
+
+    list_for_each_entry_safe ( s,
+                               next,
+                               &d->arch.hvm_domain.ioreq_server.list,
+                               list_entry )
+    {
+        bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
+
+        if ( is_default )
+            d->arch.hvm_domain.default_ioreq_server = NULL;
+
+        list_del(&s->list_entry);
+        
+        hvm_ioreq_server_deinit(s, is_default);
+
+        xfree(s);
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
 }
 
 static int hvm_replace_event_channel(struct vcpu *v, domid_t remote_domid,
@@ -823,21 +1238,22 @@ static int hvm_set_dm_domain(struct domain *d, domid_t domid)
     struct hvm_ioreq_server *s;
     int rc = 0;
 
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
 
     /*
      * Lack of ioreq server is not a failure. HVM_PARAM_DM_DOMAIN will
      * still be set and thus, when the server is created, it will have
      * the correct domid.
      */
-    s = d->arch.hvm_domain.ioreq_server;
+    s = d->arch.hvm_domain.default_ioreq_server;
     if ( !s )
         goto done;
 
     domain_pause(d);
     spin_lock(&s->lock);
 
-    if ( s->domid != domid ) {
+    if ( s->domid != domid ) 
+    {
         struct hvm_ioreq_vcpu *sv;
 
         list_for_each_entry ( sv,
@@ -871,7 +1287,7 @@ static int hvm_set_dm_domain(struct domain *d, domid_t domid)
     domain_unpause(d);
 
  done:
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     return rc;
 }
 
@@ -902,7 +1318,8 @@ int hvm_domain_initialise(struct domain *d)
 
     }
 
-    spin_lock_init(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock_init(&d->arch.hvm_domain.ioreq_server.lock);
+    INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
 
@@ -944,6 +1361,7 @@ int hvm_domain_initialise(struct domain *d)
     rtc_init(d);
 
     register_portio_handler(d, 0xe9, 1, hvm_print_line);
+    register_portio_handler(d, 0xcf8, 4, hvm_access_cf8);
 
     rc = hvm_funcs.domain_initialise(d);
     if ( rc != 0 )
@@ -974,7 +1392,7 @@ void hvm_domain_relinquish_resources(struct domain *d)
     if ( hvm_funcs.nhvm_domain_relinquish_resources )
         hvm_funcs.nhvm_domain_relinquish_resources(d);
 
-    hvm_destroy_ioreq_server(d);
+    hvm_destroy_all_ioreq_servers(d);
 
     msixtbl_pt_cleanup(d);
 
@@ -1607,7 +2025,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
     struct domain *d = v->domain;
-    struct hvm_ioreq_server *s;
 
     hvm_asid_flush_vcpu(v);
 
@@ -1650,14 +2067,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
          && (rc = nestedhvm_vcpu_initialise(v)) < 0 ) /* teardown: nestedhvm_vcpu_destroy */
         goto fail5;
 
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
-
-    s = d->arch.hvm_domain.ioreq_server;
-    if ( s )
-        rc = hvm_ioreq_server_add_vcpu(s, v);
-
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
-
+    rc = hvm_all_ioreq_servers_add_vcpu(d, v);
     if ( rc != 0 )
         goto fail6;
 
@@ -1694,15 +2104,8 @@ int hvm_vcpu_initialise(struct vcpu *v)
 void hvm_vcpu_destroy(struct vcpu *v)
 {
     struct domain *d = v->domain;
-    struct hvm_ioreq_server *s;
-
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
-
-    s = d->arch.hvm_domain.ioreq_server;
-    if ( s )
-        hvm_ioreq_server_remove_vcpu(s, v);
 
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    hvm_all_ioreq_servers_remove_vcpu(d, v);
 
     nestedhvm_vcpu_destroy(v);
 
@@ -1741,11 +2144,107 @@ void hvm_vcpu_down(struct vcpu *v)
     }
 }
 
+static struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
+                                                        ioreq_t *p)
+{
+#define CF8_BDF(cf8)     (((cf8) & 0x00ffff00) >> 8)
+#define CF8_ADDR_LO(cf8) ((cf8) & 0x000000fc)
+#define CF8_ADDR_HI(cf8) (((cf8) & 0x0f000000) >> 16)
+#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
+
+    struct hvm_ioreq_server *s;
+    uint32_t cf8;
+    uint8_t type;
+    uint64_t addr;
+
+    if ( list_empty(&d->arch.hvm_domain.ioreq_server.list) )
+        return NULL;
+
+    if ( list_is_singular(&d->arch.hvm_domain.ioreq_server.list) ||
+         (p->type != IOREQ_TYPE_COPY && p->type != IOREQ_TYPE_PIO) )
+        return d->arch.hvm_domain.default_ioreq_server;
+
+    cf8 = d->arch.hvm_domain.pci_cf8;
+
+    if ( p->type == IOREQ_TYPE_PIO &&
+         (p->addr & ~3) == 0xcfc &&
+         CF8_ENABLED(cf8) )
+    {
+        uint32_t sbdf;
+
+        /* PCI config data cycle */
+
+        sbdf = HVMOP_PCI_SBDF(0,
+                              PCI_BUS(CF8_BDF(cf8)),
+                              PCI_SLOT(CF8_BDF(cf8)),
+                              PCI_FUNC(CF8_BDF(cf8)));
+
+        type = IOREQ_TYPE_PCI_CONFIG;
+        addr = ((uint64_t)sbdf << 32) |
+               CF8_ADDR_HI(cf8) |
+               CF8_ADDR_LO(cf8) |
+               (p->addr & 3);
+    }
+    else
+    {
+        type = p->type;
+        addr = p->addr;
+    }
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        struct rangeset *r;
+
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        BUILD_BUG_ON(IOREQ_TYPE_PIO != HVMOP_IO_RANGE_PORT);
+        BUILD_BUG_ON(IOREQ_TYPE_COPY != HVMOP_IO_RANGE_MEMORY);
+        BUILD_BUG_ON(IOREQ_TYPE_PCI_CONFIG != HVMOP_IO_RANGE_PCI);
+        r = s->range[type];
+
+        switch ( type )
+        {
+            unsigned long end;
+
+        case IOREQ_TYPE_PIO:
+            end = addr + p->size - 1;
+            if ( rangeset_contains_range(r, addr, end) )
+                return s;
+
+            break;
+        case IOREQ_TYPE_COPY:
+            end = addr + (p->size * p->count) - 1;
+            if ( rangeset_contains_range(r, addr, end) )
+                return s;
+
+            break;
+        case IOREQ_TYPE_PCI_CONFIG:
+            if ( rangeset_contains_singleton(r, addr >> 32) )
+            {
+                p->type = type;
+                p->addr = addr;
+                return s;
+            }
+
+            break;
+        }
+    }
+
+    return d->arch.hvm_domain.default_ioreq_server;
+
+#undef CF8_ADDR_ENABLED
+#undef CF8_ADDR_HI
+#undef CF8_ADDR_LO
+#undef CF8_BDF
+}
+
 int hvm_buffered_io_send(ioreq_t *p)
 {
-    struct vcpu *v = current;
-    struct domain *d = v->domain;
-    struct hvm_ioreq_server *s = d->arch.hvm_domain.ioreq_server;
+    struct domain *d = current->domain;
+    struct hvm_ioreq_server *s = hvm_select_ioreq_server(d, p);
     struct hvm_ioreq_page *iorp;
     buffered_iopage_t *pg;
     buf_ioreq_t bp = { .data = p->data,
@@ -1825,23 +2324,20 @@ int hvm_buffered_io_send(ioreq_t *p)
 
 bool_t hvm_has_dm(struct domain *d)
 {
-    return !!d->arch.hvm_domain.ioreq_server;
+    return !list_empty(&d->arch.hvm_domain.ioreq_server.list);
 }
 
-bool_t hvm_send_assist_req(ioreq_t *proto_p)
+bool_t hvm_send_assist_req_to_ioreq_server(struct hvm_ioreq_server *s,
+                                           ioreq_t *proto_p)
 {
-    struct vcpu *v = current;
-    struct domain *d = v->domain;
-    struct hvm_ioreq_server *s = d->arch.hvm_domain.ioreq_server;
+    struct vcpu *curr = current;
+    struct domain *d = curr->domain;
     ioreq_t *p;
 
-    if ( unlikely(!vcpu_start_shutdown_deferral(v)) )
+    if ( unlikely(!vcpu_start_shutdown_deferral(curr)) )
         return 0; /* implicitly bins the i/o operation */
 
-    if ( !s )
-        return 0;
-
-    p = get_ioreq(s, v);
+    p = get_ioreq(s, curr);
 
     if ( unlikely(p->state != STATE_IOREQ_NONE) )
     {
@@ -1867,6 +2363,29 @@ bool_t hvm_send_assist_req(ioreq_t *proto_p)
     return 1;
 }
 
+bool_t hvm_send_assist_req(ioreq_t *p)
+{
+    struct hvm_ioreq_server *s = hvm_select_ioreq_server(current->domain, p);
+
+    if ( !s )
+        return 0;
+
+    return hvm_send_assist_req_to_ioreq_server(s, p);
+}
+
+void hvm_broadcast_assist_req(ioreq_t *p)
+{
+    struct domain *d = current->domain;
+    struct hvm_ioreq_server *s;
+
+    ASSERT(p->type == IOREQ_TYPE_INVALIDATE);
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+        (void) hvm_send_assist_req_to_ioreq_server(s, p);
+}
+
 void hvm_hlt(unsigned long rflags)
 {
     struct vcpu *curr = current;
@@ -4480,6 +4999,165 @@ static int hvmop_flush_tlb_all(void)
     return 0;
 }
 
+static int hvmop_create_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_create_ioreq_server_t) uop)
+{
+    struct domain *curr_d = current->domain;
+    xen_hvm_create_ioreq_server_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_create_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_create_ioreq_server(d, curr_d->domain_id, 0, &op.id);
+    if ( rc != 0 )
+        goto out;
+
+    rc = copy_to_guest(uop, &op, 1) ? -EFAULT : 0;
+    
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_get_ioreq_server_info(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_get_ioreq_server_info_t) uop)
+{
+    xen_hvm_get_ioreq_server_info_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_get_ioreq_server_info);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_get_ioreq_server_info(d, op.id,
+                                   &op.ioreq_pfn,
+                                   &op.bufioreq_pfn, 
+                                   &op.bufioreq_port);
+    if ( rc != 0 )
+        goto out;
+
+    rc = copy_to_guest(uop, &op, 1) ? -EFAULT : 0;
+    
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_map_io_range_to_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_io_range_t) uop)
+{
+    xen_hvm_io_range_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_map_io_range_to_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_map_io_range_to_ioreq_server(d, op.id, op.type,
+                                          op.start, op.end);
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_unmap_io_range_from_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_io_range_t) uop)
+{
+    xen_hvm_io_range_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_unmap_io_range_from_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_unmap_io_range_from_ioreq_server(d, op.id, op.type,
+                                              op.start, op.end);
+    
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_destroy_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_destroy_ioreq_server_t) uop)
+{
+    xen_hvm_destroy_ioreq_server_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_destroy_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_destroy_ioreq_server(d, op.id);
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
 #define HVMOP_op_mask 0xff
 
 long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -4491,6 +5169,31 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( op &= HVMOP_op_mask )
     {
+    case HVMOP_create_ioreq_server:
+        rc = hvmop_create_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_create_ioreq_server_t));
+        break;
+    
+    case HVMOP_get_ioreq_server_info:
+        rc = hvmop_get_ioreq_server_info(
+            guest_handle_cast(arg, xen_hvm_get_ioreq_server_info_t));
+        break;
+    
+    case HVMOP_map_io_range_to_ioreq_server:
+        rc = hvmop_map_io_range_to_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_io_range_t));
+        break;
+    
+    case HVMOP_unmap_io_range_from_ioreq_server:
+        rc = hvmop_unmap_io_range_from_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_io_range_t));
+        break;
+    
+    case HVMOP_destroy_ioreq_server:
+        rc = hvmop_destroy_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_destroy_ioreq_server_t));
+        break;
+    
     case HVMOP_set_param:
     case HVMOP_get_param:
     {
@@ -4644,6 +5347,34 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 if ( a.value > SHUTDOWN_MAX )
                     rc = -EINVAL;
                 break;
+            case HVM_PARAM_IOREQ_SERVER_PFN:
+                if ( d == current->domain )
+                {
+                    rc = -EPERM;
+                    break;
+                }
+                d->arch.hvm_domain.ioreq_gmfn.base = a.value;
+                break;
+            case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
+            {
+                unsigned int i;
+
+                if ( d == current->domain )
+                {
+                    rc = -EPERM;
+                    break;
+                }
+                if ( a.value == 0 ||
+                     a.value > sizeof(d->arch.hvm_domain.ioreq_gmfn.mask) * 8 )
+                {
+                    rc = -EINVAL;
+                    break;
+                }
+                for ( i = 0; i < a.value; i++ )
+                    set_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask);
+
+                break;
+            }
             }
 
             if ( rc == 0 ) 
@@ -4677,6 +5408,13 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             case HVM_PARAM_ACPI_S_STATE:
                 a.value = d->arch.hvm_domain.is_s3_suspended ? 3 : 0;
                 break;
+            case HVM_PARAM_IOREQ_SERVER_PFN:
+            case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
+                if ( d == current->domain )
+                {
+                    rc = -EPERM;
+                    break;
+                }
             case HVM_PARAM_IOREQ_PFN:
             case HVM_PARAM_BUFIOREQ_PFN:
             case HVM_PARAM_BUFIOREQ_EVTCHN: {
@@ -4684,7 +5422,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 
                 /* May need to create server */
                 domid = d->arch.hvm_domain.params[HVM_PARAM_DM_DOMAIN];
-                rc = hvm_create_ioreq_server(d, domid);
+                rc = hvm_create_ioreq_server(d, domid, 1, NULL);
                 if ( rc != 0 && rc != -EEXIST )
                     goto param_fail;
                 /*FALLTHRU*/
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index e6cb5e2..a8fe0aa 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -74,7 +74,7 @@ void send_invalidate_req(void)
         .data = ~0UL, /* flush all */
     };
 
-    (void)hvm_send_assist_req(&p);
+    hvm_broadcast_assist_req(&p);
 }
 
 int handle_mmio(void)
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 1b0514c..d9ae6d1 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -34,8 +34,10 @@
 #include <public/grant_table.h>
 #include <public/hvm/params.h>
 #include <public/hvm/save.h>
+#include <public/hvm/hvm_op.h>
 
 struct hvm_ioreq_page {
+    unsigned long gmfn;
     struct page_info *page;
     void *va;
 };
@@ -46,7 +48,11 @@ struct hvm_ioreq_vcpu {
     evtchn_port_t    ioreq_evtchn;
 };
 
+#define NR_IO_RANGE_TYPES (HVMOP_IO_RANGE_PCI + 1)
+#define MAX_NR_IO_RANGES  256
+
 struct hvm_ioreq_server {
+    struct list_head       list_entry;
     struct domain          *domain;
 
     /* Lock to serialize toolstack modifications */
@@ -54,6 +60,7 @@ struct hvm_ioreq_server {
 
     /* Domain id of emulating domain */
     domid_t                domid;
+    ioservid_t             id;
     struct hvm_ioreq_page  ioreq;
     struct list_head       ioreq_vcpu_list;
     struct hvm_ioreq_page  bufioreq;
@@ -61,11 +68,26 @@ struct hvm_ioreq_server {
     /* Lock to serialize access to buffered ioreq ring */
     spinlock_t             bufioreq_lock;
     evtchn_port_t          bufioreq_evtchn;
+    struct rangeset        *range[NR_IO_RANGE_TYPES];
 };
 
 struct hvm_domain {
-    spinlock_t              ioreq_server_lock;
-    struct hvm_ioreq_server *ioreq_server;
+    /* Guest page range used for non-default ioreq servers */
+    struct {
+        unsigned long base;
+        unsigned long mask;
+    } ioreq_gmfn;
+
+    /* Lock protects all other values in the sub-struct and the default */
+    struct {
+        spinlock_t       lock;
+        ioservid_t       id;
+        struct list_head list;
+    } ioreq_server;
+    struct hvm_ioreq_server *default_ioreq_server;
+
+    /* Cached CF8 for guest PCI config cycles */
+    uint32_t                pci_cf8;
 
     struct pl_time         pl_time;
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index b5a56e0..88e9378 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -233,6 +233,7 @@ int prepare_ring_for_helper(struct domain *d, unsigned long gmfn,
 void destroy_ring_for_helper(void **_va, struct page_info *page);
 
 bool_t hvm_send_assist_req(ioreq_t *p);
+void hvm_broadcast_assist_req(ioreq_t *p);
 
 void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
 int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index f00f6d2..01863c6 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -23,6 +23,7 @@
 
 #include "../xen.h"
 #include "../trace.h"
+#include "../event_channel.h"
 
 /* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */
 #define HVMOP_set_param           0
@@ -232,6 +233,125 @@ struct xen_hvm_inject_msi {
 typedef struct xen_hvm_inject_msi xen_hvm_inject_msi_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_msi_t);
 
+/*
+ * IOREQ Servers
+ *
+ * The interface between an I/O emulator an Xen is called an IOREQ Server.
+ * A domain supports a single 'legacy' IOREQ Server which is instantiated if
+ * parameter...
+ *
+ * HVM_PARAM_IOREQ_PFN is read (to get the gmfn containing the synchronous
+ * ioreq structures), or...
+ * HVM_PARAM_BUFIOREQ_PFN is read (to get the gmfn containing the buffered
+ * ioreq ring), or...
+ * HVM_PARAM_BUFIOREQ_EVTCHN is read (to get the event channel that Xen uses
+ * to request buffered I/O emulation).
+ * 
+ * The following hypercalls facilitate the creation of IOREQ Servers for
+ * 'secondary' emulators which are invoked to implement port I/O, memory, or
+ * PCI config space ranges which they explicitly register.
+ */
+
+typedef uint16_t ioservid_t;
+
+/*
+ * HVMOP_create_ioreq_server: Instantiate a new IOREQ Server for a secondary
+ *                            emulator servicing domain <domid>.
+ *
+ * The <id> handed back is unique for <domid>.
+ */
+#define HVMOP_create_ioreq_server 17
+struct xen_hvm_create_ioreq_server {
+    domid_t domid; /* IN - domain to be serviced */
+    ioservid_t id; /* OUT - server id */
+};
+typedef struct xen_hvm_create_ioreq_server xen_hvm_create_ioreq_server_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
+
+/*
+ * HVMOP_get_ioreq_server_info: Get all the information necessary to access
+ *                              IOREQ Server <id>. 
+ *
+ * The emulator needs to map the synchronous ioreq structures and buffered
+ * ioreq ring that Xen uses to request emulation. These are hosted in domain
+ * <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn> respectively. In addition the
+ * emulator needs to bind to event channel <bufioreq_port> to listen for
+ * buffered emulation requests. (The event channels used for synchronous
+ * emulation requests are specified in the per-CPU ioreq structures in
+ * <ioreq_pfn>).
+ */
+#define HVMOP_get_ioreq_server_info 18
+struct xen_hvm_get_ioreq_server_info {
+    domid_t domid;                 /* IN - domain to be serviced */
+    ioservid_t id;                 /* IN - server id */
+    evtchn_port_t bufioreq_port;   /* OUT - buffered ioreq port */
+    uint64_aligned_t ioreq_pfn;    /* OUT - sync ioreq pfn */
+    uint64_aligned_t bufioreq_pfn; /* OUT - buffered ioreq pfn */
+};
+typedef struct xen_hvm_get_ioreq_server_info xen_hvm_get_ioreq_server_info_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_get_ioreq_server_info_t);
+
+/*
+ * HVM_map_io_range_to_ioreq_server: Register an I/O range of domain <domid>
+ *                                   for emulation by the client of IOREQ
+ *                                   Server <id>
+ * HVM_unmap_io_range_from_ioreq_server: Deregister an I/O range of <domid>
+ *                                       for emulation by the client of IOREQ
+ *                                       Server <id>
+ *
+ * There are three types of I/O that can be emulated: port I/O, memory accesses
+ * and PCI config space accesses. The <type> field denotes which type of range
+ * the <start> and <end> (inclusive) fields are specifying.
+ * PCI config space ranges are specified by segment/bus/device/function values
+ * which should be encoded using the HVMOP_PCI_SBDF helper macro below.
+ *
+ * NOTE: unless an emulation request falls entirely within a range mapped
+ * by a secondary emulator, it will not be passed to that emulator.
+ */
+#define HVMOP_map_io_range_to_ioreq_server 19
+#define HVMOP_unmap_io_range_from_ioreq_server 20
+struct xen_hvm_io_range {
+    domid_t domid;               /* IN - domain to be serviced */
+    ioservid_t id;               /* IN - server id */
+    uint32_t type;               /* IN - type of range */
+# define HVMOP_IO_RANGE_PORT   0 /* I/O port range */
+# define HVMOP_IO_RANGE_MEMORY 1 /* MMIO range */
+# define HVMOP_IO_RANGE_PCI    2 /* PCI segment/bus/dev/func range */
+    uint64_aligned_t start, end; /* IN - inclusive start and end of range */
+};
+typedef struct xen_hvm_io_range xen_hvm_io_range_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_io_range_t);
+
+#define HVMOP_PCI_SBDF(s,b,d,f)                 \
+	((((s) & 0xffff) << 16) |                   \
+	 (((b) & 0xff) << 8) |                      \
+	 (((d) & 0x1f) << 3) |                      \
+	 ((f) & 0x07))
+
+/*
+ * HVMOP_destroy_ioreq_server: Destroy the IOREQ Server <id> servicing domain
+ *                             <domid>.
+ *
+ * Any registered I/O ranges will be automatically deregistered.
+ */
+#define HVMOP_destroy_ioreq_server 21
+struct xen_hvm_destroy_ioreq_server {
+    domid_t domid; /* IN - domain to be serviced */
+    ioservid_t id; /* IN - server id */
+};
+typedef struct xen_hvm_destroy_ioreq_server xen_hvm_destroy_ioreq_server_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_destroy_ioreq_server_t);
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/hvm/ioreq.h b/xen/include/public/hvm/ioreq.h
index f05d130..5b5fedf 100644
--- a/xen/include/public/hvm/ioreq.h
+++ b/xen/include/public/hvm/ioreq.h
@@ -34,13 +34,20 @@
 
 #define IOREQ_TYPE_PIO          0 /* pio */
 #define IOREQ_TYPE_COPY         1 /* mmio ops */
+#define IOREQ_TYPE_PCI_CONFIG   2
 #define IOREQ_TYPE_TIMEOFFSET   7
 #define IOREQ_TYPE_INVALIDATE   8 /* mapcache */
 
 /*
  * VMExit dispatcher should cooperate with instruction decoder to
  * prepare this structure and notify service OS and DM by sending
- * virq
+ * virq.
+ *
+ * For I/O type IOREQ_TYPE_PCI_CONFIG, the physical address is formatted
+ * as follows:
+ * 
+ * 63....48|47..40|39..35|34..32|31........0
+ * SEGMENT |BUS   |DEV   |FN    |OFFSET
  */
 struct ioreq {
     uint64_t addr;          /* physical address */
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 517a184..f830bdd 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -145,6 +145,9 @@
 /* SHUTDOWN_* action in case of a triple fault */
 #define HVM_PARAM_TRIPLE_FAULT_REASON 31
 
-#define HVM_NR_PARAMS          32
+#define HVM_PARAM_IOREQ_SERVER_PFN 32
+#define HVM_PARAM_NR_IOREQ_SERVER_PAGES 33
+
+#define HVM_NR_PARAMS          34
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff --git a/xen/include/xen/list.h b/xen/include/xen/list.h
index 792eda3..88dc7eb 100644
--- a/xen/include/xen/list.h
+++ b/xen/include/xen/list.h
@@ -304,6 +304,15 @@ static inline int list_empty(const struct list_head *head)
 }
 
 /**
+ * list_is_singular - tests whether a list has exactly one entry
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+    return !list_empty(head) && (head->next == head->prev);
+}
+
+/**
  * list_empty_careful - tests whether a list is empty and not being modified
  * @head: the list to test
  *
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 3d4067f..c5aa316 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -544,6 +544,12 @@ static XSM_INLINE int xsm_hvm_inject_msi(XSM_DEFAULT_ARG struct domain *d)
     return xsm_default_action(action, current->domain, d);
 }
 
+static XSM_INLINE int xsm_hvm_ioreq_server(XSM_DEFAULT_ARG struct domain *d, int op)
+{
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
 static XSM_INLINE int xsm_mem_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 4799b08..a85045d 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -147,6 +147,7 @@ struct xsm_operations {
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
+    int (*hvm_ioreq_server) (struct domain *d, int op);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
@@ -564,6 +565,11 @@ static inline int xsm_hvm_inject_msi (xsm_default_t def, struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
+static inline int xsm_hvm_ioreq_server (xsm_default_t def, struct domain *d, int op)
+{
+    return xsm_ops->hvm_ioreq_server(d, op);
+}
+
 static inline int xsm_mem_event_control (xsm_default_t def, struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 67bce4b..c95c803 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -124,6 +124,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
+    set_to_dummy_if_null(ops, hvm_ioreq_server);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index c008398..f2f59ea 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1286,6 +1286,11 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
+static int flask_hvm_ioreq_server(struct domain *d, int op)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__HVMCTL);
+}
+
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1569,6 +1574,7 @@ static struct xsm_operations flask_ops = {
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
+    .hvm_ioreq_server = flask_hvm_ioreq_server,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:33:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU2E-0000MF-8R; Thu, 19 Jun 2014 04:33:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2C-0000M8-5o
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:12 +0000
Received: from [193.109.254.147:26805] by server-5.bemta-14.messagelabs.com id
	82/8B-26413-70862A35; Thu, 19 Jun 2014 04:33:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403152386!12248596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1965 invoked from network); 19 Jun 2014 04:33:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU26-0002PN-JC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU26-0007KQ-CY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:06 +0000
Date: Thu, 19 Jun 2014 04:33:06 +0000
Message-Id: <E1WxU26-0007KQ-CY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ioreq-server: add support for multiple
	servers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 434ae6517af2388572fa24c6c9904822cc75180b
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon Jun 2 09:40:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 09:58:56 2014 +0200

    ioreq-server: add support for multiple servers
    
    The previous single ioreq server that was created on demand now
    becomes the default server and an API is created to allow secondary
    servers, which handle specific IO ranges or PCI devices, to be added.
    
    When the guest issues an IO the list of secondary servers is checked
    for a matching IO range or PCI device. If none is found then the IO
    is passed to the default server.
    
    Secondary servers use guest pages to communicate with emulators, in
    the same way as the default server. These pages need to be in the
    guest physmap otherwise there is no suitable reference that can be
    queried by an emulator in order to map them. Therefore a pool of
    pages in the current E820 reserved region, just below the special
    pages is used. Secondary servers allocate from and free to this pool
    as they are created and destroyed.
    
    The size of the pool is currently hardcoded in the domain build at a
    value of 8. This should be sufficient for now and both the location and
    size of the pool can be modified in future without any need to change the
    API.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    Fix build errors in xen/xsm/dummy.c and xen/xsm/flask/hooks.c with XSM
    enabled.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_domain.c          |  224 ++++++++++
 tools/libxc/xc_domain_restore.c  |   48 ++
 tools/libxc/xc_domain_save.c     |   24 +
 tools/libxc/xc_hvm_build_x86.c   |   50 ++-
 tools/libxc/xc_private.c         |   16 +-
 tools/libxc/xenctrl.h            |  143 ++++++-
 tools/libxc/xg_save_restore.h    |    3 +
 xen/arch/x86/hvm/hvm.c           |  908 ++++++++++++++++++++++++++++++++++----
 xen/arch/x86/hvm/io.c            |    2 +-
 xen/include/asm-x86/hvm/domain.h |   26 +-
 xen/include/asm-x86/hvm/hvm.h    |    1 +
 xen/include/public/hvm/hvm_op.h  |  120 +++++
 xen/include/public/hvm/ioreq.h   |    9 +-
 xen/include/public/hvm/params.h  |    5 +-
 xen/include/xen/list.h           |    9 +
 xen/include/xsm/dummy.h          |    6 +
 xen/include/xsm/xsm.h            |    6 +
 xen/xsm/dummy.c                  |    1 +
 xen/xsm/flask/hooks.c            |    6 +
 19 files changed, 1498 insertions(+), 109 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 369c3f3..a8c9f81 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1284,6 +1284,230 @@ int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long
     return rc;
 }
 
+int xc_hvm_create_ioreq_server(xc_interface *xch,
+                               domid_t domid,
+                               ioservid_t *id)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_create_ioreq_server_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_create_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    *id = arg->id;
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_get_ioreq_server_info(xc_interface *xch,
+                                 domid_t domid,
+                                 ioservid_t id,
+                                 xen_pfn_t *ioreq_pfn,
+                                 xen_pfn_t *bufioreq_pfn,
+                                 evtchn_port_t *bufioreq_port)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_get_ioreq_server_info_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_get_ioreq_server_info;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+    if ( rc != 0 )
+        goto done;
+
+    if ( ioreq_pfn )
+        *ioreq_pfn = arg->ioreq_pfn;
+
+    if ( bufioreq_pfn )
+        *bufioreq_pfn = arg->bufioreq_pfn;
+
+    if ( bufioreq_port )
+        *bufioreq_port = arg->bufioreq_port;
+
+done:
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_map_io_range_to_ioreq_server(xc_interface *xch, domid_t domid,
+                                        ioservid_t id, int is_mmio,
+                                        uint64_t start, uint64_t end)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_map_io_range_to_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = is_mmio ? HVMOP_IO_RANGE_MEMORY : HVMOP_IO_RANGE_PORT;
+    arg->start = start;
+    arg->end = end;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface *xch, domid_t domid,
+                                            ioservid_t id, int is_mmio,
+                                            uint64_t start, uint64_t end)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_unmap_io_range_from_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = is_mmio ? HVMOP_IO_RANGE_MEMORY : HVMOP_IO_RANGE_PORT;
+    arg->start = start;
+    arg->end = end;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch, domid_t domid,
+                                      ioservid_t id, uint16_t segment,
+                                      uint8_t bus, uint8_t device,
+                                      uint8_t function)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    if (device > 0x1f || function > 0x7) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_map_io_range_to_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = HVMOP_IO_RANGE_PCI;
+
+    /*
+     * The underlying hypercall will deal with ranges of PCI SBDF
+     * but, for simplicity, the API only uses singletons.
+     */
+    arg->start = arg->end = HVMOP_PCI_SBDF((uint64_t)segment,
+                                           (uint64_t)bus,
+                                           (uint64_t)device,
+                                           (uint64_t)function);
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch, domid_t domid,
+                                          ioservid_t id, uint16_t segment,
+                                          uint8_t bus, uint8_t device,
+                                          uint8_t function)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_io_range_t, arg);
+    int rc;
+
+    if (device > 0x1f || function > 0x7) {
+        errno = EINVAL;
+        return -1;
+    }
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_unmap_io_range_from_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->type = HVMOP_IO_RANGE_PCI;
+    arg->start = arg->end = HVMOP_PCI_SBDF((uint64_t)segment,
+                                           (uint64_t)bus,
+                                           (uint64_t)device,
+                                           (uint64_t)function);
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
+int xc_hvm_destroy_ioreq_server(xc_interface *xch,
+                                domid_t domid,
+                                ioservid_t id)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_destroy_ioreq_server_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_destroy_ioreq_server;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
 int xc_domain_setdebugging(xc_interface *xch,
                            uint32_t domid,
                            unsigned int enable)
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index bcb0ae0..89af1ad 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -38,6 +38,7 @@
 
 #include <stdlib.h>
 #include <unistd.h>
+#include <inttypes.h>
 
 #include "xg_private.h"
 #include "xg_save_restore.h"
@@ -740,6 +741,8 @@ typedef struct {
     uint64_t acpi_ioport_location;
     uint64_t viridian;
     uint64_t vm_generationid_addr;
+    uint64_t ioreq_server_pfn;
+    uint64_t nr_ioreq_server_pages;
 
     struct toolstack_data_t tdata;
 } pagebuf_t;
@@ -990,6 +993,26 @@ static int pagebuf_get_one(xc_interface *xch, struct restore_ctx *ctx,
         DPRINTF("read generation id buffer address");
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_HVM_IOREQ_SERVER_PFN:
+        /* Skip padding 4 bytes then read the ioreq server gmfn base. */
+        if ( RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->ioreq_server_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the ioreq server gmfn base");
+            return -1;
+        }
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
+    case XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES:
+        /* Skip padding 4 bytes then read the ioreq server gmfn count. */
+        if ( RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->nr_ioreq_server_pages, sizeof(uint64_t)) )
+        {
+            PERROR("error read the ioreq server gmfn count");
+            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);
@@ -1748,6 +1771,31 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     if (pagebuf.viridian != 0)
         xc_set_hvm_param(xch, dom, HVM_PARAM_VIRIDIAN, 1);
 
+    /*
+     * If we are migrating in from a host that does not support
+     * secondary emulators then nr_ioreq_server_pages will be 0, since
+     * there will be no XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk in
+     * the image.
+     * If we are migrating from a host that does support secondary
+     * emulators then the XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES chunk
+     * will exist and is guaranteed to have a non-zero value. The
+     * existence of that chunk also implies the existence of the
+     * XC_SAVE_ID_HVM_IOREQ_SERVER_PFN chunk, which is also guaranteed
+     * to have a non-zero value.
+     */
+    if (!pagebuf.nr_ioreq_server_pages ^ !pagebuf.ioreq_server_pfn) {
+        ERROR("Inconsistent IOREQ Server settings (nr=%"PRIx64", pfn=%"PRIx64")",
+              pagebuf.nr_ioreq_server_pages, pagebuf.ioreq_server_pfn);
+    } else {
+        if (pagebuf.nr_ioreq_server_pages != 0 &&
+            pagebuf.ioreq_server_pfn != 0) {
+            xc_set_hvm_param(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES, 
+                             pagebuf.nr_ioreq_server_pages);
+            xc_set_hvm_param(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
+                             pagebuf.ioreq_server_pfn);
+        }
+    }
+
     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 --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 71f9b59..acf3685 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1737,6 +1737,30 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             PERROR("Error when writing the viridian flag");
             goto out;
         }
+
+        chunk.id = XC_SAVE_ID_HVM_IOREQ_SERVER_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the ioreq server gmfn base");
+            goto out;
+        }
+
+        chunk.id = XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the ioreq server gmfn count");
+            goto out;
+        }
     }
 
     if ( callbacks != NULL && callbacks->toolstack_save != NULL )
diff --git a/tools/libxc/xc_hvm_build_x86.c b/tools/libxc/xc_hvm_build_x86.c
index 43103b9..ed1069b 100644
--- a/tools/libxc/xc_hvm_build_x86.c
+++ b/tools/libxc/xc_hvm_build_x86.c
@@ -49,6 +49,9 @@
 #define NR_SPECIAL_PAGES     8
 #define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
 
+#define NR_IOREQ_SERVER_PAGES 8
+#define ioreq_server_pfn(x) (special_pfn(0) - NR_IOREQ_SERVER_PAGES + (x))
+
 #define VGA_HOLE_SIZE (0x20)
 
 static int modules_init(struct xc_hvm_build_args *args,
@@ -114,7 +117,7 @@ static void build_hvm_info(void *hvm_info_page, uint64_t mem_size,
     /* Memory parameters. */
     hvm_info->low_mem_pgend = lowmem_end >> PAGE_SHIFT;
     hvm_info->high_mem_pgend = highmem_end >> PAGE_SHIFT;
-    hvm_info->reserved_mem_pgstart = special_pfn(0);
+    hvm_info->reserved_mem_pgstart = ioreq_server_pfn(0);
 
     /* Finish with the checksum. */
     for ( i = 0, sum = 0; i < hvm_info->length; i++ )
@@ -257,6 +260,8 @@ static int setup_guest(xc_interface *xch,
         stat_1gb_pages = 0;
     int pod_mode = 0;
     int claim_enabled = args->claim_enabled;
+    xen_pfn_t special_array[NR_SPECIAL_PAGES];
+    xen_pfn_t ioreq_server_array[NR_IOREQ_SERVER_PAGES];
 
     if ( nr_pages > target_pages )
         pod_mode = XENMEMF_populate_on_demand;
@@ -469,18 +474,19 @@ static int setup_guest(xc_interface *xch,
 
     /* Allocate and clear special pages. */
     for ( i = 0; i < NR_SPECIAL_PAGES; i++ )
+        special_array[i] = special_pfn(i);
+
+    rc = xc_domain_populate_physmap_exact(xch, dom, NR_SPECIAL_PAGES, 0, 0,
+                                          special_array);
+    if ( rc != 0 )
     {
-        xen_pfn_t pfn = special_pfn(i);
-        rc = xc_domain_populate_physmap_exact(xch, dom, 1, 0, 0, &pfn);
-        if ( rc != 0 )
-        {
-            PERROR("Could not allocate %d'th special page.", i);
-            goto error_out;
-        }
-        if ( xc_clear_domain_page(xch, dom, special_pfn(i)) )
-            goto error_out;
+        PERROR("Could not allocate special pages.");
+        goto error_out;
     }
 
+    if ( xc_clear_domain_pages(xch, dom, special_pfn(0), NR_SPECIAL_PAGES) )
+            goto error_out;
+
     xc_set_hvm_param(xch, dom, HVM_PARAM_STORE_PFN,
                      special_pfn(SPECIALPAGE_XENSTORE));
     xc_set_hvm_param(xch, dom, HVM_PARAM_BUFIOREQ_PFN,
@@ -497,6 +503,30 @@ static int setup_guest(xc_interface *xch,
                      special_pfn(SPECIALPAGE_SHARING));
 
     /*
+     * Allocate and clear additional ioreq server pages. The default
+     * server will use the IOREQ and BUFIOREQ special pages above.
+     */
+    for ( i = 0; i < NR_IOREQ_SERVER_PAGES; i++ )
+        ioreq_server_array[i] = ioreq_server_pfn(i);
+
+    rc = xc_domain_populate_physmap_exact(xch, dom, NR_IOREQ_SERVER_PAGES, 0, 0,
+                                          ioreq_server_array);
+    if ( rc != 0 )
+    {
+        PERROR("Could not allocate ioreq server pages.");
+        goto error_out;
+    }
+
+    if ( xc_clear_domain_pages(xch, dom, ioreq_server_pfn(0), NR_IOREQ_SERVER_PAGES) )
+            goto error_out;
+
+    /* Tell the domain where the pages are and how many there are */
+    xc_set_hvm_param(xch, dom, HVM_PARAM_IOREQ_SERVER_PFN,
+                     ioreq_server_pfn(0));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_NR_IOREQ_SERVER_PAGES,
+                     NR_IOREQ_SERVER_PAGES);
+
+    /*
      * Identity-map page table is required for running with CR0.PG=0 when
      * using Intel EPT. Create a 32-bit non-PAE page directory of superpages.
      */
diff --git a/tools/libxc/xc_private.c b/tools/libxc/xc_private.c
index 10e7e20..a3da614 100644
--- a/tools/libxc/xc_private.c
+++ b/tools/libxc/xc_private.c
@@ -628,17 +628,19 @@ int xc_copy_to_domain_page(xc_interface *xch,
     return 0;
 }
 
-int xc_clear_domain_page(xc_interface *xch,
-                         uint32_t domid,
-                         unsigned long dst_pfn)
+int xc_clear_domain_pages(xc_interface *xch,
+                          uint32_t domid,
+                          unsigned long dst_pfn,
+                          int num)
 {
+    size_t size = num * PAGE_SIZE;
     void *vaddr = xc_map_foreign_range(
-        xch, domid, PAGE_SIZE, PROT_WRITE, dst_pfn);
+        xch, domid, size, PROT_WRITE, dst_pfn);
     if ( vaddr == NULL )
         return -1;
-    memset(vaddr, 0, PAGE_SIZE);
-    munmap(vaddr, PAGE_SIZE);
-    xc_domain_cacheflush(xch, domid, dst_pfn, 1);
+    memset(vaddr, 0, size);
+    munmap(vaddr, size);
+    xc_domain_cacheflush(xch, domid, dst_pfn, num);
     return 0;
 }
 
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 02129f7..3260a56 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1393,8 +1393,14 @@ int xc_get_pfn_list(xc_interface *xch, uint32_t domid, uint64_t *pfn_buf,
 int xc_copy_to_domain_page(xc_interface *xch, uint32_t domid,
                            unsigned long dst_pfn, const char *src_page);
 
-int xc_clear_domain_page(xc_interface *xch, uint32_t domid,
-                         unsigned long dst_pfn);
+int xc_clear_domain_pages(xc_interface *xch, uint32_t domid,
+                          unsigned long dst_pfn, int num);
+
+static inline int xc_clear_domain_page(xc_interface *xch, uint32_t domid,
+                                       unsigned long dst_pfn)
+{
+    return xc_clear_domain_pages(xch, domid, dst_pfn, 1);
+}
 
 int xc_mmuext_op(xc_interface *xch, struct mmuext_op *op, unsigned int nr_ops,
                  domid_t dom);
@@ -1787,6 +1793,129 @@ void xc_clear_last_error(xc_interface *xch);
 int xc_set_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long value);
 int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long *value);
 
+/*
+ * IOREQ Server API. (See section on IOREQ Servers in public/hvm_op.h).
+ */
+
+/**
+ * This function instantiates an IOREQ Server.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id pointer to an ioservid_t to receive the IOREQ Server id.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_create_ioreq_server(xc_interface *xch,
+                               domid_t domid,
+                               ioservid_t *id);
+
+/**
+ * This function retrieves the necessary information to allow an
+ * emulator to use an IOREQ Server.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm ioreq_pfn pointer to a xen_pfn_t to receive the synchronous ioreq gmfn
+ * @parm bufioreq_pfn pointer to a xen_pfn_t to receive the buffered ioreq gmfn
+ * @parm bufioreq_port pointer to a evtchn_port_t to receive the buffered ioreq event channel
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_get_ioreq_server_info(xc_interface *xch,
+                                 domid_t domid,
+                                 ioservid_t id,
+                                 xen_pfn_t *ioreq_pfn,
+                                 xen_pfn_t *bufioreq_pfn,
+                                 evtchn_port_t *bufioreq_port);
+
+/**
+ * This function registers a range of memory or I/O ports for emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm is_mmio is this a range of ports or memory
+ * @parm start start of range
+ * @parm end end of range (inclusive).
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_map_io_range_to_ioreq_server(xc_interface *xch,
+                                        domid_t domid,
+                                        ioservid_t id,
+                                        int is_mmio,
+                                        uint64_t start,
+                                        uint64_t end);
+
+/**
+ * This function deregisters a range of memory or I/O ports for emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm is_mmio is this a range of ports or memory
+ * @parm start start of range
+ * @parm end end of range (inclusive).
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_unmap_io_range_from_ioreq_server(xc_interface *xch,
+                                            domid_t domid,
+                                            ioservid_t id,
+                                            int is_mmio,
+                                            uint64_t start,
+                                            uint64_t end);
+
+/**
+ * This function registers a PCI device for config space emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm segment the PCI segment of the device
+ * @parm bus the PCI bus of the device
+ * @parm device the 'slot' number of the device
+ * @parm function the function number of the device
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_map_pcidev_to_ioreq_server(xc_interface *xch,
+                                      domid_t domid,
+                                      ioservid_t id,
+                                      uint16_t segment,
+                                      uint8_t bus,
+                                      uint8_t device,
+                                      uint8_t function);
+
+/**
+ * This function deregisters a PCI device for config space emulation.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm segment the PCI segment of the device
+ * @parm bus the PCI bus of the device
+ * @parm device the 'slot' number of the device
+ * @parm function the function number of the device
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_unmap_pcidev_from_ioreq_server(xc_interface *xch,
+                                          domid_t domid,
+                                          ioservid_t id,
+                                          uint16_t segment,
+                                          uint8_t bus,
+                                          uint8_t device,
+                                          uint8_t function);
+
+/**
+ * This function destroys an IOREQ Server.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_destroy_ioreq_server(xc_interface *xch,
+                                domid_t domid,
+                                ioservid_t id);
+
 /* HVM guest pass-through */
 int xc_assign_device(xc_interface *xch,
                      uint32_t domid,
@@ -2425,3 +2554,13 @@ int xc_kexec_load(xc_interface *xch, uint8_t type, uint16_t arch,
 int xc_kexec_unload(xc_interface *xch, int type);
 
 #endif /* XENCTRL_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxc/xg_save_restore.h b/tools/libxc/xg_save_restore.h
index f859621..69ea64e 100644
--- a/tools/libxc/xg_save_restore.h
+++ b/tools/libxc/xg_save_restore.h
@@ -259,6 +259,9 @@
 #define XC_SAVE_ID_HVM_ACCESS_RING_PFN  -16
 #define XC_SAVE_ID_HVM_SHARING_RING_PFN -17
 #define XC_SAVE_ID_TOOLSTACK          -18 /* Optional toolstack specific info */
+/* These are a pair; it is an error for one to exist without the other */
+#define XC_SAVE_ID_HVM_IOREQ_SERVER_PFN -19
+#define XC_SAVE_ID_HVM_NR_IOREQ_SERVER_PAGES -20
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index efbf6d9..6020ea8 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -66,6 +66,7 @@
 #include <asm/mem_event.h>
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
+#include <xen/rangeset.h>
 
 bool_t __read_mostly hvm_enabled;
 
@@ -375,27 +376,35 @@ static ioreq_t *get_ioreq(struct hvm_ioreq_server *s, struct vcpu *v)
 
 bool_t hvm_io_pending(struct vcpu *v)
 {
-    struct hvm_ioreq_server *s = v->domain->arch.hvm_domain.ioreq_server;
-    ioreq_t *p;
+    struct domain *d = v->domain;
+    struct hvm_ioreq_server *s;
 
-    if ( !s )
-        return 0;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        ioreq_t *p = get_ioreq(s, v);
 
-    p = get_ioreq(s, v);
-    return p->state != STATE_IOREQ_NONE;
+        if ( p->state != STATE_IOREQ_NONE )
+            return 1;
+    }
+
+    return 0;
 }
 
 void hvm_do_resume(struct vcpu *v)
 {
     struct domain *d = v->domain;
-    struct hvm_ioreq_server *s = d->arch.hvm_domain.ioreq_server;
+    struct hvm_ioreq_server *s;
 
     check_wakeup_from_wait();
 
     if ( is_hvm_vcpu(v) )
         pt_restore_timer(v);
 
-    if ( s )
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
     {
         ioreq_t *p = get_ioreq(s, v);
 
@@ -430,6 +439,32 @@ void hvm_do_resume(struct vcpu *v)
     }
 }
 
+static int hvm_alloc_ioreq_gmfn(struct domain *d, unsigned long *gmfn)
+{
+    unsigned int i;
+    int rc;
+
+    rc = -ENOMEM;
+    for ( i = 0; i < sizeof(d->arch.hvm_domain.ioreq_gmfn.mask) * 8; i++ )
+    {
+        if ( test_and_clear_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask) )
+        {
+            *gmfn = d->arch.hvm_domain.ioreq_gmfn.base + i;
+            rc = 0;
+            break;
+        }
+    }
+
+    return rc;
+}
+
+static void hvm_free_ioreq_gmfn(struct domain *d, unsigned long gmfn)
+{
+    unsigned int i = gmfn - d->arch.hvm_domain.ioreq_gmfn.base;
+
+    clear_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask);
+}
+
 void destroy_ring_for_helper(
     void **_va, struct page_info *page)
 {
@@ -514,6 +549,7 @@ static int hvm_map_ioreq_page(
 
     iorp->va = va;
     iorp->page = page;
+    iorp->gmfn = gmfn;
 
     return 0;
 }
@@ -544,6 +580,18 @@ static int hvm_print_line(
     return X86EMUL_OKAY;
 }
 
+static int hvm_access_cf8(
+    int dir, uint32_t port, uint32_t bytes, uint32_t *val)
+{
+    struct domain *d = current->domain;
+
+    if ( dir == IOREQ_WRITE && bytes == 4 )
+        d->arch.hvm_domain.pci_cf8 = *val;
+
+    /* We always need to fall through to the catch all emulator */
+    return X86EMUL_UNHANDLEABLE;
+}
+
 static int handle_pvh_io(
     int dir, uint32_t port, uint32_t bytes, uint32_t *val)
 {
@@ -572,7 +620,7 @@ static void hvm_update_ioreq_evtchn(struct hvm_ioreq_server *s,
 }
 
 static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
-                                     struct vcpu *v)
+                                     bool_t is_default, struct vcpu *v)
 {
     struct hvm_ioreq_vcpu *sv;
     int rc;
@@ -600,8 +648,9 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
             goto fail3;
 
         s->bufioreq_evtchn = rc;
-        d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN] =
-            s->bufioreq_evtchn;
+        if ( is_default )
+            d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN] =
+                s->bufioreq_evtchn;
     }
 
     sv->vcpu = v;
@@ -678,41 +727,132 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
     spin_unlock(&s->lock);
 }
 
-static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s)
+static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
+                                      bool_t is_default)
 {
     struct domain *d = s->domain;
-    unsigned long pfn;
+    unsigned long ioreq_pfn, bufioreq_pfn;
     int rc;
 
-    pfn = d->arch.hvm_domain.params[HVM_PARAM_IOREQ_PFN];
-    rc = hvm_map_ioreq_page(s, 0, pfn);
+    if ( is_default )
+    {
+        ioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_IOREQ_PFN];
+        bufioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_PFN];
+    }
+    else
+    {
+        rc = hvm_alloc_ioreq_gmfn(d, &ioreq_pfn);
+        if ( rc )
+            goto fail1;
+
+        rc = hvm_alloc_ioreq_gmfn(d, &bufioreq_pfn);
+        if ( rc )
+            goto fail2;
+    }
+
+    rc = hvm_map_ioreq_page(s, 0, ioreq_pfn);
     if ( rc )
-        return rc;
+        goto fail3;
 
-    pfn = d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_PFN];
-    rc = hvm_map_ioreq_page(s, 1, pfn);
+    rc = hvm_map_ioreq_page(s, 1, bufioreq_pfn);
     if ( rc )
-        goto fail;
+        goto fail4;
 
     return 0;
 
-fail:
+fail4:
     hvm_unmap_ioreq_page(s, 0);
+
+fail3:
+    if ( !is_default )
+        hvm_free_ioreq_gmfn(d, bufioreq_pfn);
+
+fail2:
+    if ( !is_default )
+        hvm_free_ioreq_gmfn(d, ioreq_pfn);
+
+fail1:
     return rc;
 }
 
-static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s)
+static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s, 
+                                         bool_t is_default)
 {
+    struct domain *d = s->domain;
+
     hvm_unmap_ioreq_page(s, 1);
     hvm_unmap_ioreq_page(s, 0);
+
+    if ( !is_default )
+    {
+        hvm_free_ioreq_gmfn(d, s->bufioreq.gmfn);
+        hvm_free_ioreq_gmfn(d, s->ioreq.gmfn);
+    }
+}
+
+static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s, 
+                                            bool_t is_default)
+{
+    unsigned int i;
+    int rc;
+
+    if ( is_default )
+        goto done;
+
+    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
+    {
+        char *name;
+
+        rc = asprintf(&name, "ioreq_server %d %s", s->id,
+                      (i == HVMOP_IO_RANGE_PORT) ? "port" :
+                      (i == HVMOP_IO_RANGE_MEMORY) ? "memory" :
+                      (i == HVMOP_IO_RANGE_PCI) ? "pci" :
+                      "");
+        if ( rc )
+            goto fail;
+
+        s->range[i] = rangeset_new(s->domain, name,
+                                   RANGESETF_prettyprint_hex);
+
+        xfree(name);
+
+        rc = -ENOMEM;
+        if ( !s->range[i] )
+            goto fail;
+
+        rangeset_limit(s->range[i], MAX_NR_IO_RANGES);
+    }
+
+ done:
+    return 0;
+
+ fail:
+    while ( --i >= 0 )
+        rangeset_destroy(s->range[i]);
+
+    return rc;
+}
+
+static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s, 
+                                            bool_t is_default)
+{
+    unsigned int i;
+
+    if ( is_default )
+        return;
+
+    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
+        rangeset_destroy(s->range[i]);
 }
 
 static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
-                                 domid_t domid)
+                                 domid_t domid, bool_t is_default,
+                                 ioservid_t id)
 {
     struct vcpu *v;
     int rc;
 
+    s->id = id;
     s->domain = d;
     s->domid = domid;
 
@@ -720,33 +860,71 @@ static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
     INIT_LIST_HEAD(&s->ioreq_vcpu_list);
     spin_lock_init(&s->bufioreq_lock);
 
-    rc = hvm_ioreq_server_map_pages(s);
+    rc = hvm_ioreq_server_alloc_rangesets(s, is_default);
     if ( rc )
-        return rc;
+        goto fail1;
+
+    rc = hvm_ioreq_server_map_pages(s, is_default);
+    if ( rc )
+        goto fail2;
 
     for_each_vcpu ( d, v )
     {
-        rc = hvm_ioreq_server_add_vcpu(s, v);
+        rc = hvm_ioreq_server_add_vcpu(s, is_default, v);
         if ( rc )
-            goto fail;
+            goto fail3;
     }
 
     return 0;
 
- fail:
+ fail3:
     hvm_ioreq_server_remove_all_vcpus(s);
-    hvm_ioreq_server_unmap_pages(s);
+    hvm_ioreq_server_unmap_pages(s, is_default);
+
+ fail2:
+    hvm_ioreq_server_free_rangesets(s, is_default);
 
+ fail1:
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     return rc;
 }
 
-static void hvm_ioreq_server_deinit(struct hvm_ioreq_server *s)
+static void hvm_ioreq_server_deinit(struct hvm_ioreq_server *s,
+                                    bool_t is_default)
 {
     hvm_ioreq_server_remove_all_vcpus(s);
-    hvm_ioreq_server_unmap_pages(s);
+    hvm_ioreq_server_unmap_pages(s, is_default);
+    hvm_ioreq_server_free_rangesets(s, is_default);
 }
 
-static int hvm_create_ioreq_server(struct domain *d, domid_t domid)
+static ioservid_t next_ioservid(struct domain *d)
+{
+    struct hvm_ioreq_server *s;
+    ioservid_t id;
+    
+    ASSERT(spin_is_locked(&d->arch.hvm_domain.ioreq_server.lock));
+
+    id = d->arch.hvm_domain.ioreq_server.id;
+
+ again:
+    id++;
+
+    /* Check for uniqueness */
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( id == s->id )
+            goto again;
+    }
+
+    d->arch.hvm_domain.ioreq_server.id = id;
+
+    return id;
+}
+
+static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
+                                   bool_t is_default, ioservid_t *id)
 {
     struct hvm_ioreq_server *s;
     int rc;
@@ -757,25 +935,34 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid)
         goto fail1;
 
     domain_pause(d);
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
 
     rc = -EEXIST;
-    if ( d->arch.hvm_domain.ioreq_server != NULL )
+    if ( is_default && d->arch.hvm_domain.default_ioreq_server != NULL )
         goto fail2;
 
-    rc = hvm_ioreq_server_init(s, d, domid);
+    rc = hvm_ioreq_server_init(s, d, domid, is_default,
+                               next_ioservid(d));
     if ( rc )
-        goto fail2;
+        goto fail3;
 
-    d->arch.hvm_domain.ioreq_server = s;
+    list_add(&s->list_entry,
+             &d->arch.hvm_domain.ioreq_server.list);
 
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    if ( is_default )
+        d->arch.hvm_domain.default_ioreq_server = s;
+
+    if ( id )
+        *id = s->id;
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     domain_unpause(d);
 
     return 0;
 
+ fail3:
  fail2:
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     domain_unpause(d);
 
     xfree(s);
@@ -783,24 +970,252 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid)
     return rc;
 }
 
-static void hvm_destroy_ioreq_server(struct domain *d)
+static int hvm_destroy_ioreq_server(struct domain *d, ioservid_t id)
 {
     struct hvm_ioreq_server *s;
+    int rc;
 
-    domain_pause(d);
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id != id )
+            continue;
+
+        domain_pause(d);
+
+        list_del(&s->list_entry);
+        
+        hvm_ioreq_server_deinit(s, 0);
+
+        domain_unpause(d);
+
+        xfree(s);
+
+        rc = 0;
+        break;
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static int hvm_get_ioreq_server_info(struct domain *d, ioservid_t id,
+                                     unsigned long *ioreq_pfn,
+                                     unsigned long *bufioreq_pfn,
+                                     evtchn_port_t *bufioreq_port)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
 
-    s = d->arch.hvm_domain.ioreq_server;
-    if ( s )
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
     {
-        d->arch.hvm_domain.ioreq_server = NULL;
-        hvm_ioreq_server_deinit(s);
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id != id )
+            continue;
+
+        *ioreq_pfn = s->ioreq.gmfn;
+        *bufioreq_pfn = s->bufioreq.gmfn;
+        *bufioreq_port = s->bufioreq_evtchn;
+
+        rc = 0;
+        break;
     }
 
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
-    domain_unpause(d);
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
 
-    xfree(s);
+    return rc;
+}
+
+static int hvm_map_io_range_to_ioreq_server(struct domain *d, ioservid_t id,
+                                            uint32_t type, uint64_t start, uint64_t end)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id == id )
+        {
+            struct rangeset *r;
+
+            switch ( type )
+            {
+            case HVMOP_IO_RANGE_PORT:
+            case HVMOP_IO_RANGE_MEMORY:
+            case HVMOP_IO_RANGE_PCI:
+                r = s->range[type];
+                break;
+
+            default:
+                r = NULL;
+                break;
+            }
+
+            rc = -EINVAL;
+            if ( !r )
+                break;
+
+            rc = -EEXIST;
+            if ( rangeset_overlaps_range(r, start, end) )
+                break;
+
+            rc = rangeset_add_range(r, start, end);
+            break;
+        }
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static int hvm_unmap_io_range_from_ioreq_server(struct domain *d, ioservid_t id,
+                                                uint32_t type, uint64_t start, uint64_t end)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id == id )
+        {
+            struct rangeset *r;
+
+            switch ( type )
+            {
+            case HVMOP_IO_RANGE_PORT:
+            case HVMOP_IO_RANGE_MEMORY:
+            case HVMOP_IO_RANGE_PCI:
+                r = s->range[type];
+                break;
+
+            default:
+                r = NULL;
+                break;
+            }
+
+            rc = -EINVAL;
+            if ( !r )
+                break;
+
+            rc = -ENOENT;
+            if ( !rangeset_contains_range(r, start, end) )
+                break;
+
+            rc = rangeset_remove_range(r, start, end);
+            break;
+        }
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static int hvm_all_ioreq_servers_add_vcpu(struct domain *d, struct vcpu *v)
+{
+    struct hvm_ioreq_server *s;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
+
+        rc = hvm_ioreq_server_add_vcpu(s, is_default, v);
+        if ( rc )
+            goto fail;
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return 0;
+
+ fail:
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+        hvm_ioreq_server_remove_vcpu(s, v);
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    return rc;
+}
+
+static void hvm_all_ioreq_servers_remove_vcpu(struct domain *d, struct vcpu *v)
+{
+    struct hvm_ioreq_server *s;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+        hvm_ioreq_server_remove_vcpu(s, v);
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+}
+
+static void hvm_destroy_all_ioreq_servers(struct domain *d)
+{
+    struct hvm_ioreq_server *s, *next;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    /* No need to domain_pause() as the domain is being torn down */
+
+    list_for_each_entry_safe ( s,
+                               next,
+                               &d->arch.hvm_domain.ioreq_server.list,
+                               list_entry )
+    {
+        bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
+
+        if ( is_default )
+            d->arch.hvm_domain.default_ioreq_server = NULL;
+
+        list_del(&s->list_entry);
+        
+        hvm_ioreq_server_deinit(s, is_default);
+
+        xfree(s);
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
 }
 
 static int hvm_replace_event_channel(struct vcpu *v, domid_t remote_domid,
@@ -823,21 +1238,22 @@ static int hvm_set_dm_domain(struct domain *d, domid_t domid)
     struct hvm_ioreq_server *s;
     int rc = 0;
 
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
 
     /*
      * Lack of ioreq server is not a failure. HVM_PARAM_DM_DOMAIN will
      * still be set and thus, when the server is created, it will have
      * the correct domid.
      */
-    s = d->arch.hvm_domain.ioreq_server;
+    s = d->arch.hvm_domain.default_ioreq_server;
     if ( !s )
         goto done;
 
     domain_pause(d);
     spin_lock(&s->lock);
 
-    if ( s->domid != domid ) {
+    if ( s->domid != domid ) 
+    {
         struct hvm_ioreq_vcpu *sv;
 
         list_for_each_entry ( sv,
@@ -871,7 +1287,7 @@ static int hvm_set_dm_domain(struct domain *d, domid_t domid)
     domain_unpause(d);
 
  done:
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
     return rc;
 }
 
@@ -902,7 +1318,8 @@ int hvm_domain_initialise(struct domain *d)
 
     }
 
-    spin_lock_init(&d->arch.hvm_domain.ioreq_server_lock);
+    spin_lock_init(&d->arch.hvm_domain.ioreq_server.lock);
+    INIT_LIST_HEAD(&d->arch.hvm_domain.ioreq_server.list);
     spin_lock_init(&d->arch.hvm_domain.irq_lock);
     spin_lock_init(&d->arch.hvm_domain.uc_lock);
 
@@ -944,6 +1361,7 @@ int hvm_domain_initialise(struct domain *d)
     rtc_init(d);
 
     register_portio_handler(d, 0xe9, 1, hvm_print_line);
+    register_portio_handler(d, 0xcf8, 4, hvm_access_cf8);
 
     rc = hvm_funcs.domain_initialise(d);
     if ( rc != 0 )
@@ -974,7 +1392,7 @@ void hvm_domain_relinquish_resources(struct domain *d)
     if ( hvm_funcs.nhvm_domain_relinquish_resources )
         hvm_funcs.nhvm_domain_relinquish_resources(d);
 
-    hvm_destroy_ioreq_server(d);
+    hvm_destroy_all_ioreq_servers(d);
 
     msixtbl_pt_cleanup(d);
 
@@ -1607,7 +2025,6 @@ int hvm_vcpu_initialise(struct vcpu *v)
 {
     int rc;
     struct domain *d = v->domain;
-    struct hvm_ioreq_server *s;
 
     hvm_asid_flush_vcpu(v);
 
@@ -1650,14 +2067,7 @@ int hvm_vcpu_initialise(struct vcpu *v)
          && (rc = nestedhvm_vcpu_initialise(v)) < 0 ) /* teardown: nestedhvm_vcpu_destroy */
         goto fail5;
 
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
-
-    s = d->arch.hvm_domain.ioreq_server;
-    if ( s )
-        rc = hvm_ioreq_server_add_vcpu(s, v);
-
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
-
+    rc = hvm_all_ioreq_servers_add_vcpu(d, v);
     if ( rc != 0 )
         goto fail6;
 
@@ -1694,15 +2104,8 @@ int hvm_vcpu_initialise(struct vcpu *v)
 void hvm_vcpu_destroy(struct vcpu *v)
 {
     struct domain *d = v->domain;
-    struct hvm_ioreq_server *s;
-
-    spin_lock(&d->arch.hvm_domain.ioreq_server_lock);
-
-    s = d->arch.hvm_domain.ioreq_server;
-    if ( s )
-        hvm_ioreq_server_remove_vcpu(s, v);
 
-    spin_unlock(&d->arch.hvm_domain.ioreq_server_lock);
+    hvm_all_ioreq_servers_remove_vcpu(d, v);
 
     nestedhvm_vcpu_destroy(v);
 
@@ -1741,11 +2144,107 @@ void hvm_vcpu_down(struct vcpu *v)
     }
 }
 
+static struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
+                                                        ioreq_t *p)
+{
+#define CF8_BDF(cf8)     (((cf8) & 0x00ffff00) >> 8)
+#define CF8_ADDR_LO(cf8) ((cf8) & 0x000000fc)
+#define CF8_ADDR_HI(cf8) (((cf8) & 0x0f000000) >> 16)
+#define CF8_ENABLED(cf8) (!!((cf8) & 0x80000000))
+
+    struct hvm_ioreq_server *s;
+    uint32_t cf8;
+    uint8_t type;
+    uint64_t addr;
+
+    if ( list_empty(&d->arch.hvm_domain.ioreq_server.list) )
+        return NULL;
+
+    if ( list_is_singular(&d->arch.hvm_domain.ioreq_server.list) ||
+         (p->type != IOREQ_TYPE_COPY && p->type != IOREQ_TYPE_PIO) )
+        return d->arch.hvm_domain.default_ioreq_server;
+
+    cf8 = d->arch.hvm_domain.pci_cf8;
+
+    if ( p->type == IOREQ_TYPE_PIO &&
+         (p->addr & ~3) == 0xcfc &&
+         CF8_ENABLED(cf8) )
+    {
+        uint32_t sbdf;
+
+        /* PCI config data cycle */
+
+        sbdf = HVMOP_PCI_SBDF(0,
+                              PCI_BUS(CF8_BDF(cf8)),
+                              PCI_SLOT(CF8_BDF(cf8)),
+                              PCI_FUNC(CF8_BDF(cf8)));
+
+        type = IOREQ_TYPE_PCI_CONFIG;
+        addr = ((uint64_t)sbdf << 32) |
+               CF8_ADDR_HI(cf8) |
+               CF8_ADDR_LO(cf8) |
+               (p->addr & 3);
+    }
+    else
+    {
+        type = p->type;
+        addr = p->addr;
+    }
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+    {
+        struct rangeset *r;
+
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        BUILD_BUG_ON(IOREQ_TYPE_PIO != HVMOP_IO_RANGE_PORT);
+        BUILD_BUG_ON(IOREQ_TYPE_COPY != HVMOP_IO_RANGE_MEMORY);
+        BUILD_BUG_ON(IOREQ_TYPE_PCI_CONFIG != HVMOP_IO_RANGE_PCI);
+        r = s->range[type];
+
+        switch ( type )
+        {
+            unsigned long end;
+
+        case IOREQ_TYPE_PIO:
+            end = addr + p->size - 1;
+            if ( rangeset_contains_range(r, addr, end) )
+                return s;
+
+            break;
+        case IOREQ_TYPE_COPY:
+            end = addr + (p->size * p->count) - 1;
+            if ( rangeset_contains_range(r, addr, end) )
+                return s;
+
+            break;
+        case IOREQ_TYPE_PCI_CONFIG:
+            if ( rangeset_contains_singleton(r, addr >> 32) )
+            {
+                p->type = type;
+                p->addr = addr;
+                return s;
+            }
+
+            break;
+        }
+    }
+
+    return d->arch.hvm_domain.default_ioreq_server;
+
+#undef CF8_ADDR_ENABLED
+#undef CF8_ADDR_HI
+#undef CF8_ADDR_LO
+#undef CF8_BDF
+}
+
 int hvm_buffered_io_send(ioreq_t *p)
 {
-    struct vcpu *v = current;
-    struct domain *d = v->domain;
-    struct hvm_ioreq_server *s = d->arch.hvm_domain.ioreq_server;
+    struct domain *d = current->domain;
+    struct hvm_ioreq_server *s = hvm_select_ioreq_server(d, p);
     struct hvm_ioreq_page *iorp;
     buffered_iopage_t *pg;
     buf_ioreq_t bp = { .data = p->data,
@@ -1825,23 +2324,20 @@ int hvm_buffered_io_send(ioreq_t *p)
 
 bool_t hvm_has_dm(struct domain *d)
 {
-    return !!d->arch.hvm_domain.ioreq_server;
+    return !list_empty(&d->arch.hvm_domain.ioreq_server.list);
 }
 
-bool_t hvm_send_assist_req(ioreq_t *proto_p)
+bool_t hvm_send_assist_req_to_ioreq_server(struct hvm_ioreq_server *s,
+                                           ioreq_t *proto_p)
 {
-    struct vcpu *v = current;
-    struct domain *d = v->domain;
-    struct hvm_ioreq_server *s = d->arch.hvm_domain.ioreq_server;
+    struct vcpu *curr = current;
+    struct domain *d = curr->domain;
     ioreq_t *p;
 
-    if ( unlikely(!vcpu_start_shutdown_deferral(v)) )
+    if ( unlikely(!vcpu_start_shutdown_deferral(curr)) )
         return 0; /* implicitly bins the i/o operation */
 
-    if ( !s )
-        return 0;
-
-    p = get_ioreq(s, v);
+    p = get_ioreq(s, curr);
 
     if ( unlikely(p->state != STATE_IOREQ_NONE) )
     {
@@ -1867,6 +2363,29 @@ bool_t hvm_send_assist_req(ioreq_t *proto_p)
     return 1;
 }
 
+bool_t hvm_send_assist_req(ioreq_t *p)
+{
+    struct hvm_ioreq_server *s = hvm_select_ioreq_server(current->domain, p);
+
+    if ( !s )
+        return 0;
+
+    return hvm_send_assist_req_to_ioreq_server(s, p);
+}
+
+void hvm_broadcast_assist_req(ioreq_t *p)
+{
+    struct domain *d = current->domain;
+    struct hvm_ioreq_server *s;
+
+    ASSERT(p->type == IOREQ_TYPE_INVALIDATE);
+
+    list_for_each_entry ( s,
+                          &d->arch.hvm_domain.ioreq_server.list,
+                          list_entry )
+        (void) hvm_send_assist_req_to_ioreq_server(s, p);
+}
+
 void hvm_hlt(unsigned long rflags)
 {
     struct vcpu *curr = current;
@@ -4480,6 +4999,165 @@ static int hvmop_flush_tlb_all(void)
     return 0;
 }
 
+static int hvmop_create_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_create_ioreq_server_t) uop)
+{
+    struct domain *curr_d = current->domain;
+    xen_hvm_create_ioreq_server_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_create_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_create_ioreq_server(d, curr_d->domain_id, 0, &op.id);
+    if ( rc != 0 )
+        goto out;
+
+    rc = copy_to_guest(uop, &op, 1) ? -EFAULT : 0;
+    
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_get_ioreq_server_info(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_get_ioreq_server_info_t) uop)
+{
+    xen_hvm_get_ioreq_server_info_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_get_ioreq_server_info);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_get_ioreq_server_info(d, op.id,
+                                   &op.ioreq_pfn,
+                                   &op.bufioreq_pfn, 
+                                   &op.bufioreq_port);
+    if ( rc != 0 )
+        goto out;
+
+    rc = copy_to_guest(uop, &op, 1) ? -EFAULT : 0;
+    
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_map_io_range_to_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_io_range_t) uop)
+{
+    xen_hvm_io_range_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_map_io_range_to_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_map_io_range_to_ioreq_server(d, op.id, op.type,
+                                          op.start, op.end);
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_unmap_io_range_from_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_io_range_t) uop)
+{
+    xen_hvm_io_range_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_unmap_io_range_from_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_unmap_io_range_from_ioreq_server(d, op.id, op.type,
+                                              op.start, op.end);
+    
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
+static int hvmop_destroy_ioreq_server(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_destroy_ioreq_server_t) uop)
+{
+    xen_hvm_destroy_ioreq_server_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_destroy_ioreq_server);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_destroy_ioreq_server(d, op.id);
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
 #define HVMOP_op_mask 0xff
 
 long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
@@ -4491,6 +5169,31 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
 
     switch ( op &= HVMOP_op_mask )
     {
+    case HVMOP_create_ioreq_server:
+        rc = hvmop_create_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_create_ioreq_server_t));
+        break;
+    
+    case HVMOP_get_ioreq_server_info:
+        rc = hvmop_get_ioreq_server_info(
+            guest_handle_cast(arg, xen_hvm_get_ioreq_server_info_t));
+        break;
+    
+    case HVMOP_map_io_range_to_ioreq_server:
+        rc = hvmop_map_io_range_to_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_io_range_t));
+        break;
+    
+    case HVMOP_unmap_io_range_from_ioreq_server:
+        rc = hvmop_unmap_io_range_from_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_io_range_t));
+        break;
+    
+    case HVMOP_destroy_ioreq_server:
+        rc = hvmop_destroy_ioreq_server(
+            guest_handle_cast(arg, xen_hvm_destroy_ioreq_server_t));
+        break;
+    
     case HVMOP_set_param:
     case HVMOP_get_param:
     {
@@ -4644,6 +5347,34 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 if ( a.value > SHUTDOWN_MAX )
                     rc = -EINVAL;
                 break;
+            case HVM_PARAM_IOREQ_SERVER_PFN:
+                if ( d == current->domain )
+                {
+                    rc = -EPERM;
+                    break;
+                }
+                d->arch.hvm_domain.ioreq_gmfn.base = a.value;
+                break;
+            case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
+            {
+                unsigned int i;
+
+                if ( d == current->domain )
+                {
+                    rc = -EPERM;
+                    break;
+                }
+                if ( a.value == 0 ||
+                     a.value > sizeof(d->arch.hvm_domain.ioreq_gmfn.mask) * 8 )
+                {
+                    rc = -EINVAL;
+                    break;
+                }
+                for ( i = 0; i < a.value; i++ )
+                    set_bit(i, &d->arch.hvm_domain.ioreq_gmfn.mask);
+
+                break;
+            }
             }
 
             if ( rc == 0 ) 
@@ -4677,6 +5408,13 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
             case HVM_PARAM_ACPI_S_STATE:
                 a.value = d->arch.hvm_domain.is_s3_suspended ? 3 : 0;
                 break;
+            case HVM_PARAM_IOREQ_SERVER_PFN:
+            case HVM_PARAM_NR_IOREQ_SERVER_PAGES:
+                if ( d == current->domain )
+                {
+                    rc = -EPERM;
+                    break;
+                }
             case HVM_PARAM_IOREQ_PFN:
             case HVM_PARAM_BUFIOREQ_PFN:
             case HVM_PARAM_BUFIOREQ_EVTCHN: {
@@ -4684,7 +5422,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 
                 /* May need to create server */
                 domid = d->arch.hvm_domain.params[HVM_PARAM_DM_DOMAIN];
-                rc = hvm_create_ioreq_server(d, domid);
+                rc = hvm_create_ioreq_server(d, domid, 1, NULL);
                 if ( rc != 0 && rc != -EEXIST )
                     goto param_fail;
                 /*FALLTHRU*/
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index e6cb5e2..a8fe0aa 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -74,7 +74,7 @@ void send_invalidate_req(void)
         .data = ~0UL, /* flush all */
     };
 
-    (void)hvm_send_assist_req(&p);
+    hvm_broadcast_assist_req(&p);
 }
 
 int handle_mmio(void)
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index 1b0514c..d9ae6d1 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -34,8 +34,10 @@
 #include <public/grant_table.h>
 #include <public/hvm/params.h>
 #include <public/hvm/save.h>
+#include <public/hvm/hvm_op.h>
 
 struct hvm_ioreq_page {
+    unsigned long gmfn;
     struct page_info *page;
     void *va;
 };
@@ -46,7 +48,11 @@ struct hvm_ioreq_vcpu {
     evtchn_port_t    ioreq_evtchn;
 };
 
+#define NR_IO_RANGE_TYPES (HVMOP_IO_RANGE_PCI + 1)
+#define MAX_NR_IO_RANGES  256
+
 struct hvm_ioreq_server {
+    struct list_head       list_entry;
     struct domain          *domain;
 
     /* Lock to serialize toolstack modifications */
@@ -54,6 +60,7 @@ struct hvm_ioreq_server {
 
     /* Domain id of emulating domain */
     domid_t                domid;
+    ioservid_t             id;
     struct hvm_ioreq_page  ioreq;
     struct list_head       ioreq_vcpu_list;
     struct hvm_ioreq_page  bufioreq;
@@ -61,11 +68,26 @@ struct hvm_ioreq_server {
     /* Lock to serialize access to buffered ioreq ring */
     spinlock_t             bufioreq_lock;
     evtchn_port_t          bufioreq_evtchn;
+    struct rangeset        *range[NR_IO_RANGE_TYPES];
 };
 
 struct hvm_domain {
-    spinlock_t              ioreq_server_lock;
-    struct hvm_ioreq_server *ioreq_server;
+    /* Guest page range used for non-default ioreq servers */
+    struct {
+        unsigned long base;
+        unsigned long mask;
+    } ioreq_gmfn;
+
+    /* Lock protects all other values in the sub-struct and the default */
+    struct {
+        spinlock_t       lock;
+        ioservid_t       id;
+        struct list_head list;
+    } ioreq_server;
+    struct hvm_ioreq_server *default_ioreq_server;
+
+    /* Cached CF8 for guest PCI config cycles */
+    uint32_t                pci_cf8;
 
     struct pl_time         pl_time;
 
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index b5a56e0..88e9378 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -233,6 +233,7 @@ int prepare_ring_for_helper(struct domain *d, unsigned long gmfn,
 void destroy_ring_for_helper(void **_va, struct page_info *page);
 
 bool_t hvm_send_assist_req(ioreq_t *p);
+void hvm_broadcast_assist_req(ioreq_t *p);
 
 void hvm_get_guest_pat(struct vcpu *v, u64 *guest_pat);
 int hvm_set_guest_pat(struct vcpu *v, u64 guest_pat);
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index f00f6d2..01863c6 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -23,6 +23,7 @@
 
 #include "../xen.h"
 #include "../trace.h"
+#include "../event_channel.h"
 
 /* Get/set subcommands: extra argument == pointer to xen_hvm_param struct. */
 #define HVMOP_set_param           0
@@ -232,6 +233,125 @@ struct xen_hvm_inject_msi {
 typedef struct xen_hvm_inject_msi xen_hvm_inject_msi_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_inject_msi_t);
 
+/*
+ * IOREQ Servers
+ *
+ * The interface between an I/O emulator an Xen is called an IOREQ Server.
+ * A domain supports a single 'legacy' IOREQ Server which is instantiated if
+ * parameter...
+ *
+ * HVM_PARAM_IOREQ_PFN is read (to get the gmfn containing the synchronous
+ * ioreq structures), or...
+ * HVM_PARAM_BUFIOREQ_PFN is read (to get the gmfn containing the buffered
+ * ioreq ring), or...
+ * HVM_PARAM_BUFIOREQ_EVTCHN is read (to get the event channel that Xen uses
+ * to request buffered I/O emulation).
+ * 
+ * The following hypercalls facilitate the creation of IOREQ Servers for
+ * 'secondary' emulators which are invoked to implement port I/O, memory, or
+ * PCI config space ranges which they explicitly register.
+ */
+
+typedef uint16_t ioservid_t;
+
+/*
+ * HVMOP_create_ioreq_server: Instantiate a new IOREQ Server for a secondary
+ *                            emulator servicing domain <domid>.
+ *
+ * The <id> handed back is unique for <domid>.
+ */
+#define HVMOP_create_ioreq_server 17
+struct xen_hvm_create_ioreq_server {
+    domid_t domid; /* IN - domain to be serviced */
+    ioservid_t id; /* OUT - server id */
+};
+typedef struct xen_hvm_create_ioreq_server xen_hvm_create_ioreq_server_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
+
+/*
+ * HVMOP_get_ioreq_server_info: Get all the information necessary to access
+ *                              IOREQ Server <id>. 
+ *
+ * The emulator needs to map the synchronous ioreq structures and buffered
+ * ioreq ring that Xen uses to request emulation. These are hosted in domain
+ * <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn> respectively. In addition the
+ * emulator needs to bind to event channel <bufioreq_port> to listen for
+ * buffered emulation requests. (The event channels used for synchronous
+ * emulation requests are specified in the per-CPU ioreq structures in
+ * <ioreq_pfn>).
+ */
+#define HVMOP_get_ioreq_server_info 18
+struct xen_hvm_get_ioreq_server_info {
+    domid_t domid;                 /* IN - domain to be serviced */
+    ioservid_t id;                 /* IN - server id */
+    evtchn_port_t bufioreq_port;   /* OUT - buffered ioreq port */
+    uint64_aligned_t ioreq_pfn;    /* OUT - sync ioreq pfn */
+    uint64_aligned_t bufioreq_pfn; /* OUT - buffered ioreq pfn */
+};
+typedef struct xen_hvm_get_ioreq_server_info xen_hvm_get_ioreq_server_info_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_get_ioreq_server_info_t);
+
+/*
+ * HVM_map_io_range_to_ioreq_server: Register an I/O range of domain <domid>
+ *                                   for emulation by the client of IOREQ
+ *                                   Server <id>
+ * HVM_unmap_io_range_from_ioreq_server: Deregister an I/O range of <domid>
+ *                                       for emulation by the client of IOREQ
+ *                                       Server <id>
+ *
+ * There are three types of I/O that can be emulated: port I/O, memory accesses
+ * and PCI config space accesses. The <type> field denotes which type of range
+ * the <start> and <end> (inclusive) fields are specifying.
+ * PCI config space ranges are specified by segment/bus/device/function values
+ * which should be encoded using the HVMOP_PCI_SBDF helper macro below.
+ *
+ * NOTE: unless an emulation request falls entirely within a range mapped
+ * by a secondary emulator, it will not be passed to that emulator.
+ */
+#define HVMOP_map_io_range_to_ioreq_server 19
+#define HVMOP_unmap_io_range_from_ioreq_server 20
+struct xen_hvm_io_range {
+    domid_t domid;               /* IN - domain to be serviced */
+    ioservid_t id;               /* IN - server id */
+    uint32_t type;               /* IN - type of range */
+# define HVMOP_IO_RANGE_PORT   0 /* I/O port range */
+# define HVMOP_IO_RANGE_MEMORY 1 /* MMIO range */
+# define HVMOP_IO_RANGE_PCI    2 /* PCI segment/bus/dev/func range */
+    uint64_aligned_t start, end; /* IN - inclusive start and end of range */
+};
+typedef struct xen_hvm_io_range xen_hvm_io_range_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_io_range_t);
+
+#define HVMOP_PCI_SBDF(s,b,d,f)                 \
+	((((s) & 0xffff) << 16) |                   \
+	 (((b) & 0xff) << 8) |                      \
+	 (((d) & 0x1f) << 3) |                      \
+	 ((f) & 0x07))
+
+/*
+ * HVMOP_destroy_ioreq_server: Destroy the IOREQ Server <id> servicing domain
+ *                             <domid>.
+ *
+ * Any registered I/O ranges will be automatically deregistered.
+ */
+#define HVMOP_destroy_ioreq_server 21
+struct xen_hvm_destroy_ioreq_server {
+    domid_t domid; /* IN - domain to be serviced */
+    ioservid_t id; /* IN - server id */
+};
+typedef struct xen_hvm_destroy_ioreq_server xen_hvm_destroy_ioreq_server_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_destroy_ioreq_server_t);
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/hvm/ioreq.h b/xen/include/public/hvm/ioreq.h
index f05d130..5b5fedf 100644
--- a/xen/include/public/hvm/ioreq.h
+++ b/xen/include/public/hvm/ioreq.h
@@ -34,13 +34,20 @@
 
 #define IOREQ_TYPE_PIO          0 /* pio */
 #define IOREQ_TYPE_COPY         1 /* mmio ops */
+#define IOREQ_TYPE_PCI_CONFIG   2
 #define IOREQ_TYPE_TIMEOFFSET   7
 #define IOREQ_TYPE_INVALIDATE   8 /* mapcache */
 
 /*
  * VMExit dispatcher should cooperate with instruction decoder to
  * prepare this structure and notify service OS and DM by sending
- * virq
+ * virq.
+ *
+ * For I/O type IOREQ_TYPE_PCI_CONFIG, the physical address is formatted
+ * as follows:
+ * 
+ * 63....48|47..40|39..35|34..32|31........0
+ * SEGMENT |BUS   |DEV   |FN    |OFFSET
  */
 struct ioreq {
     uint64_t addr;          /* physical address */
diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
index 517a184..f830bdd 100644
--- a/xen/include/public/hvm/params.h
+++ b/xen/include/public/hvm/params.h
@@ -145,6 +145,9 @@
 /* SHUTDOWN_* action in case of a triple fault */
 #define HVM_PARAM_TRIPLE_FAULT_REASON 31
 
-#define HVM_NR_PARAMS          32
+#define HVM_PARAM_IOREQ_SERVER_PFN 32
+#define HVM_PARAM_NR_IOREQ_SERVER_PAGES 33
+
+#define HVM_NR_PARAMS          34
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff --git a/xen/include/xen/list.h b/xen/include/xen/list.h
index 792eda3..88dc7eb 100644
--- a/xen/include/xen/list.h
+++ b/xen/include/xen/list.h
@@ -304,6 +304,15 @@ static inline int list_empty(const struct list_head *head)
 }
 
 /**
+ * list_is_singular - tests whether a list has exactly one entry
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+    return !list_empty(head) && (head->next == head->prev);
+}
+
+/**
  * list_empty_careful - tests whether a list is empty and not being modified
  * @head: the list to test
  *
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 3d4067f..c5aa316 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -544,6 +544,12 @@ static XSM_INLINE int xsm_hvm_inject_msi(XSM_DEFAULT_ARG struct domain *d)
     return xsm_default_action(action, current->domain, d);
 }
 
+static XSM_INLINE int xsm_hvm_ioreq_server(XSM_DEFAULT_ARG struct domain *d, int op)
+{
+    XSM_ASSERT_ACTION(XSM_DM_PRIV);
+    return xsm_default_action(action, current->domain, d);
+}
+
 static XSM_INLINE int xsm_mem_event_control(XSM_DEFAULT_ARG struct domain *d, int mode, int op)
 {
     XSM_ASSERT_ACTION(XSM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index 4799b08..a85045d 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -147,6 +147,7 @@ struct xsm_operations {
     int (*hvm_set_isa_irq_level) (struct domain *d);
     int (*hvm_set_pci_link_route) (struct domain *d);
     int (*hvm_inject_msi) (struct domain *d);
+    int (*hvm_ioreq_server) (struct domain *d, int op);
     int (*mem_event_control) (struct domain *d, int mode, int op);
     int (*mem_event_op) (struct domain *d, int op);
     int (*mem_sharing_op) (struct domain *d, struct domain *cd, int op);
@@ -564,6 +565,11 @@ static inline int xsm_hvm_inject_msi (xsm_default_t def, struct domain *d)
     return xsm_ops->hvm_inject_msi(d);
 }
 
+static inline int xsm_hvm_ioreq_server (xsm_default_t def, struct domain *d, int op)
+{
+    return xsm_ops->hvm_ioreq_server(d, op);
+}
+
 static inline int xsm_mem_event_control (xsm_default_t def, struct domain *d, int mode, int op)
 {
     return xsm_ops->mem_event_control(d, mode, op);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index 67bce4b..c95c803 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -124,6 +124,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
     set_to_dummy_if_null(ops, hvm_set_isa_irq_level);
     set_to_dummy_if_null(ops, hvm_set_pci_link_route);
     set_to_dummy_if_null(ops, hvm_inject_msi);
+    set_to_dummy_if_null(ops, hvm_ioreq_server);
     set_to_dummy_if_null(ops, mem_event_control);
     set_to_dummy_if_null(ops, mem_event_op);
     set_to_dummy_if_null(ops, mem_sharing_op);
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index c008398..f2f59ea 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1286,6 +1286,11 @@ static int flask_hvm_inject_msi(struct domain *d)
     return current_has_perm(d, SECCLASS_HVM, HVM__SEND_IRQ);
 }
 
+static int flask_hvm_ioreq_server(struct domain *d, int op)
+{
+    return current_has_perm(d, SECCLASS_HVM, HVM__HVMCTL);
+}
+
 static int flask_mem_event_control(struct domain *d, int mode, int op)
 {
     return current_has_perm(d, SECCLASS_HVM, HVM__MEM_EVENT);
@@ -1569,6 +1574,7 @@ static struct xsm_operations flask_ops = {
     .hvm_set_isa_irq_level = flask_hvm_set_isa_irq_level,
     .hvm_set_pci_link_route = flask_hvm_set_pci_link_route,
     .hvm_inject_msi = flask_hvm_inject_msi,
+    .hvm_ioreq_server = flask_hvm_ioreq_server,
     .mem_event_control = flask_mem_event_control,
     .mem_event_op = flask_mem_event_op,
     .mem_sharing_op = flask_mem_sharing_op,
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU2L-0000N8-EE; Thu, 19 Jun 2014 04:33:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2J-0000Mu-Sr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:20 +0000
Received: from [85.158.143.35:47420] by server-2.bemta-4.messagelabs.com id
	53/3C-06539-F0862A35; Thu, 19 Jun 2014 04:33:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1403152397!12342732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3433 invoked from network); 19 Jun 2014 04:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2G-0002PQ-SC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2G-0007LV-PK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:16 +0000
Date: Thu, 19 Jun 2014 04:33:16 +0000
Message-Id: <E1WxU2G-0007LV-PK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ioreq-server: remove p2m entries when
	server is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85a787c97be0b80e429cd7cbba8448ebb9244aa5
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon Jun 2 10:01:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:01:27 2014 +0200

    ioreq-server: remove p2m entries when server is enabled
    
    For secondary servers, add a hvm op to enable/disable the server. The
    server will not accept IO until it is enabled and the act of enabling
    the server removes its pages from the guest p2m, thus preventing the guest
    from directly mapping the pages and synthesizing ioreqs.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_domain.c          |   27 +++++++
 tools/libxc/xenctrl.h            |   18 +++++
 xen/arch/x86/hvm/hvm.c           |  151 +++++++++++++++++++++++++++++++++++++-
 xen/include/asm-x86/hvm/domain.h |    1 +
 xen/include/public/hvm/hvm_op.h  |   19 +++++
 5 files changed, 215 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index a8c9f81..17a8417 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1508,6 +1508,33 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
     return rc;
 }
 
+int xc_hvm_set_ioreq_server_state(xc_interface *xch,
+                                  domid_t domid,
+                                  ioservid_t id,
+                                  int enabled)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_set_ioreq_server_state_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_set_ioreq_server_state;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->enabled = !!enabled;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
 int xc_domain_setdebugging(xc_interface *xch,
                            uint32_t domid,
                            unsigned int enable)
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 3260a56..2045084 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1829,6 +1829,24 @@ int xc_hvm_get_ioreq_server_info(xc_interface *xch,
                                  evtchn_port_t *bufioreq_port);
 
 /**
+ * This function sets IOREQ Server state. An IOREQ Server
+ * will not be passed emulation requests until it is in
+ * the enabled state.
+ * Note that the contents of the ioreq_pfn and bufioreq_pfn are
+ * not meaningful until the IOREQ Server is in the enabled state.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm enabled the state.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_set_ioreq_server_state(xc_interface *xch,
+                                  domid_t domid,
+                                  ioservid_t id,
+                                  int enabled);
+
+/**
  * This function registers a range of memory or I/O ports for emulation.
  *
  * @parm xch a handle to an open hypervisor interface.
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6020ea8..3a30071 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -554,6 +554,22 @@ static int hvm_map_ioreq_page(
     return 0;
 }
 
+static void hvm_remove_ioreq_gmfn(
+    struct domain *d, struct hvm_ioreq_page *iorp)
+{
+    guest_physmap_remove_page(d, iorp->gmfn, 
+                              page_to_mfn(iorp->page), 0);
+    clear_page(iorp->va);
+}
+
+static int hvm_add_ioreq_gmfn(
+    struct domain *d, struct hvm_ioreq_page *iorp)
+{
+    clear_page(iorp->va);
+    return guest_physmap_add_page(d, iorp->gmfn,
+                                  page_to_mfn(iorp->page), 0);
+}
+
 static int hvm_print_line(
     int dir, uint32_t port, uint32_t bytes, uint32_t *val)
 {
@@ -657,7 +673,8 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
 
     list_add(&sv->list_entry, &s->ioreq_vcpu_list);
 
-    hvm_update_ioreq_evtchn(s, sv);
+    if ( s->enabled )
+        hvm_update_ioreq_evtchn(s, sv);
 
     spin_unlock(&s->lock);
     return 0;
@@ -845,6 +862,56 @@ static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s,
         rangeset_destroy(s->range[i]);
 }
 
+static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
+                                    bool_t is_default)
+{
+    struct domain *d = s->domain;
+    struct hvm_ioreq_vcpu *sv;
+
+    spin_lock(&s->lock);
+
+    if ( s->enabled )
+        goto done;
+
+    if ( !is_default )
+    {
+        hvm_remove_ioreq_gmfn(d, &s->ioreq);
+        hvm_remove_ioreq_gmfn(d, &s->bufioreq);
+    }
+
+    s->enabled = 1;
+
+    list_for_each_entry ( sv,
+                          &s->ioreq_vcpu_list,
+                          list_entry )
+        hvm_update_ioreq_evtchn(s, sv);
+
+  done:
+    spin_unlock(&s->lock);
+}
+
+static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
+                                    bool_t is_default)
+{
+    struct domain *d = s->domain;
+
+    spin_lock(&s->lock);
+
+    if ( !s->enabled )
+        goto done;
+
+    if ( !is_default )
+    {
+        hvm_add_ioreq_gmfn(d, &s->bufioreq);
+        hvm_add_ioreq_gmfn(d, &s->ioreq);
+    }
+
+    s->enabled = 0;
+
+ done:
+    spin_unlock(&s->lock);
+}
+
 static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
                                  domid_t domid, bool_t is_default,
                                  ioservid_t id)
@@ -950,7 +1017,10 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
              &d->arch.hvm_domain.ioreq_server.list);
 
     if ( is_default )
+    {
         d->arch.hvm_domain.default_ioreq_server = s;
+        hvm_ioreq_server_enable(s, 1);
+    }
 
     if ( id )
         *id = s->id;
@@ -1143,6 +1213,45 @@ static int hvm_unmap_io_range_from_ioreq_server(struct domain *d, ioservid_t id,
     return rc;
 }
 
+static int hvm_set_ioreq_server_state(struct domain *d, ioservid_t id,
+                                      bool_t enabled)
+{
+    struct list_head *entry;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each ( entry,
+                    &d->arch.hvm_domain.ioreq_server.list )
+    {
+        struct hvm_ioreq_server *s = list_entry(entry,
+                                                struct hvm_ioreq_server,
+                                                list_entry);
+
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id != id )
+            continue;
+
+        domain_pause(d);
+
+        if ( enabled )
+            hvm_ioreq_server_enable(s, 0);
+        else
+            hvm_ioreq_server_disable(s, 0);
+
+        domain_unpause(d);
+
+        rc = 0;
+        break;
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+    return rc;
+}
+
 static int hvm_all_ioreq_servers_add_vcpu(struct domain *d, struct vcpu *v)
 {
     struct hvm_ioreq_server *s;
@@ -1206,7 +1315,10 @@ static void hvm_destroy_all_ioreq_servers(struct domain *d)
         bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
 
         if ( is_default )
+        {
+            hvm_ioreq_server_disable(s, 1);
             d->arch.hvm_domain.default_ioreq_server = NULL;
+        }
 
         list_del(&s->list_entry);
         
@@ -2200,6 +2312,9 @@ static struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
         if ( s == d->arch.hvm_domain.default_ioreq_server )
             continue;
 
+        if ( !s->enabled )
+            continue;
+
         BUILD_BUG_ON(IOREQ_TYPE_PIO != HVMOP_IO_RANGE_PORT);
         BUILD_BUG_ON(IOREQ_TYPE_COPY != HVMOP_IO_RANGE_MEMORY);
         BUILD_BUG_ON(IOREQ_TYPE_PCI_CONFIG != HVMOP_IO_RANGE_PCI);
@@ -5129,6 +5244,35 @@ static int hvmop_unmap_io_range_from_ioreq_server(
     return rc;
 }
 
+static int hvmop_set_ioreq_server_state(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_ioreq_server_state_t) uop)
+{
+    xen_hvm_set_ioreq_server_state_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_set_ioreq_server_state);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_set_ioreq_server_state(d, op.id, !!op.enabled);
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
 static int hvmop_destroy_ioreq_server(
     XEN_GUEST_HANDLE_PARAM(xen_hvm_destroy_ioreq_server_t) uop)
 {
@@ -5188,6 +5332,11 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         rc = hvmop_unmap_io_range_from_ioreq_server(
             guest_handle_cast(arg, xen_hvm_io_range_t));
         break;
+
+    case HVMOP_set_ioreq_server_state:
+        rc = hvmop_set_ioreq_server_state(
+            guest_handle_cast(arg, xen_hvm_set_ioreq_server_state_t));
+        break;
     
     case HVMOP_destroy_ioreq_server:
         rc = hvmop_destroy_ioreq_server(
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index d9ae6d1..291a2e0 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -69,6 +69,7 @@ struct hvm_ioreq_server {
     spinlock_t             bufioreq_lock;
     evtchn_port_t          bufioreq_evtchn;
     struct rangeset        *range[NR_IO_RANGE_TYPES];
+    bool_t                 enabled;
 };
 
 struct hvm_domain {
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index 01863c6..f5d5d22 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -342,6 +342,25 @@ struct xen_hvm_destroy_ioreq_server {
 typedef struct xen_hvm_destroy_ioreq_server xen_hvm_destroy_ioreq_server_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_destroy_ioreq_server_t);
 
+/*
+ * HVMOP_set_ioreq_server_state: Enable or disable the IOREQ Server <id> servicing
+ *                               domain <domid>.
+ *
+ * The IOREQ Server will not be passed any emulation requests until it is in the
+ * enabled state.
+ * Note that the contents of the ioreq_pfn and bufioreq_fn (see
+ * HVMOP_get_ioreq_server_info) are not meaningful until the IOREQ Server is in
+ * the enabled state.
+ */
+#define HVMOP_set_ioreq_server_state 22
+struct xen_hvm_set_ioreq_server_state {
+    domid_t domid;   /* IN - domain to be serviced */
+    ioservid_t id;   /* IN - server id */
+    uint8_t enabled; /* IN - enabled? */    
+};
+typedef struct xen_hvm_set_ioreq_server_state xen_hvm_set_ioreq_server_state_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_ioreq_server_state_t);
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU2L-0000N8-EE; Thu, 19 Jun 2014 04:33:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2J-0000Mu-Sr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:20 +0000
Received: from [85.158.143.35:47420] by server-2.bemta-4.messagelabs.com id
	53/3C-06539-F0862A35; Thu, 19 Jun 2014 04:33:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1403152397!12342732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3433 invoked from network); 19 Jun 2014 04:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2G-0002PQ-SC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2G-0007LV-PK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:16 +0000
Date: Thu, 19 Jun 2014 04:33:16 +0000
Message-Id: <E1WxU2G-0007LV-PK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ioreq-server: remove p2m entries when
	server is enabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 85a787c97be0b80e429cd7cbba8448ebb9244aa5
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon Jun 2 10:01:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:01:27 2014 +0200

    ioreq-server: remove p2m entries when server is enabled
    
    For secondary servers, add a hvm op to enable/disable the server. The
    server will not accept IO until it is enabled and the act of enabling
    the server removes its pages from the guest p2m, thus preventing the guest
    from directly mapping the pages and synthesizing ioreqs.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_domain.c          |   27 +++++++
 tools/libxc/xenctrl.h            |   18 +++++
 xen/arch/x86/hvm/hvm.c           |  151 +++++++++++++++++++++++++++++++++++++-
 xen/include/asm-x86/hvm/domain.h |    1 +
 xen/include/public/hvm/hvm_op.h  |   19 +++++
 5 files changed, 215 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index a8c9f81..17a8417 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1508,6 +1508,33 @@ int xc_hvm_destroy_ioreq_server(xc_interface *xch,
     return rc;
 }
 
+int xc_hvm_set_ioreq_server_state(xc_interface *xch,
+                                  domid_t domid,
+                                  ioservid_t id,
+                                  int enabled)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(xen_hvm_set_ioreq_server_state_t, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+        return -1;
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_set_ioreq_server_state;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = domid;
+    arg->id = id;
+    arg->enabled = !!enabled;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+    return rc;
+}
+
 int xc_domain_setdebugging(xc_interface *xch,
                            uint32_t domid,
                            unsigned int enable)
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 3260a56..2045084 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1829,6 +1829,24 @@ int xc_hvm_get_ioreq_server_info(xc_interface *xch,
                                  evtchn_port_t *bufioreq_port);
 
 /**
+ * This function sets IOREQ Server state. An IOREQ Server
+ * will not be passed emulation requests until it is in
+ * the enabled state.
+ * Note that the contents of the ioreq_pfn and bufioreq_pfn are
+ * not meaningful until the IOREQ Server is in the enabled state.
+ *
+ * @parm xch a handle to an open hypervisor interface.
+ * @parm domid the domain id to be serviced
+ * @parm id the IOREQ Server id.
+ * @parm enabled the state.
+ * @return 0 on success, -1 on failure.
+ */
+int xc_hvm_set_ioreq_server_state(xc_interface *xch,
+                                  domid_t domid,
+                                  ioservid_t id,
+                                  int enabled);
+
+/**
  * This function registers a range of memory or I/O ports for emulation.
  *
  * @parm xch a handle to an open hypervisor interface.
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 6020ea8..3a30071 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -554,6 +554,22 @@ static int hvm_map_ioreq_page(
     return 0;
 }
 
+static void hvm_remove_ioreq_gmfn(
+    struct domain *d, struct hvm_ioreq_page *iorp)
+{
+    guest_physmap_remove_page(d, iorp->gmfn, 
+                              page_to_mfn(iorp->page), 0);
+    clear_page(iorp->va);
+}
+
+static int hvm_add_ioreq_gmfn(
+    struct domain *d, struct hvm_ioreq_page *iorp)
+{
+    clear_page(iorp->va);
+    return guest_physmap_add_page(d, iorp->gmfn,
+                                  page_to_mfn(iorp->page), 0);
+}
+
 static int hvm_print_line(
     int dir, uint32_t port, uint32_t bytes, uint32_t *val)
 {
@@ -657,7 +673,8 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
 
     list_add(&sv->list_entry, &s->ioreq_vcpu_list);
 
-    hvm_update_ioreq_evtchn(s, sv);
+    if ( s->enabled )
+        hvm_update_ioreq_evtchn(s, sv);
 
     spin_unlock(&s->lock);
     return 0;
@@ -845,6 +862,56 @@ static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s,
         rangeset_destroy(s->range[i]);
 }
 
+static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
+                                    bool_t is_default)
+{
+    struct domain *d = s->domain;
+    struct hvm_ioreq_vcpu *sv;
+
+    spin_lock(&s->lock);
+
+    if ( s->enabled )
+        goto done;
+
+    if ( !is_default )
+    {
+        hvm_remove_ioreq_gmfn(d, &s->ioreq);
+        hvm_remove_ioreq_gmfn(d, &s->bufioreq);
+    }
+
+    s->enabled = 1;
+
+    list_for_each_entry ( sv,
+                          &s->ioreq_vcpu_list,
+                          list_entry )
+        hvm_update_ioreq_evtchn(s, sv);
+
+  done:
+    spin_unlock(&s->lock);
+}
+
+static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
+                                    bool_t is_default)
+{
+    struct domain *d = s->domain;
+
+    spin_lock(&s->lock);
+
+    if ( !s->enabled )
+        goto done;
+
+    if ( !is_default )
+    {
+        hvm_add_ioreq_gmfn(d, &s->bufioreq);
+        hvm_add_ioreq_gmfn(d, &s->ioreq);
+    }
+
+    s->enabled = 0;
+
+ done:
+    spin_unlock(&s->lock);
+}
+
 static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
                                  domid_t domid, bool_t is_default,
                                  ioservid_t id)
@@ -950,7 +1017,10 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
              &d->arch.hvm_domain.ioreq_server.list);
 
     if ( is_default )
+    {
         d->arch.hvm_domain.default_ioreq_server = s;
+        hvm_ioreq_server_enable(s, 1);
+    }
 
     if ( id )
         *id = s->id;
@@ -1143,6 +1213,45 @@ static int hvm_unmap_io_range_from_ioreq_server(struct domain *d, ioservid_t id,
     return rc;
 }
 
+static int hvm_set_ioreq_server_state(struct domain *d, ioservid_t id,
+                                      bool_t enabled)
+{
+    struct list_head *entry;
+    int rc;
+
+    spin_lock(&d->arch.hvm_domain.ioreq_server.lock);
+
+    rc = -ENOENT;
+    list_for_each ( entry,
+                    &d->arch.hvm_domain.ioreq_server.list )
+    {
+        struct hvm_ioreq_server *s = list_entry(entry,
+                                                struct hvm_ioreq_server,
+                                                list_entry);
+
+        if ( s == d->arch.hvm_domain.default_ioreq_server )
+            continue;
+
+        if ( s->id != id )
+            continue;
+
+        domain_pause(d);
+
+        if ( enabled )
+            hvm_ioreq_server_enable(s, 0);
+        else
+            hvm_ioreq_server_disable(s, 0);
+
+        domain_unpause(d);
+
+        rc = 0;
+        break;
+    }
+
+    spin_unlock(&d->arch.hvm_domain.ioreq_server.lock);
+    return rc;
+}
+
 static int hvm_all_ioreq_servers_add_vcpu(struct domain *d, struct vcpu *v)
 {
     struct hvm_ioreq_server *s;
@@ -1206,7 +1315,10 @@ static void hvm_destroy_all_ioreq_servers(struct domain *d)
         bool_t is_default = (s == d->arch.hvm_domain.default_ioreq_server);
 
         if ( is_default )
+        {
+            hvm_ioreq_server_disable(s, 1);
             d->arch.hvm_domain.default_ioreq_server = NULL;
+        }
 
         list_del(&s->list_entry);
         
@@ -2200,6 +2312,9 @@ static struct hvm_ioreq_server *hvm_select_ioreq_server(struct domain *d,
         if ( s == d->arch.hvm_domain.default_ioreq_server )
             continue;
 
+        if ( !s->enabled )
+            continue;
+
         BUILD_BUG_ON(IOREQ_TYPE_PIO != HVMOP_IO_RANGE_PORT);
         BUILD_BUG_ON(IOREQ_TYPE_COPY != HVMOP_IO_RANGE_MEMORY);
         BUILD_BUG_ON(IOREQ_TYPE_PCI_CONFIG != HVMOP_IO_RANGE_PCI);
@@ -5129,6 +5244,35 @@ static int hvmop_unmap_io_range_from_ioreq_server(
     return rc;
 }
 
+static int hvmop_set_ioreq_server_state(
+    XEN_GUEST_HANDLE_PARAM(xen_hvm_set_ioreq_server_state_t) uop)
+{
+    xen_hvm_set_ioreq_server_state_t op;
+    struct domain *d;
+    int rc;
+
+    if ( copy_from_guest(&op, uop, 1) )
+        return -EFAULT;
+
+    rc = rcu_lock_remote_domain_by_id(op.domid, &d);
+    if ( rc != 0 )
+        return rc;
+
+    rc = -EINVAL;
+    if ( !is_hvm_domain(d) )
+        goto out;
+
+    rc = xsm_hvm_ioreq_server(XSM_DM_PRIV, d, HVMOP_set_ioreq_server_state);
+    if ( rc != 0 )
+        goto out;
+
+    rc = hvm_set_ioreq_server_state(d, op.id, !!op.enabled);
+
+ out:
+    rcu_unlock_domain(d);
+    return rc;
+}
+
 static int hvmop_destroy_ioreq_server(
     XEN_GUEST_HANDLE_PARAM(xen_hvm_destroy_ioreq_server_t) uop)
 {
@@ -5188,6 +5332,11 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
         rc = hvmop_unmap_io_range_from_ioreq_server(
             guest_handle_cast(arg, xen_hvm_io_range_t));
         break;
+
+    case HVMOP_set_ioreq_server_state:
+        rc = hvmop_set_ioreq_server_state(
+            guest_handle_cast(arg, xen_hvm_set_ioreq_server_state_t));
+        break;
     
     case HVMOP_destroy_ioreq_server:
         rc = hvmop_destroy_ioreq_server(
diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h
index d9ae6d1..291a2e0 100644
--- a/xen/include/asm-x86/hvm/domain.h
+++ b/xen/include/asm-x86/hvm/domain.h
@@ -69,6 +69,7 @@ struct hvm_ioreq_server {
     spinlock_t             bufioreq_lock;
     evtchn_port_t          bufioreq_evtchn;
     struct rangeset        *range[NR_IO_RANGE_TYPES];
+    bool_t                 enabled;
 };
 
 struct hvm_domain {
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index 01863c6..f5d5d22 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -342,6 +342,25 @@ struct xen_hvm_destroy_ioreq_server {
 typedef struct xen_hvm_destroy_ioreq_server xen_hvm_destroy_ioreq_server_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_destroy_ioreq_server_t);
 
+/*
+ * HVMOP_set_ioreq_server_state: Enable or disable the IOREQ Server <id> servicing
+ *                               domain <domid>.
+ *
+ * The IOREQ Server will not be passed any emulation requests until it is in the
+ * enabled state.
+ * Note that the contents of the ioreq_pfn and bufioreq_fn (see
+ * HVMOP_get_ioreq_server_info) are not meaningful until the IOREQ Server is in
+ * the enabled state.
+ */
+#define HVMOP_set_ioreq_server_state 22
+struct xen_hvm_set_ioreq_server_state {
+    domid_t domid;   /* IN - domain to be serviced */
+    ioservid_t id;   /* IN - server id */
+    uint8_t enabled; /* IN - enabled? */    
+};
+typedef struct xen_hvm_set_ioreq_server_state xen_hvm_set_ioreq_server_state_t;
+DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_ioreq_server_state_t);
+
 #endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
 
 #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxU2V-0000Og-H6; Thu, 19 Jun 2014 04:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2U-0000ON-AI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:30 +0000
Received: from [85.158.139.211:48598] by server-4.bemta-5.messagelabs.com id
	C6/CD-07250-91862A35; Thu, 19 Jun 2014 04:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403152407!5471720!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21819 invoked from network); 19 Jun 2014 04:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2R-0002PZ-4q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2R-0007Lr-2I
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:27 +0000
Date: Thu, 19 Jun 2014 04:33:27 +0000
Message-Id: <E1WxU2R-0007Lr-2I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ioreq-server: make buffered ioreq
	handling optional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41b41c0b0d2e1b83929adcc8de703ea0cc2417a6
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon Jun 2 10:02:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:02:25 2014 +0200

    ioreq-server: make buffered ioreq handling optional
    
    Some emulators will only register regions that require non-buffered
    access. (In practice the only region that a guest uses buffered access
    for today is the VGA aperture from 0xa0000-0xbffff). This patch therefore
    makes allocation of the buffered ioreq page and event channel optional for
    secondary ioreq servers.
    
    If a guest attempts buffered access to an ioreq server that does not
    support it, the access will be handled via the normal synchronous path.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_domain.c         |    2 +
 tools/libxc/xenctrl.h           |    2 +
 xen/arch/x86/hvm/hvm.c          |   78 +++++++++++++++++++++++++++-----------
 xen/include/public/hvm/hvm_op.h |   24 +++++++----
 4 files changed, 74 insertions(+), 32 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 17a8417..37ed141 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1286,6 +1286,7 @@ int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long
 
 int xc_hvm_create_ioreq_server(xc_interface *xch,
                                domid_t domid,
+                               int handle_bufioreq,
                                ioservid_t *id)
 {
     DECLARE_HYPERCALL;
@@ -1301,6 +1302,7 @@ int xc_hvm_create_ioreq_server(xc_interface *xch,
     hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
 
     arg->domid = domid;
+    arg->handle_bufioreq = !!handle_bufioreq;
 
     rc = do_xen_hypercall(xch, &hypercall);
 
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 2045084..400f0df 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1802,11 +1802,13 @@ int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long
  *
  * @parm xch a handle to an open hypervisor interface.
  * @parm domid the domain id to be serviced
+ * @parm handle_bufioreq should the IOREQ Server handle buffered requests?
  * @parm id pointer to an ioservid_t to receive the IOREQ Server id.
  * @return 0 on success, -1 on failure.
  */
 int xc_hvm_create_ioreq_server(xc_interface *xch,
                                domid_t domid,
+                               int handle_bufioreq,
                                ioservid_t *id);
 
 /**
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3a30071..59836a1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -655,7 +655,7 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
 
     sv->ioreq_evtchn = rc;
 
-    if ( v->vcpu_id == 0 )
+    if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
     {
         struct domain *d = s->domain;
 
@@ -706,7 +706,7 @@ static void hvm_ioreq_server_remove_vcpu(struct hvm_ioreq_server *s,
 
         list_del(&sv->list_entry);
 
-        if ( v->vcpu_id == 0 )
+        if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
             free_xen_event_channel(v, s->bufioreq_evtchn);
 
         free_xen_event_channel(v, sv->ioreq_evtchn);
@@ -733,7 +733,7 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
 
         list_del(&sv->list_entry);
 
-        if ( v->vcpu_id == 0 )
+        if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
             free_xen_event_channel(v, s->bufioreq_evtchn);
 
         free_xen_event_channel(v, sv->ioreq_evtchn);
@@ -745,7 +745,7 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
 }
 
 static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
-                                      bool_t is_default)
+                                      bool_t is_default, bool_t handle_bufioreq)
 {
     struct domain *d = s->domain;
     unsigned long ioreq_pfn, bufioreq_pfn;
@@ -754,6 +754,12 @@ static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
     if ( is_default )
     {
         ioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_IOREQ_PFN];
+
+        /*
+         * The default ioreq server must handle buffered ioreqs, for
+         * backwards compatibility.
+         */
+        ASSERT(handle_bufioreq);
         bufioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_PFN];
     }
     else
@@ -762,18 +768,24 @@ static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
         if ( rc )
             goto fail1;
 
-        rc = hvm_alloc_ioreq_gmfn(d, &bufioreq_pfn);
-        if ( rc )
-            goto fail2;
+        if ( handle_bufioreq )
+        {
+            rc = hvm_alloc_ioreq_gmfn(d, &bufioreq_pfn);
+            if ( rc )
+                goto fail2;
+        }
     }
 
     rc = hvm_map_ioreq_page(s, 0, ioreq_pfn);
     if ( rc )
         goto fail3;
 
-    rc = hvm_map_ioreq_page(s, 1, bufioreq_pfn);
-    if ( rc )
-        goto fail4;
+    if ( handle_bufioreq )
+    {
+        rc = hvm_map_ioreq_page(s, 1, bufioreq_pfn);
+        if ( rc )
+            goto fail4;
+    }
 
     return 0;
 
@@ -781,7 +793,7 @@ fail4:
     hvm_unmap_ioreq_page(s, 0);
 
 fail3:
-    if ( !is_default )
+    if ( !is_default && handle_bufioreq )
         hvm_free_ioreq_gmfn(d, bufioreq_pfn);
 
 fail2:
@@ -796,13 +808,18 @@ static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s,
                                          bool_t is_default)
 {
     struct domain *d = s->domain;
+    bool_t handle_bufioreq = ( s->bufioreq.va != NULL );
+
+    if ( handle_bufioreq )
+        hvm_unmap_ioreq_page(s, 1);
 
-    hvm_unmap_ioreq_page(s, 1);
     hvm_unmap_ioreq_page(s, 0);
 
     if ( !is_default )
     {
-        hvm_free_ioreq_gmfn(d, s->bufioreq.gmfn);
+        if ( handle_bufioreq )
+            hvm_free_ioreq_gmfn(d, s->bufioreq.gmfn);
+
         hvm_free_ioreq_gmfn(d, s->ioreq.gmfn);
     }
 }
@@ -867,6 +884,7 @@ static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
 {
     struct domain *d = s->domain;
     struct hvm_ioreq_vcpu *sv;
+    bool_t handle_bufioreq = ( s->bufioreq.va != NULL );
 
     spin_lock(&s->lock);
 
@@ -876,7 +894,9 @@ static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
     if ( !is_default )
     {
         hvm_remove_ioreq_gmfn(d, &s->ioreq);
-        hvm_remove_ioreq_gmfn(d, &s->bufioreq);
+
+        if ( handle_bufioreq )
+            hvm_remove_ioreq_gmfn(d, &s->bufioreq);
     }
 
     s->enabled = 1;
@@ -894,6 +914,7 @@ static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
                                     bool_t is_default)
 {
     struct domain *d = s->domain;
+    bool_t handle_bufioreq = ( s->bufioreq.va != NULL );
 
     spin_lock(&s->lock);
 
@@ -902,7 +923,9 @@ static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
 
     if ( !is_default )
     {
-        hvm_add_ioreq_gmfn(d, &s->bufioreq);
+        if ( handle_bufioreq )
+            hvm_add_ioreq_gmfn(d, &s->bufioreq);
+
         hvm_add_ioreq_gmfn(d, &s->ioreq);
     }
 
@@ -914,7 +937,7 @@ static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
 
 static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
                                  domid_t domid, bool_t is_default,
-                                 ioservid_t id)
+                                 bool_t handle_bufioreq, ioservid_t id)
 {
     struct vcpu *v;
     int rc;
@@ -931,7 +954,7 @@ static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
     if ( rc )
         goto fail1;
 
-    rc = hvm_ioreq_server_map_pages(s, is_default);
+    rc = hvm_ioreq_server_map_pages(s, is_default, handle_bufioreq);
     if ( rc )
         goto fail2;
 
@@ -991,7 +1014,8 @@ static ioservid_t next_ioservid(struct domain *d)
 }
 
 static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
-                                   bool_t is_default, ioservid_t *id)
+                                   bool_t is_default, bool_t handle_bufioreq,
+                                   ioservid_t *id)
 {
     struct hvm_ioreq_server *s;
     int rc;
@@ -1008,7 +1032,7 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
     if ( is_default && d->arch.hvm_domain.default_ioreq_server != NULL )
         goto fail2;
 
-    rc = hvm_ioreq_server_init(s, d, domid, is_default,
+    rc = hvm_ioreq_server_init(s, d, domid, is_default, handle_bufioreq,
                                next_ioservid(d));
     if ( rc )
         goto fail3;
@@ -1099,8 +1123,12 @@ static int hvm_get_ioreq_server_info(struct domain *d, ioservid_t id,
             continue;
 
         *ioreq_pfn = s->ioreq.gmfn;
-        *bufioreq_pfn = s->bufioreq.gmfn;
-        *bufioreq_port = s->bufioreq_evtchn;
+
+        if ( s->bufioreq.va != NULL )
+        {
+            *bufioreq_pfn = s->bufioreq.gmfn;
+            *bufioreq_port = s->bufioreq_evtchn;
+        }
 
         rc = 0;
         break;
@@ -2378,6 +2406,9 @@ int hvm_buffered_io_send(ioreq_t *p)
     iorp = &s->bufioreq;
     pg = iorp->va;
 
+    if ( !pg )
+        return 0;
+
     /*
      * Return 0 for the cases we can't deal with:
      *  - 'addr' is only a 20-bit field, so we cannot address beyond 1MB
@@ -5137,7 +5168,8 @@ static int hvmop_create_ioreq_server(
     if ( rc != 0 )
         goto out;
 
-    rc = hvm_create_ioreq_server(d, curr_d->domain_id, 0, &op.id);
+    rc = hvm_create_ioreq_server(d, curr_d->domain_id, 0,
+                                 !!op.handle_bufioreq, &op.id);
     if ( rc != 0 )
         goto out;
 
@@ -5571,7 +5603,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 
                 /* May need to create server */
                 domid = d->arch.hvm_domain.params[HVM_PARAM_DM_DOMAIN];
-                rc = hvm_create_ioreq_server(d, domid, 1, NULL);
+                rc = hvm_create_ioreq_server(d, domid, 1, 1, NULL);
                 if ( rc != 0 && rc != -EEXIST )
                     goto param_fail;
                 /*FALLTHRU*/
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index f5d5d22..eeb0a60 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -258,12 +258,15 @@ typedef uint16_t ioservid_t;
  * HVMOP_create_ioreq_server: Instantiate a new IOREQ Server for a secondary
  *                            emulator servicing domain <domid>.
  *
- * The <id> handed back is unique for <domid>.
+ * The <id> handed back is unique for <domid>. If <handle_bufioreq> is zero
+ * the buffered ioreq ring will not be allocated and hence all emulation
+ * requestes to this server will be synchronous.
  */
 #define HVMOP_create_ioreq_server 17
 struct xen_hvm_create_ioreq_server {
-    domid_t domid; /* IN - domain to be serviced */
-    ioservid_t id; /* OUT - server id */
+    domid_t domid;           /* IN - domain to be serviced */
+    uint8_t handle_bufioreq; /* IN - should server handle buffered ioreqs */
+    ioservid_t id;           /* OUT - server id */
 };
 typedef struct xen_hvm_create_ioreq_server xen_hvm_create_ioreq_server_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
@@ -273,12 +276,15 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
  *                              IOREQ Server <id>. 
  *
  * The emulator needs to map the synchronous ioreq structures and buffered
- * ioreq ring that Xen uses to request emulation. These are hosted in domain
- * <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn> respectively. In addition the
- * emulator needs to bind to event channel <bufioreq_port> to listen for
- * buffered emulation requests. (The event channels used for synchronous
- * emulation requests are specified in the per-CPU ioreq structures in
- * <ioreq_pfn>).
+ * ioreq ring (if it exists) that Xen uses to request emulation. These are
+ * hosted in domain <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn>
+ * respectively. In addition, if the IOREQ Server is handling buffered
+ * emulation requests, the emulator needs to bind to event channel
+ * <bufioreq_port> to listen for them. (The event channels used for
+ * synchronous emulation requests are specified in the per-CPU ioreq
+ * structures in <ioreq_pfn>).
+ * If the IOREQ Server is not handling buffered emulation requests then the
+ * values handed back in <bufioreq_pfn> and <bufioreq_port> will both be 0.
  */
 #define HVMOP_get_ioreq_server_info 18
 struct xen_hvm_get_ioreq_server_info {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxU2V-0000Og-H6; Thu, 19 Jun 2014 04:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2U-0000ON-AI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:30 +0000
Received: from [85.158.139.211:48598] by server-4.bemta-5.messagelabs.com id
	C6/CD-07250-91862A35; Thu, 19 Jun 2014 04:33:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403152407!5471720!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21819 invoked from network); 19 Jun 2014 04:33:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2R-0002PZ-4q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2R-0007Lr-2I
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:27 +0000
Date: Thu, 19 Jun 2014 04:33:27 +0000
Message-Id: <E1WxU2R-0007Lr-2I@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ioreq-server: make buffered ioreq
	handling optional
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 41b41c0b0d2e1b83929adcc8de703ea0cc2417a6
Author:     Paul Durrant <paul.durrant@citrix.com>
AuthorDate: Mon Jun 2 10:02:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:02:25 2014 +0200

    ioreq-server: make buffered ioreq handling optional
    
    Some emulators will only register regions that require non-buffered
    access. (In practice the only region that a guest uses buffered access
    for today is the VGA aperture from 0xa0000-0xbffff). This patch therefore
    makes allocation of the buffered ioreq page and event channel optional for
    secondary ioreq servers.
    
    If a guest attempts buffered access to an ioreq server that does not
    support it, the access will be handled via the normal synchronous path.
    
    Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_domain.c         |    2 +
 tools/libxc/xenctrl.h           |    2 +
 xen/arch/x86/hvm/hvm.c          |   78 +++++++++++++++++++++++++++-----------
 xen/include/public/hvm/hvm_op.h |   24 +++++++----
 4 files changed, 74 insertions(+), 32 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 17a8417..37ed141 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1286,6 +1286,7 @@ int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long
 
 int xc_hvm_create_ioreq_server(xc_interface *xch,
                                domid_t domid,
+                               int handle_bufioreq,
                                ioservid_t *id)
 {
     DECLARE_HYPERCALL;
@@ -1301,6 +1302,7 @@ int xc_hvm_create_ioreq_server(xc_interface *xch,
     hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
 
     arg->domid = domid;
+    arg->handle_bufioreq = !!handle_bufioreq;
 
     rc = do_xen_hypercall(xch, &hypercall);
 
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 2045084..400f0df 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -1802,11 +1802,13 @@ int xc_get_hvm_param(xc_interface *handle, domid_t dom, int param, unsigned long
  *
  * @parm xch a handle to an open hypervisor interface.
  * @parm domid the domain id to be serviced
+ * @parm handle_bufioreq should the IOREQ Server handle buffered requests?
  * @parm id pointer to an ioservid_t to receive the IOREQ Server id.
  * @return 0 on success, -1 on failure.
  */
 int xc_hvm_create_ioreq_server(xc_interface *xch,
                                domid_t domid,
+                               int handle_bufioreq,
                                ioservid_t *id);
 
 /**
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 3a30071..59836a1 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -655,7 +655,7 @@ static int hvm_ioreq_server_add_vcpu(struct hvm_ioreq_server *s,
 
     sv->ioreq_evtchn = rc;
 
-    if ( v->vcpu_id == 0 )
+    if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
     {
         struct domain *d = s->domain;
 
@@ -706,7 +706,7 @@ static void hvm_ioreq_server_remove_vcpu(struct hvm_ioreq_server *s,
 
         list_del(&sv->list_entry);
 
-        if ( v->vcpu_id == 0 )
+        if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
             free_xen_event_channel(v, s->bufioreq_evtchn);
 
         free_xen_event_channel(v, sv->ioreq_evtchn);
@@ -733,7 +733,7 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
 
         list_del(&sv->list_entry);
 
-        if ( v->vcpu_id == 0 )
+        if ( v->vcpu_id == 0 && s->bufioreq.va != NULL )
             free_xen_event_channel(v, s->bufioreq_evtchn);
 
         free_xen_event_channel(v, sv->ioreq_evtchn);
@@ -745,7 +745,7 @@ static void hvm_ioreq_server_remove_all_vcpus(struct hvm_ioreq_server *s)
 }
 
 static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
-                                      bool_t is_default)
+                                      bool_t is_default, bool_t handle_bufioreq)
 {
     struct domain *d = s->domain;
     unsigned long ioreq_pfn, bufioreq_pfn;
@@ -754,6 +754,12 @@ static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
     if ( is_default )
     {
         ioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_IOREQ_PFN];
+
+        /*
+         * The default ioreq server must handle buffered ioreqs, for
+         * backwards compatibility.
+         */
+        ASSERT(handle_bufioreq);
         bufioreq_pfn = d->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_PFN];
     }
     else
@@ -762,18 +768,24 @@ static int hvm_ioreq_server_map_pages(struct hvm_ioreq_server *s,
         if ( rc )
             goto fail1;
 
-        rc = hvm_alloc_ioreq_gmfn(d, &bufioreq_pfn);
-        if ( rc )
-            goto fail2;
+        if ( handle_bufioreq )
+        {
+            rc = hvm_alloc_ioreq_gmfn(d, &bufioreq_pfn);
+            if ( rc )
+                goto fail2;
+        }
     }
 
     rc = hvm_map_ioreq_page(s, 0, ioreq_pfn);
     if ( rc )
         goto fail3;
 
-    rc = hvm_map_ioreq_page(s, 1, bufioreq_pfn);
-    if ( rc )
-        goto fail4;
+    if ( handle_bufioreq )
+    {
+        rc = hvm_map_ioreq_page(s, 1, bufioreq_pfn);
+        if ( rc )
+            goto fail4;
+    }
 
     return 0;
 
@@ -781,7 +793,7 @@ fail4:
     hvm_unmap_ioreq_page(s, 0);
 
 fail3:
-    if ( !is_default )
+    if ( !is_default && handle_bufioreq )
         hvm_free_ioreq_gmfn(d, bufioreq_pfn);
 
 fail2:
@@ -796,13 +808,18 @@ static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s,
                                          bool_t is_default)
 {
     struct domain *d = s->domain;
+    bool_t handle_bufioreq = ( s->bufioreq.va != NULL );
+
+    if ( handle_bufioreq )
+        hvm_unmap_ioreq_page(s, 1);
 
-    hvm_unmap_ioreq_page(s, 1);
     hvm_unmap_ioreq_page(s, 0);
 
     if ( !is_default )
     {
-        hvm_free_ioreq_gmfn(d, s->bufioreq.gmfn);
+        if ( handle_bufioreq )
+            hvm_free_ioreq_gmfn(d, s->bufioreq.gmfn);
+
         hvm_free_ioreq_gmfn(d, s->ioreq.gmfn);
     }
 }
@@ -867,6 +884,7 @@ static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
 {
     struct domain *d = s->domain;
     struct hvm_ioreq_vcpu *sv;
+    bool_t handle_bufioreq = ( s->bufioreq.va != NULL );
 
     spin_lock(&s->lock);
 
@@ -876,7 +894,9 @@ static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
     if ( !is_default )
     {
         hvm_remove_ioreq_gmfn(d, &s->ioreq);
-        hvm_remove_ioreq_gmfn(d, &s->bufioreq);
+
+        if ( handle_bufioreq )
+            hvm_remove_ioreq_gmfn(d, &s->bufioreq);
     }
 
     s->enabled = 1;
@@ -894,6 +914,7 @@ static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
                                     bool_t is_default)
 {
     struct domain *d = s->domain;
+    bool_t handle_bufioreq = ( s->bufioreq.va != NULL );
 
     spin_lock(&s->lock);
 
@@ -902,7 +923,9 @@ static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
 
     if ( !is_default )
     {
-        hvm_add_ioreq_gmfn(d, &s->bufioreq);
+        if ( handle_bufioreq )
+            hvm_add_ioreq_gmfn(d, &s->bufioreq);
+
         hvm_add_ioreq_gmfn(d, &s->ioreq);
     }
 
@@ -914,7 +937,7 @@ static void hvm_ioreq_server_disable(struct hvm_ioreq_server *s,
 
 static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
                                  domid_t domid, bool_t is_default,
-                                 ioservid_t id)
+                                 bool_t handle_bufioreq, ioservid_t id)
 {
     struct vcpu *v;
     int rc;
@@ -931,7 +954,7 @@ static int hvm_ioreq_server_init(struct hvm_ioreq_server *s, struct domain *d,
     if ( rc )
         goto fail1;
 
-    rc = hvm_ioreq_server_map_pages(s, is_default);
+    rc = hvm_ioreq_server_map_pages(s, is_default, handle_bufioreq);
     if ( rc )
         goto fail2;
 
@@ -991,7 +1014,8 @@ static ioservid_t next_ioservid(struct domain *d)
 }
 
 static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
-                                   bool_t is_default, ioservid_t *id)
+                                   bool_t is_default, bool_t handle_bufioreq,
+                                   ioservid_t *id)
 {
     struct hvm_ioreq_server *s;
     int rc;
@@ -1008,7 +1032,7 @@ static int hvm_create_ioreq_server(struct domain *d, domid_t domid,
     if ( is_default && d->arch.hvm_domain.default_ioreq_server != NULL )
         goto fail2;
 
-    rc = hvm_ioreq_server_init(s, d, domid, is_default,
+    rc = hvm_ioreq_server_init(s, d, domid, is_default, handle_bufioreq,
                                next_ioservid(d));
     if ( rc )
         goto fail3;
@@ -1099,8 +1123,12 @@ static int hvm_get_ioreq_server_info(struct domain *d, ioservid_t id,
             continue;
 
         *ioreq_pfn = s->ioreq.gmfn;
-        *bufioreq_pfn = s->bufioreq.gmfn;
-        *bufioreq_port = s->bufioreq_evtchn;
+
+        if ( s->bufioreq.va != NULL )
+        {
+            *bufioreq_pfn = s->bufioreq.gmfn;
+            *bufioreq_port = s->bufioreq_evtchn;
+        }
 
         rc = 0;
         break;
@@ -2378,6 +2406,9 @@ int hvm_buffered_io_send(ioreq_t *p)
     iorp = &s->bufioreq;
     pg = iorp->va;
 
+    if ( !pg )
+        return 0;
+
     /*
      * Return 0 for the cases we can't deal with:
      *  - 'addr' is only a 20-bit field, so we cannot address beyond 1MB
@@ -5137,7 +5168,8 @@ static int hvmop_create_ioreq_server(
     if ( rc != 0 )
         goto out;
 
-    rc = hvm_create_ioreq_server(d, curr_d->domain_id, 0, &op.id);
+    rc = hvm_create_ioreq_server(d, curr_d->domain_id, 0,
+                                 !!op.handle_bufioreq, &op.id);
     if ( rc != 0 )
         goto out;
 
@@ -5571,7 +5603,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PARAM(void) arg)
                 
                 /* May need to create server */
                 domid = d->arch.hvm_domain.params[HVM_PARAM_DM_DOMAIN];
-                rc = hvm_create_ioreq_server(d, domid, 1, NULL);
+                rc = hvm_create_ioreq_server(d, domid, 1, 1, NULL);
                 if ( rc != 0 && rc != -EEXIST )
                     goto param_fail;
                 /*FALLTHRU*/
diff --git a/xen/include/public/hvm/hvm_op.h b/xen/include/public/hvm/hvm_op.h
index f5d5d22..eeb0a60 100644
--- a/xen/include/public/hvm/hvm_op.h
+++ b/xen/include/public/hvm/hvm_op.h
@@ -258,12 +258,15 @@ typedef uint16_t ioservid_t;
  * HVMOP_create_ioreq_server: Instantiate a new IOREQ Server for a secondary
  *                            emulator servicing domain <domid>.
  *
- * The <id> handed back is unique for <domid>.
+ * The <id> handed back is unique for <domid>. If <handle_bufioreq> is zero
+ * the buffered ioreq ring will not be allocated and hence all emulation
+ * requestes to this server will be synchronous.
  */
 #define HVMOP_create_ioreq_server 17
 struct xen_hvm_create_ioreq_server {
-    domid_t domid; /* IN - domain to be serviced */
-    ioservid_t id; /* OUT - server id */
+    domid_t domid;           /* IN - domain to be serviced */
+    uint8_t handle_bufioreq; /* IN - should server handle buffered ioreqs */
+    ioservid_t id;           /* OUT - server id */
 };
 typedef struct xen_hvm_create_ioreq_server xen_hvm_create_ioreq_server_t;
 DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
@@ -273,12 +276,15 @@ DEFINE_XEN_GUEST_HANDLE(xen_hvm_create_ioreq_server_t);
  *                              IOREQ Server <id>. 
  *
  * The emulator needs to map the synchronous ioreq structures and buffered
- * ioreq ring that Xen uses to request emulation. These are hosted in domain
- * <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn> respectively. In addition the
- * emulator needs to bind to event channel <bufioreq_port> to listen for
- * buffered emulation requests. (The event channels used for synchronous
- * emulation requests are specified in the per-CPU ioreq structures in
- * <ioreq_pfn>).
+ * ioreq ring (if it exists) that Xen uses to request emulation. These are
+ * hosted in domain <domid>'s gmfns <ioreq_pfn> and <bufioreq_pfn>
+ * respectively. In addition, if the IOREQ Server is handling buffered
+ * emulation requests, the emulator needs to bind to event channel
+ * <bufioreq_port> to listen for them. (The event channels used for
+ * synchronous emulation requests are specified in the per-CPU ioreq
+ * structures in <ioreq_pfn>).
+ * If the IOREQ Server is not handling buffered emulation requests then the
+ * values handed back in <bufioreq_pfn> and <bufioreq_port> will both be 0.
  */
 #define HVMOP_get_ioreq_server_info 18
 struct xen_hvm_get_ioreq_server_info {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxU2g-0000Qd-LO; Thu, 19 Jun 2014 04:33:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2f-0000QL-6Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:41 +0000
Received: from [85.158.137.68:23688] by server-10.bemta-3.messagelabs.com id
	38/0C-09305-42862A35; Thu, 19 Jun 2014 04:33:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403152417!10976653!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9765 invoked from network); 19 Jun 2014 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2b-0002Pf-Jz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2b-0007ME-Ba
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:37 +0000
Date: Thu, 19 Jun 2014 04:33:37 +0000
Message-Id: <E1WxU2b-0007ME-Ba@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86,
	mce: consolidate AMD mcheck initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 518576c6cbdaa2640865f1baa813c1b4d48c469f
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Mon Jun 2 10:18:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:18:07 2014 +0200

    x86,mce: consolidate AMD mcheck initialization
    
    amd_k8.c did a lot of common work and very little K8
    specific work. So merge init functions of amd_f10.c and
    amd_k8.c and move it into the common amd_mcheck_init
    handler. With that done, there is not much left in either
    files, so fold all code into just one file - mce_amd.c
    
    While at it, update the comments regarding documentation
    with correct URL's and revision numbers.
    
    Also, update copyright info.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/Makefile  |    2 -
 xen/arch/x86/cpu/mcheck/amd_f10.c |  118 --------------------------
 xen/arch/x86/cpu/mcheck/amd_k8.c  |  117 --------------------------
 xen/arch/x86/cpu/mcheck/mce_amd.c |  167 +++++++++++++++++++++++++++++++++----
 4 files changed, 151 insertions(+), 253 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/Makefile b/xen/arch/x86/cpu/mcheck/Makefile
index c8cd5f9..0d63ff9 100644
--- a/xen/arch/x86/cpu/mcheck/Makefile
+++ b/xen/arch/x86/cpu/mcheck/Makefile
@@ -1,6 +1,4 @@
 obj-y += amd_nonfatal.o
-obj-y += amd_k8.o
-obj-y += amd_f10.o
 obj-y += mce_amd.o
 obj-y += mcaction.o
 obj-y += barrier.o
diff --git a/xen/arch/x86/cpu/mcheck/amd_f10.c b/xen/arch/x86/cpu/mcheck/amd_f10.c
deleted file mode 100644
index 03797ab..0000000
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * MCA implementation for AMD Family10 CPUs
- * Copyright (c) 2007 Advanced Micro Devices, 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
- */
-
-
-/* K8 common MCA documentation published at
- *
- * AMD64 Architecture Programmer's Manual Volume 2:
- * System Programming
- * Publication # 24593 Revision: 3.12
- * Issue Date: September 2006
- */
-
-/* Family10 MCA documentation published at
- *
- * BIOS and Kernel Developer's Guide
- * For AMD Family 10h Processors
- * Publication # 31116 Revision: 1.08
- * Isse Date: June 10, 2007
- */
-
-
-#include <xen/init.h>
-#include <xen/types.h>
-
-#include <asm/msr.h>
-
-#include "mce.h"
-#include "mce_quirks.h"
-#include "x86_mca.h"
-#include "mce_amd.h"
-#include "mcaction.h"
-
-static struct mcinfo_extended *
-amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
-{
-	struct mcinfo_extended *mc_ext;
-
-	/* Family 0x10 introduced additional MSR that belong to the
-	 * northbridge bank (4). */
-	if (mi == NULL || bank != 4)
-		return NULL;
-
-	if (!(status & MCi_STATUS_VAL))
-		return NULL;
-
-	if (!(status & MCi_STATUS_MISCV))
-		return NULL;
-
-	mc_ext = x86_mcinfo_reserve(mi, sizeof(*mc_ext));
-	if (!mc_ext)
-	{
-		mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
-		return NULL;
-	}
-
-	mc_ext->common.type = MC_TYPE_EXTENDED;
-	mc_ext->common.size = sizeof(*mc_ext);
-	mc_ext->mc_msrs = 3;
-
-	mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1;
-	mc_ext->mc_msr[1].reg = MSR_F10_MC4_MISC2;
-	mc_ext->mc_msr[2].reg = MSR_F10_MC4_MISC3;
-
-	mc_ext->mc_msr[0].value = mca_rdmsr(MSR_F10_MC4_MISC1);
-	mc_ext->mc_msr[1].value = mca_rdmsr(MSR_F10_MC4_MISC2);
-	mc_ext->mc_msr[2].value = mca_rdmsr(MSR_F10_MC4_MISC3);
-
-	return mc_ext;
-}
-
-/* AMD Family10 machine check */
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c)
-{ 
-	enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c);
-
-	if (amd_k8_mcheck_init(c) == mcheck_none)
-		return mcheck_none;
-
-	if (quirkflag == MCEQUIRK_F10_GART)
-		mcequirk_amd_apply(quirkflag);
-
-	x86_mce_callback_register(amd_f10_handler);
-	mce_recoverable_register(mc_amd_recoverable_scan);
-	mce_register_addrcheck(mc_amd_addrcheck);
-
-	return mcheck_amd_famXX;
-}
-
-/* amd specific MCA MSR */
-int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
-{
-    /* Do nothing as we don't emulate this MC bank currently */
-    mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
-    return 1;
-}
-
-int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
-{
-    /* Assign '0' as we don't emulate this MC bank currently */
-    *val = 0;
-    return 1;
-}
diff --git a/xen/arch/x86/cpu/mcheck/amd_k8.c b/xen/arch/x86/cpu/mcheck/amd_k8.c
deleted file mode 100644
index 8ff359c..0000000
--- a/xen/arch/x86/cpu/mcheck/amd_k8.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * MCA implementation for AMD K8 CPUs
- * Copyright (c) 2007 Advanced Micro Devices, 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
- */
-
-
-/* K8 common MCA documentation published at
- *
- * AMD64 Architecture Programmer's Manual Volume 2:
- * System Programming
- * Publication # 24593 Revision: 3.12
- * Issue Date: September 2006
- *
- * URL:
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24593.pdf
- */
-
-/* The related documentation for K8 Revisions A - E is:
- *
- * BIOS and Kernel Developer's Guide for
- * AMD Athlon 64 and AMD Opteron Processors
- * Publication # 26094 Revision: 3.30
- * Issue Date: February 2006
- *
- * URL:
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26094.PDF
- */
-
-/* The related documentation for K8 Revisions F - G is:
- *
- * BIOS and Kernel Developer's Guide for
- * AMD NPT Family 0Fh Processors
- * Publication # 32559 Revision: 3.04
- * Issue Date: December 2006
- *
- * URL:
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
- */
-
-
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/types.h>
-#include <xen/kernel.h>
-#include <xen/smp.h>
-#include <xen/sched.h>
-#include <xen/sched-if.h>
-#include <xen/softirq.h>
-
-#include <asm/processor.h>
-#include <asm/shared.h>
-#include <asm/system.h>
-#include <asm/msr.h>
-
-#include "mce.h"
-#include "mce_quirks.h"
-
-/* Machine Check Handler for AMD K8 family series */
-static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
-{
-	mcheck_cmn_handler(regs, error_code, mca_allbanks,
-			   __get_cpu_var(mce_clear_banks));
-}
-
-static int k8_need_clearbank_scan(enum mca_source who, uint64_t status)
-{
-	if (who != MCA_MCE_SCAN)
-		return 1;
-
-	/*
-	 * For fatal error, it shouldn't be cleared so that sticky bank
-	 * have a chance to be handled after reboot by polling.
-	 */
-	if ((status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC))
-		return 0;
-
-	return 1;
-}
-
-/* AMD K8 machine check */
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c)
-{
-	uint32_t i;
-	enum mcequirk_amd_flags quirkflag;
-
-	quirkflag = mcequirk_lookup_amd_quirkdata(c);
-
-	mce_handler_init();
-	x86_mce_vector_register(k8_machine_check);
-	mce_need_clearbank_register(k8_need_clearbank_scan);
-
-	for (i = 0; i < nr_mce_banks; i++) {
-		if (quirkflag == MCEQUIRK_K8_GART && i == 4) {
-			mcequirk_amd_apply(quirkflag);
-		} else {
-			/* Enable error reporting of all errors */
-			wrmsrl(MSR_IA32_MCx_CTL(i), 0xffffffffffffffffULL);
-			wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
-		}
-	}
-
-	return mcheck_amd_k8;
-}
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 74ee115..d59e21d 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -1,6 +1,6 @@
 /*
  * common MCA implementation for AMD CPUs.
- * Copyright (c) 2012 Advanced Micro Devices, Inc.
+ * Copyright (c) 2012-2014 Advanced Micro Devices, 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
@@ -17,6 +17,50 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+/* K8 common MCA documentation published at
+ *
+ * AMD64 Architecture Programmer's Manual Volume 2:
+ * System Programming
+ * Publication # 24593 Revision: 3.24
+ * Issue Date: October 2013
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/24593.pdf 
+ */
+
+/* The related documentation for K8 Revisions A - E is:
+ *
+ * BIOS and Kernel Developer's Guide for
+ * AMD Athlon 64 and AMD Opteron Processors
+ * Publication # 26094 Revision: 3.30
+ * Issue Date: February 2006
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/26094.PDF 
+ */
+
+/* The related documentation for K8 Revisions F - G is:
+ *
+ * BIOS and Kernel Developer's Guide for
+ * AMD NPT Family 0Fh Processors
+ * Publication # 32559 Revision: 3.08
+ * Issue Date: July 2007
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/32559.pdf 
+ */
+
+/* Family10 MCA documentation published at
+ *
+ * BIOS and Kernel Developer's Guide
+ * For AMD Family 10h Processors
+ * Publication # 31116 Revision: 3.62
+ * Isse Date: January 11, 2013
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/31116.pdf 
+ */
+
 #include <xen/init.h>
 #include <xen/types.h>
 
@@ -27,8 +71,8 @@
 #include "x86_mca.h"
 #include "mce_amd.h"
 #include "mcaction.h"
-
 #include "mce_quirks.h"
+#include "vmce.h"
 
 #define ANY -1
 
@@ -98,7 +142,8 @@ mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
     errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC);
     ectype = mc_ec2type(errorcode);
 
-    switch (ectype) {
+    switch ( ectype )
+    {
     case MC_EC_BUS_TYPE: /* value in addr MSR is physical */
     case MC_EC_MEM_TYPE: /* value in addr MSR is physical */
         return (addrtype == MC_ADDR_PHYSICAL);
@@ -158,24 +203,114 @@ int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
     return 0;
 }
 
+static struct mcinfo_extended *
+amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
+{
+    struct mcinfo_extended *mc_ext;
+
+    /* Family 0x10 introduced additional MSR that belong to the
+     * northbridge bank (4). */
+    if ( mi == NULL || bank != 4 )
+        return NULL;
+
+    if ( !(status & MCi_STATUS_VAL) )
+        return NULL;
+
+    if ( !(status & MCi_STATUS_MISCV) )
+        return NULL;
+
+    mc_ext = x86_mcinfo_reserve(mi, sizeof(*mc_ext));
+    if ( !mc_ext )
+    {
+        mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
+        return NULL;
+    }
+
+    mc_ext->common.type = MC_TYPE_EXTENDED;
+    mc_ext->common.size = sizeof(*mc_ext);
+    mc_ext->mc_msrs = 3;
+
+    mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1;
+    mc_ext->mc_msr[1].reg = MSR_F10_MC4_MISC2;
+    mc_ext->mc_msr[2].reg = MSR_F10_MC4_MISC3;
+
+    mc_ext->mc_msr[0].value = mca_rdmsr(MSR_F10_MC4_MISC1);
+    mc_ext->mc_msr[1].value = mca_rdmsr(MSR_F10_MC4_MISC2);
+    mc_ext->mc_msr[2].value = mca_rdmsr(MSR_F10_MC4_MISC3);
+
+    return mc_ext;
+}
+
+/* Common AMD Machine Check Handler for AMD K8 and higher */
+static void amd_cmn_machine_check(struct cpu_user_regs *regs, long error_code)
+{
+    mcheck_cmn_handler(regs, error_code, mca_allbanks,
+                       __get_cpu_var(mce_clear_banks));
+}
+
+static int amd_need_clearbank_scan(enum mca_source who, uint64_t status)
+{
+    if ( who != MCA_MCE_SCAN )
+        return 1;
+
+    /*
+     * For fatal error, it shouldn't be cleared so that sticky bank
+     * have a chance to be handled after reboot by polling.
+     */
+    if ( (status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC) )
+        return 0;
+
+    return 1;
+}
+
+/* AMD specific MCA MSR */
+int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
+{
+    /* Do nothing as we don't emulate this MC bank currently */
+    mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+    return 1;
+}
+
+int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
+{
+    /* Assign '0' as we don't emulate this MC bank currently */
+    *val = 0;
+    return 1;
+}
+
 enum mcheck_type
 amd_mcheck_init(struct cpuinfo_x86 *ci)
 {
-    enum mcheck_type rc = mcheck_none;
+    uint32_t i;
+    enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(ci);
 
-    switch ( ci->x86 )
-    {
-    default:
-        /* Assume that machine check support is available.
-         * The minimum provided support is at least the K8. */
-    case 0xf:
-        rc = amd_k8_mcheck_init(ci);
-        break;
+    /* Assume that machine check support is available.
+     * The minimum provided support is at least the K8. */
+    mce_handler_init();
+    x86_mce_vector_register(amd_cmn_machine_check);
+    mce_need_clearbank_register(amd_need_clearbank_scan);
 
-    case 0x10 ... 0x17:
-        rc = amd_f10_mcheck_init(ci);
-        break;
+    for ( i = 0; i < nr_mce_banks; i++ )
+    {
+        if ( quirkflag == MCEQUIRK_K8_GART && i == 4 )
+            mcequirk_amd_apply(quirkflag);
+        else
+        {
+            /* Enable error reporting of all errors */
+            wrmsrl(MSR_IA32_MCx_CTL(i), 0xffffffffffffffffULL);
+            wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
+        }
     }
 
-    return rc;
+    if ( ci->x86 == 0xf )
+        return mcheck_amd_k8;
+
+    if ( quirkflag == MCEQUIRK_F10_GART )
+        mcequirk_amd_apply(quirkflag);
+
+    x86_mce_callback_register(amd_f10_handler);
+    mce_recoverable_register(mc_amd_recoverable_scan);
+    mce_register_addrcheck(mc_amd_addrcheck);
+
+    return mcheck_amd_famXX;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxU2g-0000Qd-LO; Thu, 19 Jun 2014 04:33:42 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2f-0000QL-6Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:41 +0000
Received: from [85.158.137.68:23688] by server-10.bemta-3.messagelabs.com id
	38/0C-09305-42862A35; Thu, 19 Jun 2014 04:33:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403152417!10976653!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9765 invoked from network); 19 Jun 2014 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2b-0002Pf-Jz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2b-0007ME-Ba
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:37 +0000
Date: Thu, 19 Jun 2014 04:33:37 +0000
Message-Id: <E1WxU2b-0007ME-Ba@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86,
	mce: consolidate AMD mcheck initialization
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 518576c6cbdaa2640865f1baa813c1b4d48c469f
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Mon Jun 2 10:18:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:18:07 2014 +0200

    x86,mce: consolidate AMD mcheck initialization
    
    amd_k8.c did a lot of common work and very little K8
    specific work. So merge init functions of amd_f10.c and
    amd_k8.c and move it into the common amd_mcheck_init
    handler. With that done, there is not much left in either
    files, so fold all code into just one file - mce_amd.c
    
    While at it, update the comments regarding documentation
    with correct URL's and revision numbers.
    
    Also, update copyright info.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/Makefile  |    2 -
 xen/arch/x86/cpu/mcheck/amd_f10.c |  118 --------------------------
 xen/arch/x86/cpu/mcheck/amd_k8.c  |  117 --------------------------
 xen/arch/x86/cpu/mcheck/mce_amd.c |  167 +++++++++++++++++++++++++++++++++----
 4 files changed, 151 insertions(+), 253 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/Makefile b/xen/arch/x86/cpu/mcheck/Makefile
index c8cd5f9..0d63ff9 100644
--- a/xen/arch/x86/cpu/mcheck/Makefile
+++ b/xen/arch/x86/cpu/mcheck/Makefile
@@ -1,6 +1,4 @@
 obj-y += amd_nonfatal.o
-obj-y += amd_k8.o
-obj-y += amd_f10.o
 obj-y += mce_amd.o
 obj-y += mcaction.o
 obj-y += barrier.o
diff --git a/xen/arch/x86/cpu/mcheck/amd_f10.c b/xen/arch/x86/cpu/mcheck/amd_f10.c
deleted file mode 100644
index 03797ab..0000000
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * MCA implementation for AMD Family10 CPUs
- * Copyright (c) 2007 Advanced Micro Devices, 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
- */
-
-
-/* K8 common MCA documentation published at
- *
- * AMD64 Architecture Programmer's Manual Volume 2:
- * System Programming
- * Publication # 24593 Revision: 3.12
- * Issue Date: September 2006
- */
-
-/* Family10 MCA documentation published at
- *
- * BIOS and Kernel Developer's Guide
- * For AMD Family 10h Processors
- * Publication # 31116 Revision: 1.08
- * Isse Date: June 10, 2007
- */
-
-
-#include <xen/init.h>
-#include <xen/types.h>
-
-#include <asm/msr.h>
-
-#include "mce.h"
-#include "mce_quirks.h"
-#include "x86_mca.h"
-#include "mce_amd.h"
-#include "mcaction.h"
-
-static struct mcinfo_extended *
-amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
-{
-	struct mcinfo_extended *mc_ext;
-
-	/* Family 0x10 introduced additional MSR that belong to the
-	 * northbridge bank (4). */
-	if (mi == NULL || bank != 4)
-		return NULL;
-
-	if (!(status & MCi_STATUS_VAL))
-		return NULL;
-
-	if (!(status & MCi_STATUS_MISCV))
-		return NULL;
-
-	mc_ext = x86_mcinfo_reserve(mi, sizeof(*mc_ext));
-	if (!mc_ext)
-	{
-		mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
-		return NULL;
-	}
-
-	mc_ext->common.type = MC_TYPE_EXTENDED;
-	mc_ext->common.size = sizeof(*mc_ext);
-	mc_ext->mc_msrs = 3;
-
-	mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1;
-	mc_ext->mc_msr[1].reg = MSR_F10_MC4_MISC2;
-	mc_ext->mc_msr[2].reg = MSR_F10_MC4_MISC3;
-
-	mc_ext->mc_msr[0].value = mca_rdmsr(MSR_F10_MC4_MISC1);
-	mc_ext->mc_msr[1].value = mca_rdmsr(MSR_F10_MC4_MISC2);
-	mc_ext->mc_msr[2].value = mca_rdmsr(MSR_F10_MC4_MISC3);
-
-	return mc_ext;
-}
-
-/* AMD Family10 machine check */
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c)
-{ 
-	enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c);
-
-	if (amd_k8_mcheck_init(c) == mcheck_none)
-		return mcheck_none;
-
-	if (quirkflag == MCEQUIRK_F10_GART)
-		mcequirk_amd_apply(quirkflag);
-
-	x86_mce_callback_register(amd_f10_handler);
-	mce_recoverable_register(mc_amd_recoverable_scan);
-	mce_register_addrcheck(mc_amd_addrcheck);
-
-	return mcheck_amd_famXX;
-}
-
-/* amd specific MCA MSR */
-int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
-{
-    /* Do nothing as we don't emulate this MC bank currently */
-    mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
-    return 1;
-}
-
-int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
-{
-    /* Assign '0' as we don't emulate this MC bank currently */
-    *val = 0;
-    return 1;
-}
diff --git a/xen/arch/x86/cpu/mcheck/amd_k8.c b/xen/arch/x86/cpu/mcheck/amd_k8.c
deleted file mode 100644
index 8ff359c..0000000
--- a/xen/arch/x86/cpu/mcheck/amd_k8.c
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * MCA implementation for AMD K8 CPUs
- * Copyright (c) 2007 Advanced Micro Devices, 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
- */
-
-
-/* K8 common MCA documentation published at
- *
- * AMD64 Architecture Programmer's Manual Volume 2:
- * System Programming
- * Publication # 24593 Revision: 3.12
- * Issue Date: September 2006
- *
- * URL:
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24593.pdf
- */
-
-/* The related documentation for K8 Revisions A - E is:
- *
- * BIOS and Kernel Developer's Guide for
- * AMD Athlon 64 and AMD Opteron Processors
- * Publication # 26094 Revision: 3.30
- * Issue Date: February 2006
- *
- * URL:
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/26094.PDF
- */
-
-/* The related documentation for K8 Revisions F - G is:
- *
- * BIOS and Kernel Developer's Guide for
- * AMD NPT Family 0Fh Processors
- * Publication # 32559 Revision: 3.04
- * Issue Date: December 2006
- *
- * URL:
- * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/32559.pdf
- */
-
-
-#include <xen/config.h>
-#include <xen/init.h>
-#include <xen/types.h>
-#include <xen/kernel.h>
-#include <xen/smp.h>
-#include <xen/sched.h>
-#include <xen/sched-if.h>
-#include <xen/softirq.h>
-
-#include <asm/processor.h>
-#include <asm/shared.h>
-#include <asm/system.h>
-#include <asm/msr.h>
-
-#include "mce.h"
-#include "mce_quirks.h"
-
-/* Machine Check Handler for AMD K8 family series */
-static void k8_machine_check(struct cpu_user_regs *regs, long error_code)
-{
-	mcheck_cmn_handler(regs, error_code, mca_allbanks,
-			   __get_cpu_var(mce_clear_banks));
-}
-
-static int k8_need_clearbank_scan(enum mca_source who, uint64_t status)
-{
-	if (who != MCA_MCE_SCAN)
-		return 1;
-
-	/*
-	 * For fatal error, it shouldn't be cleared so that sticky bank
-	 * have a chance to be handled after reboot by polling.
-	 */
-	if ((status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC))
-		return 0;
-
-	return 1;
-}
-
-/* AMD K8 machine check */
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c)
-{
-	uint32_t i;
-	enum mcequirk_amd_flags quirkflag;
-
-	quirkflag = mcequirk_lookup_amd_quirkdata(c);
-
-	mce_handler_init();
-	x86_mce_vector_register(k8_machine_check);
-	mce_need_clearbank_register(k8_need_clearbank_scan);
-
-	for (i = 0; i < nr_mce_banks; i++) {
-		if (quirkflag == MCEQUIRK_K8_GART && i == 4) {
-			mcequirk_amd_apply(quirkflag);
-		} else {
-			/* Enable error reporting of all errors */
-			wrmsrl(MSR_IA32_MCx_CTL(i), 0xffffffffffffffffULL);
-			wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
-		}
-	}
-
-	return mcheck_amd_k8;
-}
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 74ee115..d59e21d 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -1,6 +1,6 @@
 /*
  * common MCA implementation for AMD CPUs.
- * Copyright (c) 2012 Advanced Micro Devices, Inc.
+ * Copyright (c) 2012-2014 Advanced Micro Devices, 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
@@ -17,6 +17,50 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+/* K8 common MCA documentation published at
+ *
+ * AMD64 Architecture Programmer's Manual Volume 2:
+ * System Programming
+ * Publication # 24593 Revision: 3.24
+ * Issue Date: October 2013
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/24593.pdf 
+ */
+
+/* The related documentation for K8 Revisions A - E is:
+ *
+ * BIOS and Kernel Developer's Guide for
+ * AMD Athlon 64 and AMD Opteron Processors
+ * Publication # 26094 Revision: 3.30
+ * Issue Date: February 2006
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/26094.PDF 
+ */
+
+/* The related documentation for K8 Revisions F - G is:
+ *
+ * BIOS and Kernel Developer's Guide for
+ * AMD NPT Family 0Fh Processors
+ * Publication # 32559 Revision: 3.08
+ * Issue Date: July 2007
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/32559.pdf 
+ */
+
+/* Family10 MCA documentation published at
+ *
+ * BIOS and Kernel Developer's Guide
+ * For AMD Family 10h Processors
+ * Publication # 31116 Revision: 3.62
+ * Isse Date: January 11, 2013
+ *
+ * URL:
+ * http://support.amd.com/TechDocs/31116.pdf 
+ */
+
 #include <xen/init.h>
 #include <xen/types.h>
 
@@ -27,8 +71,8 @@
 #include "x86_mca.h"
 #include "mce_amd.h"
 #include "mcaction.h"
-
 #include "mce_quirks.h"
+#include "vmce.h"
 
 #define ANY -1
 
@@ -98,7 +142,8 @@ mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype)
     errorcode = status & (MCi_STATUS_MCA | MCi_STATUS_MSEC);
     ectype = mc_ec2type(errorcode);
 
-    switch (ectype) {
+    switch ( ectype )
+    {
     case MC_EC_BUS_TYPE: /* value in addr MSR is physical */
     case MC_EC_MEM_TYPE: /* value in addr MSR is physical */
         return (addrtype == MC_ADDR_PHYSICAL);
@@ -158,24 +203,114 @@ int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
     return 0;
 }
 
+static struct mcinfo_extended *
+amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
+{
+    struct mcinfo_extended *mc_ext;
+
+    /* Family 0x10 introduced additional MSR that belong to the
+     * northbridge bank (4). */
+    if ( mi == NULL || bank != 4 )
+        return NULL;
+
+    if ( !(status & MCi_STATUS_VAL) )
+        return NULL;
+
+    if ( !(status & MCi_STATUS_MISCV) )
+        return NULL;
+
+    mc_ext = x86_mcinfo_reserve(mi, sizeof(*mc_ext));
+    if ( !mc_ext )
+    {
+        mi->flags |= MCINFO_FLAGS_UNCOMPLETE;
+        return NULL;
+    }
+
+    mc_ext->common.type = MC_TYPE_EXTENDED;
+    mc_ext->common.size = sizeof(*mc_ext);
+    mc_ext->mc_msrs = 3;
+
+    mc_ext->mc_msr[0].reg = MSR_F10_MC4_MISC1;
+    mc_ext->mc_msr[1].reg = MSR_F10_MC4_MISC2;
+    mc_ext->mc_msr[2].reg = MSR_F10_MC4_MISC3;
+
+    mc_ext->mc_msr[0].value = mca_rdmsr(MSR_F10_MC4_MISC1);
+    mc_ext->mc_msr[1].value = mca_rdmsr(MSR_F10_MC4_MISC2);
+    mc_ext->mc_msr[2].value = mca_rdmsr(MSR_F10_MC4_MISC3);
+
+    return mc_ext;
+}
+
+/* Common AMD Machine Check Handler for AMD K8 and higher */
+static void amd_cmn_machine_check(struct cpu_user_regs *regs, long error_code)
+{
+    mcheck_cmn_handler(regs, error_code, mca_allbanks,
+                       __get_cpu_var(mce_clear_banks));
+}
+
+static int amd_need_clearbank_scan(enum mca_source who, uint64_t status)
+{
+    if ( who != MCA_MCE_SCAN )
+        return 1;
+
+    /*
+     * For fatal error, it shouldn't be cleared so that sticky bank
+     * have a chance to be handled after reboot by polling.
+     */
+    if ( (status & MCi_STATUS_UC) && (status & MCi_STATUS_PCC) )
+        return 0;
+
+    return 1;
+}
+
+/* AMD specific MCA MSR */
+int vmce_amd_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
+{
+    /* Do nothing as we don't emulate this MC bank currently */
+    mce_printk(MCE_VERBOSE, "MCE: wr msr %#"PRIx64"\n", val);
+    return 1;
+}
+
+int vmce_amd_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
+{
+    /* Assign '0' as we don't emulate this MC bank currently */
+    *val = 0;
+    return 1;
+}
+
 enum mcheck_type
 amd_mcheck_init(struct cpuinfo_x86 *ci)
 {
-    enum mcheck_type rc = mcheck_none;
+    uint32_t i;
+    enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(ci);
 
-    switch ( ci->x86 )
-    {
-    default:
-        /* Assume that machine check support is available.
-         * The minimum provided support is at least the K8. */
-    case 0xf:
-        rc = amd_k8_mcheck_init(ci);
-        break;
+    /* Assume that machine check support is available.
+     * The minimum provided support is at least the K8. */
+    mce_handler_init();
+    x86_mce_vector_register(amd_cmn_machine_check);
+    mce_need_clearbank_register(amd_need_clearbank_scan);
 
-    case 0x10 ... 0x17:
-        rc = amd_f10_mcheck_init(ci);
-        break;
+    for ( i = 0; i < nr_mce_banks; i++ )
+    {
+        if ( quirkflag == MCEQUIRK_K8_GART && i == 4 )
+            mcequirk_amd_apply(quirkflag);
+        else
+        {
+            /* Enable error reporting of all errors */
+            wrmsrl(MSR_IA32_MCx_CTL(i), 0xffffffffffffffffULL);
+            wrmsrl(MSR_IA32_MCx_STATUS(i), 0x0ULL);
+        }
     }
 
-    return rc;
+    if ( ci->x86 == 0xf )
+        return mcheck_amd_k8;
+
+    if ( quirkflag == MCEQUIRK_F10_GART )
+        mcequirk_amd_apply(quirkflag);
+
+    x86_mce_callback_register(amd_f10_handler);
+    mce_recoverable_register(mc_amd_recoverable_scan);
+    mce_register_addrcheck(mc_amd_addrcheck);
+
+    return mcheck_amd_famXX;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxU2p-0000Sh-Qh; Thu, 19 Jun 2014 04:33:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2o-0000SM-70
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:50 +0000
Received: from [85.158.139.211:49319] by server-12.bemta-5.messagelabs.com id
	E9/A1-27841-D2862A35; Thu, 19 Jun 2014 04:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1403152428!5357149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31908 invoked from network); 19 Jun 2014 04:33:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2l-0002Pl-PQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2l-0007Ma-OD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:47 +0000
Date: Thu, 19 Jun 2014 04:33:47 +0000
Message-Id: <E1WxU2l-0007Ma-OD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 071a4c70a634f7d4f74cde4086ff3202968538c9
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Mon Jun 2 10:19:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:19:27 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index e83f4b6..4347548 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -202,7 +202,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:33:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxU2p-0000Sh-Qh; Thu, 19 Jun 2014 04:33:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2o-0000SM-70
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:50 +0000
Received: from [85.158.139.211:49319] by server-12.bemta-5.messagelabs.com id
	E9/A1-27841-D2862A35; Thu, 19 Jun 2014 04:33:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1403152428!5357149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31908 invoked from network); 19 Jun 2014 04:33:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2l-0002Pl-PQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2l-0007Ma-OD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:47 +0000
Date: Thu, 19 Jun 2014 04:33:47 +0000
Message-Id: <E1WxU2l-0007Ma-OD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 071a4c70a634f7d4f74cde4086ff3202968538c9
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Mon Jun 2 10:19:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:19:27 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index e83f4b6..4347548 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -202,7 +202,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU31-0000Uz-Ki; Thu, 19 Jun 2014 04:34:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2y-0000Uf-Hc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:00 +0000
Received: from [193.109.254.147:12660] by server-16.bemta-14.messagelabs.com
	id 8D/25-16986-73862A35; Thu, 19 Jun 2014 04:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403152438!12256069!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25549 invoked from network); 19 Jun 2014 04:33:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2w-0002Pr-0I
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2v-0007Mw-VG
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:57 +0000
Date: Thu, 19 Jun 2014 04:33:57 +0000
Message-Id: <E1WxU2v-0007Mw-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correctly report max number of
	hypervisor leaves
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1310518602978903798=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 03d745c8bfbf45df39eb453ff1e7787b856c4368
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Jun 2 10:20:23 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:20:23 2014 +0200

    x86: correctly report max number of hypervisor leaves
    
    Commit def0bbd31 provided support for changing max number of
    hypervisor cpuid leaves (in leaf 0x4000xx00). It also made the
    hypervisor incorrectly report this number for guests that
    use default value (i.e. don't specify leaf 0x4000xx00 in config
    file)
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/traps.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1722912..b82b1b3 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -692,13 +692,19 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
     if ( idx > XEN_CPUID_MAX_NUM_LEAVES )
         return 0; /* Avoid unnecessary pass through domain_cpuid() */
 
-    /* Number of leaves may be user-specified */
     domain_cpuid(d, base, 0, &limit, &dummy, &dummy, &dummy);
-    limit &= 0xff;
-    if ( limit < 2 )
-        limit = 2;
-    else if ( limit > XEN_CPUID_MAX_NUM_LEAVES )
+    if ( limit == 0 )
+        /* Default number of leaves */
         limit = XEN_CPUID_MAX_NUM_LEAVES;
+    else
+    {
+        /* User-specified number of leaves */
+        limit &= 0xff;
+        if ( limit < 2 )
+            limit = 2;
+        else if ( limit > XEN_CPUID_MAX_NUM_LEAVES )
+            limit = XEN_CPUID_MAX_NUM_LEAVES;
+    }
 
     if ( idx > limit ) 
         return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU31-0000Uz-Ki; Thu, 19 Jun 2014 04:34:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2y-0000Uf-Hc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:00 +0000
Received: from [193.109.254.147:12660] by server-16.bemta-14.messagelabs.com
	id 8D/25-16986-73862A35; Thu, 19 Jun 2014 04:33:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403152438!12256069!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25549 invoked from network); 19 Jun 2014 04:33:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:33:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2w-0002Pr-0I
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU2v-0007Mw-VG
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:33:57 +0000
Date: Thu, 19 Jun 2014 04:33:57 +0000
Message-Id: <E1WxU2v-0007Mw-VG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: correctly report max number of
	hypervisor leaves
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1310518602978903798=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 03d745c8bfbf45df39eb453ff1e7787b856c4368
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Mon Jun 2 10:20:23 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:20:23 2014 +0200

    x86: correctly report max number of hypervisor leaves
    
    Commit def0bbd31 provided support for changing max number of
    hypervisor cpuid leaves (in leaf 0x4000xx00). It also made the
    hypervisor incorrectly report this number for guests that
    use default value (i.e. don't specify leaf 0x4000xx00 in config
    file)
    
    Reported-by: Roger Pau Monné <roger.pau@citrix.com>
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/traps.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 1722912..b82b1b3 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -692,13 +692,19 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx,
     if ( idx > XEN_CPUID_MAX_NUM_LEAVES )
         return 0; /* Avoid unnecessary pass through domain_cpuid() */
 
-    /* Number of leaves may be user-specified */
     domain_cpuid(d, base, 0, &limit, &dummy, &dummy, &dummy);
-    limit &= 0xff;
-    if ( limit < 2 )
-        limit = 2;
-    else if ( limit > XEN_CPUID_MAX_NUM_LEAVES )
+    if ( limit == 0 )
+        /* Default number of leaves */
         limit = XEN_CPUID_MAX_NUM_LEAVES;
+    else
+    {
+        /* User-specified number of leaves */
+        limit &= 0xff;
+        if ( limit < 2 )
+            limit = 2;
+        else if ( limit > XEN_CPUID_MAX_NUM_LEAVES )
+            limit = XEN_CPUID_MAX_NUM_LEAVES;
+    }
 
     if ( idx > limit ) 
         return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3A-0000We-No; Thu, 19 Jun 2014 04:34:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU39-0000WS-Cs
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:11 +0000
Received: from [193.109.254.147:34877] by server-5.bemta-14.messagelabs.com id
	14/0C-26413-24862A35; Thu, 19 Jun 2014 04:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1403152448!12232343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14200 invoked from network); 19 Jun 2014 04:34:09 -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;
	19 Jun 2014 04:34:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU36-0002QQ-6R
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU36-0007NW-5B
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:08 +0000
Date: Thu, 19 Jun 2014 04:34:08 +0000
Message-Id: <E1WxU36-0007NW-5B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pvh dom0: add and remove foreign pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50fe6e737059a98e8a5242a7616e4cdcb60988c2
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Mon Jun 2 10:30:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:30:47 2014 +0200

    pvh dom0: add and remove foreign pages
    
    In this patch, a new function, p2m_add_foreign(), is added
    to map pages from a foreign guest into dom0 for various purposes
    like domU creation, running xentrace, etc... Such pages are
    typed p2m_map_foreign.  Note, it is the nature of such pages
    that a refcnt is held during their stay in the p2m. The
    refcnt is added and released in the low level ept function
    atomic_write_ept_entry. That macro is converted to a function to allow
    for such refcounting, which only applies to leaf entries in the ept.
    Furthermore, please note that paging/sharing is disabled if the
    controlling or hardware domain is pvh. Any enabling of those features
    would need to ensure refcnt are properly maintained for foreign types,
    or paging/sharing is skipped for foreign types.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c           |    2 +
 xen/arch/x86/mm/mem_event.c |   11 ++++
 xen/arch/x86/mm/p2m-ept.c   |  109 ++++++++++++++++++++++++++++++-------
 xen/arch/x86/mm/p2m-pt.c    |    7 +++
 xen/arch/x86/mm/p2m.c       |  126 ++++++++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/p2m.h   |    7 +++
 6 files changed, 234 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d3459f4..dd8d98c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4584,6 +4584,8 @@ int xenmem_add_to_physmap_one(
             page = mfn_to_page(mfn);
             break;
         }
+        case XENMAPSPACE_gmfn_foreign:
+            return p2m_add_foreign(d, idx, gpfn, foreign_domid);
         default:
             break;
     }
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index f84c383..40ae841 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -538,6 +538,12 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE:
         {
             struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+            rc = -EOPNOTSUPP;
+            /* pvh fixme: p2m_is_foreign types need addressing */
+            if ( is_pvh_vcpu(current) || is_pvh_domain(hardware_domain) )
+                break;
+
             rc = -ENODEV;
             /* Only HAP is supported */
             if ( !hap_enabled(d) )
@@ -620,6 +626,11 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         {
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE:
         {
+            rc = -EOPNOTSUPP;
+            /* pvh fixme: p2m_is_foreign types need addressing */
+            if ( is_pvh_vcpu(current) || is_pvh_domain(hardware_domain) )
+                break;
+
             rc = -ENODEV;
             /* Only HAP is supported */
             if ( !hap_enabled(d) )
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index bb98945..9fda28d 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -36,8 +36,6 @@
 
 #define atomic_read_ept_entry(__pepte)                              \
     ( (ept_entry_t) { .epte = read_atomic(&(__pepte)->epte) } )
-#define atomic_write_ept_entry(__pepte, __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)
@@ -46,6 +44,64 @@ static inline bool_t is_epte_valid(ept_entry_t *e)
     return (e->epte != 0 && e->sa_p2mt != p2m_invalid);
 }
 
+/* returns : 0 for success, -errno otherwise */
+static int atomic_write_ept_entry(ept_entry_t *entryptr, ept_entry_t new,
+                                  int level)
+{
+    int rc;
+    unsigned long oldmfn = INVALID_MFN;
+    bool_t check_foreign = (new.mfn != entryptr->mfn ||
+                            new.sa_p2mt != entryptr->sa_p2mt);
+
+    if ( level )
+    {
+        ASSERT(!is_epte_superpage(&new) || !p2m_is_foreign(new.sa_p2mt));
+        write_atomic(&entryptr->epte, new.epte);
+        return 0;
+    }
+
+    if ( unlikely(p2m_is_foreign(new.sa_p2mt)) )
+    {
+        rc = -EINVAL;
+        if ( !is_epte_present(&new) )
+                goto out;
+
+        if ( check_foreign )
+        {
+            struct domain *fdom;
+
+            if ( !mfn_valid(new.mfn) )
+                goto out;
+
+            rc = -ESRCH;
+            fdom = page_get_owner(mfn_to_page(new.mfn));
+            if ( fdom == NULL )
+                goto out;
+
+            /* get refcount on the page */
+            rc = -EBUSY;
+            if ( !get_page(mfn_to_page(new.mfn), fdom) )
+                goto out;
+        }
+    }
+
+    if ( unlikely(p2m_is_foreign(entryptr->sa_p2mt)) && check_foreign )
+        oldmfn = entryptr->mfn;
+
+    write_atomic(&entryptr->epte, new.epte);
+
+    if ( unlikely(oldmfn != INVALID_MFN) )
+        put_page(mfn_to_page(oldmfn));
+
+    rc = 0;
+
+ out:
+    if ( rc )
+        gdprintk(XENLOG_ERR, "epte o:%"PRIx64" n:%"PRIx64" rc:%d\n",
+                 entryptr->epte, new.epte, rc);
+    return rc;
+}
+
 static void ept_p2m_type_to_flags(ept_entry_t *entry, p2m_type_t type, p2m_access_t access)
 {
     /* First apply type permissions */
@@ -275,8 +331,9 @@ static int ept_next_level(struct p2m_domain *p2m, bool_t read_only,
  * present entries in the given page table, optionally marking the entries
  * also for their subtrees needing P2M type re-calculation.
  */
-static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc)
+static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc, int level)
 {
+    int rc;
     ept_entry_t *epte = map_domain_page(mfn_x(mfn));
     unsigned int i;
     bool_t changed = 0;
@@ -292,7 +349,8 @@ static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc)
         e.emt = MTRR_NUM_TYPES;
         if ( recalc )
             e.recalc = 1;
-        atomic_write_ept_entry(&epte[i], e);
+        rc = atomic_write_ept_entry(&epte[i], e, level);
+        ASSERT(rc == 0);
         changed = 1;
     }
 
@@ -316,7 +374,7 @@ static int ept_invalidate_emt_range(struct p2m_domain *p2m,
     ept_entry_t *table;
     unsigned long gfn_remainder = first_gfn;
     unsigned int i, index;
-    int rc = 0, ret = GUEST_TABLE_MAP_FAILED;
+    int wrc, rc = 0, ret = GUEST_TABLE_MAP_FAILED;
 
     table = map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m)));
     for ( i = ept_get_wl(&p2m->ept); i > target; --i )
@@ -342,7 +400,8 @@ static int ept_invalidate_emt_range(struct p2m_domain *p2m,
             rc = -ENOMEM;
             goto out;
         }
-        atomic_write_ept_entry(&table[index], split_ept_entry);
+        wrc = atomic_write_ept_entry(&table[index], split_ept_entry, i);
+        ASSERT(wrc == 0);
 
         for ( ; i > target; --i )
             if ( !ept_next_level(p2m, 1, &table, &gfn_remainder, i) )
@@ -361,7 +420,8 @@ static int ept_invalidate_emt_range(struct p2m_domain *p2m,
         {
             e.emt = MTRR_NUM_TYPES;
             e.recalc = 1;
-            atomic_write_ept_entry(&table[index], e);
+            wrc = atomic_write_ept_entry(&table[index], e, target);
+            ASSERT(wrc == 0);
             rc = 1;
         }
     }
@@ -390,7 +450,7 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
     unsigned int level = ept_get_wl(ept);
     unsigned long mfn = ept_get_asr(ept);
     ept_entry_t *epte;
-    int rc = 0;
+    int wrc, rc = 0;
 
     if ( !mfn )
         return 0;
@@ -431,7 +491,8 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                          ept_p2m_type_to_flags(&e, e.sa_p2mt, e.access);
                     }
                     e.recalc = 0;
-                    atomic_write_ept_entry(&epte[i], e);
+                    wrc = atomic_write_ept_entry(&epte[i], e, level);
+                    ASSERT(wrc == 0);
                 }
             }
             else
@@ -465,7 +526,8 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                 {
                     if ( ept_split_super_page(p2m, &e, level, level - 1) )
                     {
-                        atomic_write_ept_entry(&epte[i], e);
+                        wrc = atomic_write_ept_entry(&epte[i], e, level);
+                        ASSERT(wrc == 0);
                         unmap_domain_page(epte);
                         mfn = e.mfn;
                         continue;
@@ -479,7 +541,8 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                 e.recalc = 0;
                 if ( recalc && p2m_is_changeable(e.sa_p2mt) )
                     ept_p2m_type_to_flags(&e, e.sa_p2mt, e.access);
-                atomic_write_ept_entry(&epte[i], e);
+                wrc = atomic_write_ept_entry(&epte[i], e, level);
+                ASSERT(wrc == 0);
             }
 
             rc = 1;
@@ -489,11 +552,12 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
         if ( e.emt == MTRR_NUM_TYPES )
         {
             ASSERT(is_epte_present(&e));
-            ept_invalidate_emt(_mfn(e.mfn), e.recalc);
+            ept_invalidate_emt(_mfn(e.mfn), e.recalc, level);
             smp_wmb();
             e.emt = 0;
             e.recalc = 0;
-            atomic_write_ept_entry(&epte[i], e);
+            wrc = atomic_write_ept_entry(&epte[i], e, level);
+            ASSERT(wrc == 0);
             unmap_domain_page(epte);
             rc = 1;
         }
@@ -585,6 +649,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     ASSERT((target == 2 && hvm_hap_has_1gb()) ||
            (target == 1 && hvm_hap_has_2mb()) ||
            (target == 0));
+    ASSERT(!p2m_is_foreign(p2mt) || target == 0);
 
     table = map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m)));
 
@@ -649,7 +714,8 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         /* now install the newly split ept sub-tree */
         /* NB: please make sure domian is paused and no in-fly VT-d DMA. */
-        atomic_write_ept_entry(ept_entry, split_ept_entry);
+        rc = atomic_write_ept_entry(ept_entry, split_ept_entry, i);
+        ASSERT(rc == 0);
 
         /* then move to the level we want to make real changes */
         for ( ; i > target; i-- )
@@ -688,11 +754,12 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_p2m_type_to_flags(&new_entry, p2mt, p2ma);
     }
 
-    atomic_write_ept_entry(ept_entry, new_entry);
-
-    /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( p2mt != p2m_invalid &&
-         (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
+    rc = atomic_write_ept_entry(ept_entry, new_entry, target);
+    if ( unlikely(rc) )
+        old_entry.epte = 0;
+    else if ( p2mt != p2m_invalid &&
+              (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
+        /* Track the highest gfn for which we have ever had a valid mapping */
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
 out:
@@ -893,7 +960,7 @@ static void ept_change_entry_type_global(struct p2m_domain *p2m,
     if ( !mfn )
         return;
 
-    if ( ept_invalidate_emt(_mfn(mfn), 1) )
+    if ( ept_invalidate_emt(_mfn(mfn), 1, ept_get_wl(&p2m->ept)) )
         ept_sync_domain(p2m);
 }
 
@@ -951,7 +1018,7 @@ static void ept_memory_type_changed(struct p2m_domain *p2m)
     if ( !mfn )
         return;
 
-    if ( ept_invalidate_emt(_mfn(mfn), 0) )
+    if ( ept_invalidate_emt(_mfn(mfn), 0, ept_get_wl(&p2m->ept)) )
         ept_sync_domain(p2m);
 }
 
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index cd9867a..a1794d0 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -513,6 +513,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         __trace_var(TRC_MEM_SET_P2M_ENTRY, 0, sizeof(t), &t);
     }
 
+    if ( unlikely(p2m_is_foreign(p2mt)) )
+    {
+        /* pvh fixme: foreign types are only supported on ept at present */
+        gdprintk(XENLOG_WARNING, "Unimplemented foreign p2m type.\n");
+        return -EINVAL;
+    }
+
     /* Carry out any eventually pending earlier changes first. */
     rc = do_recalc(p2m, gfn);
     if ( rc < 0 )
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index b50747a..642ec28 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -36,6 +36,7 @@
 #include <xen/event.h>
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
+#include <xsm/xsm.h>
 
 #include "mm-locks.h"
 
@@ -311,14 +312,20 @@ struct page_info *get_page_from_gfn_p2m(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = __get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( (p2m_is_ram(*t) || p2m_is_grant(*t))
-             && mfn_valid(mfn)
+        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
              && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
         {
             page = mfn_to_page(mfn);
-            if ( !get_page(page, d)
-                 /* Page could be shared */
-                 && !get_page(page, dom_cow) )
+            if ( unlikely(p2m_is_foreign(*t)) )
+            {
+                struct domain *fdom = page_get_owner_and_reference(page);
+                ASSERT(fdom != d);
+                if ( fdom == NULL )
+                    page = NULL;
+            }
+            else if ( !get_page(page, d)
+                      /* Page could be shared */
+                      && !get_page(page, dom_cow) )
                 page = NULL;
         }
         p2m_read_unlock(p2m);
@@ -468,6 +475,10 @@ int p2m_alloc_table(struct p2m_domain *p2m)
     return rc;
 }
 
+/*
+ * pvh fixme: when adding support for pvh non-hardware domains, this path must
+ * cleanup any foreign p2m types (release refcnts on them).
+ */
 void p2m_teardown(struct p2m_domain *p2m)
 /* Return all the p2m pages to Xen.
  * We know we don't have any extra mappings to these pages */
@@ -836,8 +847,8 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 }
 
 /* Set foreign mfn in the given guest's p2m table. */
-static int __attribute__((unused))
-set_foreign_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
+static int set_foreign_p2m_entry(struct domain *d, unsigned long gfn,
+                                 mfn_t mfn)
 {
     return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign);
 }
@@ -1794,6 +1805,107 @@ out_p2m_audit:
 #endif /* P2M_AUDIT */
 
 /*
+ * Add frame from foreign domain to target domain's physmap. Similar to
+ * XENMAPSPACE_gmfn but the frame is foreign being mapped into current,
+ * and is not removed from foreign domain.
+ *
+ * Usage: - libxl on pvh dom0 creating a guest and doing privcmd_ioctl_mmap.
+ *        - xentrace running on dom0 mapping xenheap pages. foreigndom would
+ *          be DOMID_XEN in such a case.
+ *        etc..
+ *
+ * Side Effect: the mfn for fgfn will be refcounted in lower level routines
+ *              so it is not lost while mapped here. The refcnt is released
+ *              via the XENMEM_remove_from_physmap path.
+ *
+ * Returns: 0 ==> success
+ */
+int p2m_add_foreign(struct domain *tdom, unsigned long fgfn,
+                    unsigned long gpfn, domid_t foreigndom)
+{
+    p2m_type_t p2mt, p2mt_prev;
+    unsigned long prev_mfn, mfn;
+    struct page_info *page;
+    int rc;
+    struct domain *fdom;
+
+    ASSERT(tdom);
+    if ( foreigndom == DOMID_SELF || !is_pvh_domain(tdom) )
+        return -EINVAL;
+    /*
+     * pvh fixme: until support is added to p2m teardown code to cleanup any
+     * foreign entries, limit this to hardware domain only.
+     */
+    if ( !is_hardware_domain(tdom) )
+        return -EPERM;
+
+    if ( foreigndom == DOMID_XEN )
+        fdom = rcu_lock_domain(dom_xen);
+    else
+        fdom = rcu_lock_domain_by_id(foreigndom);
+    if ( fdom == NULL )
+        return -ESRCH;
+
+    rc = -EINVAL;
+    if ( tdom == fdom )
+        goto out;
+
+    rc = xsm_map_gmfn_foreign(XSM_TARGET, tdom, fdom);
+    if ( rc )
+        goto out;
+
+    /*
+     * Take a refcnt on the mfn. NB: following supported for foreign mapping:
+     *     ram_rw | ram_logdirty | ram_ro | paging_out.
+     */
+    page = get_page_from_gfn(fdom, fgfn, &p2mt, P2M_ALLOC);
+    if ( !page ||
+         !p2m_is_ram(p2mt) || p2m_is_shared(p2mt) || p2m_is_hole(p2mt) )
+    {
+        if ( page )
+            put_page(page);
+        rc = -EINVAL;
+        goto out;
+    }
+    mfn = mfn_x(page_to_mfn(page));
+
+    /* Remove previously mapped page if it is present. */
+    prev_mfn = mfn_x(get_gfn(tdom, gpfn, &p2mt_prev));
+    if ( mfn_valid(_mfn(prev_mfn)) )
+    {
+        if ( is_xen_heap_mfn(prev_mfn) )
+            /* Xen heap frames are simply unhooked from this phys slot */
+            guest_physmap_remove_page(tdom, gpfn, prev_mfn, 0);
+        else
+            /* Normal domain memory is freed, to avoid leaking memory. */
+            guest_remove_page(tdom, gpfn);
+    }
+    /*
+     * Create the new mapping. Can't use guest_physmap_add_page() because it
+     * will update the m2p table which will result in  mfn -> gpfn of dom0
+     * and not fgfn of domU.
+     */
+    rc = set_foreign_p2m_entry(tdom, gpfn, _mfn(mfn));
+    if ( rc )
+        gdprintk(XENLOG_WARNING, "set_foreign_p2m_entry failed. "
+                 "gpfn:%lx mfn:%lx fgfn:%lx td:%d fd:%d\n",
+                 gpfn, mfn, fgfn, tdom->domain_id, fdom->domain_id);
+
+    put_page(page);
+
+    /*
+     * This put_gfn for the above get_gfn for prev_mfn.  We must do this
+     * after set_foreign_p2m_entry so another cpu doesn't populate the gpfn
+     * before us.
+     */
+    put_gfn(tdom, gpfn);
+
+out:
+    if ( fdom )
+        rcu_unlock_domain(fdom);
+    return rc;
+}
+/*
  * Local variables:
  * mode: C
  * c-file-style: "BSD"
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 027f011..d0cfdac 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -188,6 +188,10 @@ typedef unsigned int p2m_query_t;
 #define p2m_is_broken(_t)   (p2m_to_mask(_t) & P2M_BROKEN_TYPES)
 #define p2m_is_foreign(_t)  (p2m_to_mask(_t) & p2m_to_mask(p2m_map_foreign))
 
+#define p2m_is_any_ram(_t)  (p2m_to_mask(_t) &                   \
+                             (P2M_RAM_TYPES | P2M_GRANT_TYPES |  \
+                              p2m_to_mask(p2m_map_foreign)))
+
 /* Per-p2m-table state */
 struct p2m_domain {
     /* Lock that protects updates to the p2m */
@@ -532,6 +536,9 @@ int p2m_is_logdirty_range(struct p2m_domain *, unsigned long start,
 int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn);
 
+/* Add foreign mapping to the guest's p2m table. */
+int p2m_add_foreign(struct domain *tdom, unsigned long fgfn,
+                    unsigned long gpfn, domid_t foreign_domid);
 
 /* 
  * Populate-on-demand
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3A-0000We-No; Thu, 19 Jun 2014 04:34:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU39-0000WS-Cs
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:11 +0000
Received: from [193.109.254.147:34877] by server-5.bemta-14.messagelabs.com id
	14/0C-26413-24862A35; Thu, 19 Jun 2014 04:34:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1403152448!12232343!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14200 invoked from network); 19 Jun 2014 04:34:09 -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;
	19 Jun 2014 04:34:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU36-0002QQ-6R
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU36-0007NW-5B
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:08 +0000
Date: Thu, 19 Jun 2014 04:34:08 +0000
Message-Id: <E1WxU36-0007NW-5B@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pvh dom0: add and remove foreign pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 50fe6e737059a98e8a5242a7616e4cdcb60988c2
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Mon Jun 2 10:30:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:30:47 2014 +0200

    pvh dom0: add and remove foreign pages
    
    In this patch, a new function, p2m_add_foreign(), is added
    to map pages from a foreign guest into dom0 for various purposes
    like domU creation, running xentrace, etc... Such pages are
    typed p2m_map_foreign.  Note, it is the nature of such pages
    that a refcnt is held during their stay in the p2m. The
    refcnt is added and released in the low level ept function
    atomic_write_ept_entry. That macro is converted to a function to allow
    for such refcounting, which only applies to leaf entries in the ept.
    Furthermore, please note that paging/sharing is disabled if the
    controlling or hardware domain is pvh. Any enabling of those features
    would need to ensure refcnt are properly maintained for foreign types,
    or paging/sharing is skipped for foreign types.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm.c           |    2 +
 xen/arch/x86/mm/mem_event.c |   11 ++++
 xen/arch/x86/mm/p2m-ept.c   |  109 ++++++++++++++++++++++++++++++-------
 xen/arch/x86/mm/p2m-pt.c    |    7 +++
 xen/arch/x86/mm/p2m.c       |  126 ++++++++++++++++++++++++++++++++++++++++---
 xen/include/asm-x86/p2m.h   |    7 +++
 6 files changed, 234 insertions(+), 28 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index d3459f4..dd8d98c 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4584,6 +4584,8 @@ int xenmem_add_to_physmap_one(
             page = mfn_to_page(mfn);
             break;
         }
+        case XENMAPSPACE_gmfn_foreign:
+            return p2m_add_foreign(d, idx, gpfn, foreign_domid);
         default:
             break;
     }
diff --git a/xen/arch/x86/mm/mem_event.c b/xen/arch/x86/mm/mem_event.c
index f84c383..40ae841 100644
--- a/xen/arch/x86/mm/mem_event.c
+++ b/xen/arch/x86/mm/mem_event.c
@@ -538,6 +538,12 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE:
         {
             struct p2m_domain *p2m = p2m_get_hostp2m(d);
+
+            rc = -EOPNOTSUPP;
+            /* pvh fixme: p2m_is_foreign types need addressing */
+            if ( is_pvh_vcpu(current) || is_pvh_domain(hardware_domain) )
+                break;
+
             rc = -ENODEV;
             /* Only HAP is supported */
             if ( !hap_enabled(d) )
@@ -620,6 +626,11 @@ int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
         {
         case XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE:
         {
+            rc = -EOPNOTSUPP;
+            /* pvh fixme: p2m_is_foreign types need addressing */
+            if ( is_pvh_vcpu(current) || is_pvh_domain(hardware_domain) )
+                break;
+
             rc = -ENODEV;
             /* Only HAP is supported */
             if ( !hap_enabled(d) )
diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index bb98945..9fda28d 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -36,8 +36,6 @@
 
 #define atomic_read_ept_entry(__pepte)                              \
     ( (ept_entry_t) { .epte = read_atomic(&(__pepte)->epte) } )
-#define atomic_write_ept_entry(__pepte, __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)
@@ -46,6 +44,64 @@ static inline bool_t is_epte_valid(ept_entry_t *e)
     return (e->epte != 0 && e->sa_p2mt != p2m_invalid);
 }
 
+/* returns : 0 for success, -errno otherwise */
+static int atomic_write_ept_entry(ept_entry_t *entryptr, ept_entry_t new,
+                                  int level)
+{
+    int rc;
+    unsigned long oldmfn = INVALID_MFN;
+    bool_t check_foreign = (new.mfn != entryptr->mfn ||
+                            new.sa_p2mt != entryptr->sa_p2mt);
+
+    if ( level )
+    {
+        ASSERT(!is_epte_superpage(&new) || !p2m_is_foreign(new.sa_p2mt));
+        write_atomic(&entryptr->epte, new.epte);
+        return 0;
+    }
+
+    if ( unlikely(p2m_is_foreign(new.sa_p2mt)) )
+    {
+        rc = -EINVAL;
+        if ( !is_epte_present(&new) )
+                goto out;
+
+        if ( check_foreign )
+        {
+            struct domain *fdom;
+
+            if ( !mfn_valid(new.mfn) )
+                goto out;
+
+            rc = -ESRCH;
+            fdom = page_get_owner(mfn_to_page(new.mfn));
+            if ( fdom == NULL )
+                goto out;
+
+            /* get refcount on the page */
+            rc = -EBUSY;
+            if ( !get_page(mfn_to_page(new.mfn), fdom) )
+                goto out;
+        }
+    }
+
+    if ( unlikely(p2m_is_foreign(entryptr->sa_p2mt)) && check_foreign )
+        oldmfn = entryptr->mfn;
+
+    write_atomic(&entryptr->epte, new.epte);
+
+    if ( unlikely(oldmfn != INVALID_MFN) )
+        put_page(mfn_to_page(oldmfn));
+
+    rc = 0;
+
+ out:
+    if ( rc )
+        gdprintk(XENLOG_ERR, "epte o:%"PRIx64" n:%"PRIx64" rc:%d\n",
+                 entryptr->epte, new.epte, rc);
+    return rc;
+}
+
 static void ept_p2m_type_to_flags(ept_entry_t *entry, p2m_type_t type, p2m_access_t access)
 {
     /* First apply type permissions */
@@ -275,8 +331,9 @@ static int ept_next_level(struct p2m_domain *p2m, bool_t read_only,
  * present entries in the given page table, optionally marking the entries
  * also for their subtrees needing P2M type re-calculation.
  */
-static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc)
+static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc, int level)
 {
+    int rc;
     ept_entry_t *epte = map_domain_page(mfn_x(mfn));
     unsigned int i;
     bool_t changed = 0;
@@ -292,7 +349,8 @@ static bool_t ept_invalidate_emt(mfn_t mfn, bool_t recalc)
         e.emt = MTRR_NUM_TYPES;
         if ( recalc )
             e.recalc = 1;
-        atomic_write_ept_entry(&epte[i], e);
+        rc = atomic_write_ept_entry(&epte[i], e, level);
+        ASSERT(rc == 0);
         changed = 1;
     }
 
@@ -316,7 +374,7 @@ static int ept_invalidate_emt_range(struct p2m_domain *p2m,
     ept_entry_t *table;
     unsigned long gfn_remainder = first_gfn;
     unsigned int i, index;
-    int rc = 0, ret = GUEST_TABLE_MAP_FAILED;
+    int wrc, rc = 0, ret = GUEST_TABLE_MAP_FAILED;
 
     table = map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m)));
     for ( i = ept_get_wl(&p2m->ept); i > target; --i )
@@ -342,7 +400,8 @@ static int ept_invalidate_emt_range(struct p2m_domain *p2m,
             rc = -ENOMEM;
             goto out;
         }
-        atomic_write_ept_entry(&table[index], split_ept_entry);
+        wrc = atomic_write_ept_entry(&table[index], split_ept_entry, i);
+        ASSERT(wrc == 0);
 
         for ( ; i > target; --i )
             if ( !ept_next_level(p2m, 1, &table, &gfn_remainder, i) )
@@ -361,7 +420,8 @@ static int ept_invalidate_emt_range(struct p2m_domain *p2m,
         {
             e.emt = MTRR_NUM_TYPES;
             e.recalc = 1;
-            atomic_write_ept_entry(&table[index], e);
+            wrc = atomic_write_ept_entry(&table[index], e, target);
+            ASSERT(wrc == 0);
             rc = 1;
         }
     }
@@ -390,7 +450,7 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
     unsigned int level = ept_get_wl(ept);
     unsigned long mfn = ept_get_asr(ept);
     ept_entry_t *epte;
-    int rc = 0;
+    int wrc, rc = 0;
 
     if ( !mfn )
         return 0;
@@ -431,7 +491,8 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                          ept_p2m_type_to_flags(&e, e.sa_p2mt, e.access);
                     }
                     e.recalc = 0;
-                    atomic_write_ept_entry(&epte[i], e);
+                    wrc = atomic_write_ept_entry(&epte[i], e, level);
+                    ASSERT(wrc == 0);
                 }
             }
             else
@@ -465,7 +526,8 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                 {
                     if ( ept_split_super_page(p2m, &e, level, level - 1) )
                     {
-                        atomic_write_ept_entry(&epte[i], e);
+                        wrc = atomic_write_ept_entry(&epte[i], e, level);
+                        ASSERT(wrc == 0);
                         unmap_domain_page(epte);
                         mfn = e.mfn;
                         continue;
@@ -479,7 +541,8 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
                 e.recalc = 0;
                 if ( recalc && p2m_is_changeable(e.sa_p2mt) )
                     ept_p2m_type_to_flags(&e, e.sa_p2mt, e.access);
-                atomic_write_ept_entry(&epte[i], e);
+                wrc = atomic_write_ept_entry(&epte[i], e, level);
+                ASSERT(wrc == 0);
             }
 
             rc = 1;
@@ -489,11 +552,12 @@ static int resolve_misconfig(struct p2m_domain *p2m, unsigned long gfn)
         if ( e.emt == MTRR_NUM_TYPES )
         {
             ASSERT(is_epte_present(&e));
-            ept_invalidate_emt(_mfn(e.mfn), e.recalc);
+            ept_invalidate_emt(_mfn(e.mfn), e.recalc, level);
             smp_wmb();
             e.emt = 0;
             e.recalc = 0;
-            atomic_write_ept_entry(&epte[i], e);
+            wrc = atomic_write_ept_entry(&epte[i], e, level);
+            ASSERT(wrc == 0);
             unmap_domain_page(epte);
             rc = 1;
         }
@@ -585,6 +649,7 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     ASSERT((target == 2 && hvm_hap_has_1gb()) ||
            (target == 1 && hvm_hap_has_2mb()) ||
            (target == 0));
+    ASSERT(!p2m_is_foreign(p2mt) || target == 0);
 
     table = map_domain_page(pagetable_get_pfn(p2m_get_pagetable(p2m)));
 
@@ -649,7 +714,8 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
 
         /* now install the newly split ept sub-tree */
         /* NB: please make sure domian is paused and no in-fly VT-d DMA. */
-        atomic_write_ept_entry(ept_entry, split_ept_entry);
+        rc = atomic_write_ept_entry(ept_entry, split_ept_entry, i);
+        ASSERT(rc == 0);
 
         /* then move to the level we want to make real changes */
         for ( ; i > target; i-- )
@@ -688,11 +754,12 @@ ept_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         ept_p2m_type_to_flags(&new_entry, p2mt, p2ma);
     }
 
-    atomic_write_ept_entry(ept_entry, new_entry);
-
-    /* Track the highest gfn for which we have ever had a valid mapping */
-    if ( p2mt != p2m_invalid &&
-         (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
+    rc = atomic_write_ept_entry(ept_entry, new_entry, target);
+    if ( unlikely(rc) )
+        old_entry.epte = 0;
+    else if ( p2mt != p2m_invalid &&
+              (gfn + (1UL << order) - 1 > p2m->max_mapped_pfn) )
+        /* Track the highest gfn for which we have ever had a valid mapping */
         p2m->max_mapped_pfn = gfn + (1UL << order) - 1;
 
 out:
@@ -893,7 +960,7 @@ static void ept_change_entry_type_global(struct p2m_domain *p2m,
     if ( !mfn )
         return;
 
-    if ( ept_invalidate_emt(_mfn(mfn), 1) )
+    if ( ept_invalidate_emt(_mfn(mfn), 1, ept_get_wl(&p2m->ept)) )
         ept_sync_domain(p2m);
 }
 
@@ -951,7 +1018,7 @@ static void ept_memory_type_changed(struct p2m_domain *p2m)
     if ( !mfn )
         return;
 
-    if ( ept_invalidate_emt(_mfn(mfn), 0) )
+    if ( ept_invalidate_emt(_mfn(mfn), 0, ept_get_wl(&p2m->ept)) )
         ept_sync_domain(p2m);
 }
 
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index cd9867a..a1794d0 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -513,6 +513,13 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         __trace_var(TRC_MEM_SET_P2M_ENTRY, 0, sizeof(t), &t);
     }
 
+    if ( unlikely(p2m_is_foreign(p2mt)) )
+    {
+        /* pvh fixme: foreign types are only supported on ept at present */
+        gdprintk(XENLOG_WARNING, "Unimplemented foreign p2m type.\n");
+        return -EINVAL;
+    }
+
     /* Carry out any eventually pending earlier changes first. */
     rc = do_recalc(p2m, gfn);
     if ( rc < 0 )
diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index b50747a..642ec28 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -36,6 +36,7 @@
 #include <xen/event.h>
 #include <asm/hvm/nestedhvm.h>
 #include <asm/hvm/svm/amd-iommu-proto.h>
+#include <xsm/xsm.h>
 
 #include "mm-locks.h"
 
@@ -311,14 +312,20 @@ struct page_info *get_page_from_gfn_p2m(
         /* Fast path: look up and get out */
         p2m_read_lock(p2m);
         mfn = __get_gfn_type_access(p2m, gfn, t, a, 0, NULL, 0);
-        if ( (p2m_is_ram(*t) || p2m_is_grant(*t))
-             && mfn_valid(mfn)
+        if ( p2m_is_any_ram(*t) && mfn_valid(mfn)
              && !((q & P2M_UNSHARE) && p2m_is_shared(*t)) )
         {
             page = mfn_to_page(mfn);
-            if ( !get_page(page, d)
-                 /* Page could be shared */
-                 && !get_page(page, dom_cow) )
+            if ( unlikely(p2m_is_foreign(*t)) )
+            {
+                struct domain *fdom = page_get_owner_and_reference(page);
+                ASSERT(fdom != d);
+                if ( fdom == NULL )
+                    page = NULL;
+            }
+            else if ( !get_page(page, d)
+                      /* Page could be shared */
+                      && !get_page(page, dom_cow) )
                 page = NULL;
         }
         p2m_read_unlock(p2m);
@@ -468,6 +475,10 @@ int p2m_alloc_table(struct p2m_domain *p2m)
     return rc;
 }
 
+/*
+ * pvh fixme: when adding support for pvh non-hardware domains, this path must
+ * cleanup any foreign p2m types (release refcnts on them).
+ */
 void p2m_teardown(struct p2m_domain *p2m)
 /* Return all the p2m pages to Xen.
  * We know we don't have any extra mappings to these pages */
@@ -836,8 +847,8 @@ static int set_typed_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn,
 }
 
 /* Set foreign mfn in the given guest's p2m table. */
-static int __attribute__((unused))
-set_foreign_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn)
+static int set_foreign_p2m_entry(struct domain *d, unsigned long gfn,
+                                 mfn_t mfn)
 {
     return set_typed_p2m_entry(d, gfn, mfn, p2m_map_foreign);
 }
@@ -1794,6 +1805,107 @@ out_p2m_audit:
 #endif /* P2M_AUDIT */
 
 /*
+ * Add frame from foreign domain to target domain's physmap. Similar to
+ * XENMAPSPACE_gmfn but the frame is foreign being mapped into current,
+ * and is not removed from foreign domain.
+ *
+ * Usage: - libxl on pvh dom0 creating a guest and doing privcmd_ioctl_mmap.
+ *        - xentrace running on dom0 mapping xenheap pages. foreigndom would
+ *          be DOMID_XEN in such a case.
+ *        etc..
+ *
+ * Side Effect: the mfn for fgfn will be refcounted in lower level routines
+ *              so it is not lost while mapped here. The refcnt is released
+ *              via the XENMEM_remove_from_physmap path.
+ *
+ * Returns: 0 ==> success
+ */
+int p2m_add_foreign(struct domain *tdom, unsigned long fgfn,
+                    unsigned long gpfn, domid_t foreigndom)
+{
+    p2m_type_t p2mt, p2mt_prev;
+    unsigned long prev_mfn, mfn;
+    struct page_info *page;
+    int rc;
+    struct domain *fdom;
+
+    ASSERT(tdom);
+    if ( foreigndom == DOMID_SELF || !is_pvh_domain(tdom) )
+        return -EINVAL;
+    /*
+     * pvh fixme: until support is added to p2m teardown code to cleanup any
+     * foreign entries, limit this to hardware domain only.
+     */
+    if ( !is_hardware_domain(tdom) )
+        return -EPERM;
+
+    if ( foreigndom == DOMID_XEN )
+        fdom = rcu_lock_domain(dom_xen);
+    else
+        fdom = rcu_lock_domain_by_id(foreigndom);
+    if ( fdom == NULL )
+        return -ESRCH;
+
+    rc = -EINVAL;
+    if ( tdom == fdom )
+        goto out;
+
+    rc = xsm_map_gmfn_foreign(XSM_TARGET, tdom, fdom);
+    if ( rc )
+        goto out;
+
+    /*
+     * Take a refcnt on the mfn. NB: following supported for foreign mapping:
+     *     ram_rw | ram_logdirty | ram_ro | paging_out.
+     */
+    page = get_page_from_gfn(fdom, fgfn, &p2mt, P2M_ALLOC);
+    if ( !page ||
+         !p2m_is_ram(p2mt) || p2m_is_shared(p2mt) || p2m_is_hole(p2mt) )
+    {
+        if ( page )
+            put_page(page);
+        rc = -EINVAL;
+        goto out;
+    }
+    mfn = mfn_x(page_to_mfn(page));
+
+    /* Remove previously mapped page if it is present. */
+    prev_mfn = mfn_x(get_gfn(tdom, gpfn, &p2mt_prev));
+    if ( mfn_valid(_mfn(prev_mfn)) )
+    {
+        if ( is_xen_heap_mfn(prev_mfn) )
+            /* Xen heap frames are simply unhooked from this phys slot */
+            guest_physmap_remove_page(tdom, gpfn, prev_mfn, 0);
+        else
+            /* Normal domain memory is freed, to avoid leaking memory. */
+            guest_remove_page(tdom, gpfn);
+    }
+    /*
+     * Create the new mapping. Can't use guest_physmap_add_page() because it
+     * will update the m2p table which will result in  mfn -> gpfn of dom0
+     * and not fgfn of domU.
+     */
+    rc = set_foreign_p2m_entry(tdom, gpfn, _mfn(mfn));
+    if ( rc )
+        gdprintk(XENLOG_WARNING, "set_foreign_p2m_entry failed. "
+                 "gpfn:%lx mfn:%lx fgfn:%lx td:%d fd:%d\n",
+                 gpfn, mfn, fgfn, tdom->domain_id, fdom->domain_id);
+
+    put_page(page);
+
+    /*
+     * This put_gfn for the above get_gfn for prev_mfn.  We must do this
+     * after set_foreign_p2m_entry so another cpu doesn't populate the gpfn
+     * before us.
+     */
+    put_gfn(tdom, gpfn);
+
+out:
+    if ( fdom )
+        rcu_unlock_domain(fdom);
+    return rc;
+}
+/*
  * Local variables:
  * mode: C
  * c-file-style: "BSD"
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index 027f011..d0cfdac 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -188,6 +188,10 @@ typedef unsigned int p2m_query_t;
 #define p2m_is_broken(_t)   (p2m_to_mask(_t) & P2M_BROKEN_TYPES)
 #define p2m_is_foreign(_t)  (p2m_to_mask(_t) & p2m_to_mask(p2m_map_foreign))
 
+#define p2m_is_any_ram(_t)  (p2m_to_mask(_t) &                   \
+                             (P2M_RAM_TYPES | P2M_GRANT_TYPES |  \
+                              p2m_to_mask(p2m_map_foreign)))
+
 /* Per-p2m-table state */
 struct p2m_domain {
     /* Lock that protects updates to the p2m */
@@ -532,6 +536,9 @@ int p2m_is_logdirty_range(struct p2m_domain *, unsigned long start,
 int set_mmio_p2m_entry(struct domain *d, unsigned long gfn, mfn_t mfn);
 int clear_mmio_p2m_entry(struct domain *d, unsigned long gfn);
 
+/* Add foreign mapping to the guest's p2m table. */
+int p2m_add_foreign(struct domain *tdom, unsigned long fgfn,
+                    unsigned long gpfn, domid_t foreign_domid);
 
 /* 
  * Populate-on-demand
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3K-0000YQ-QZ; Thu, 19 Jun 2014 04:34:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3I-0000Y2-TL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:21 +0000
Received: from [85.158.143.35:51821] by server-1.bemta-4.messagelabs.com id
	0A/BF-09496-C4862A35; Thu, 19 Jun 2014 04:34:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1403152458!12370631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11308 invoked from network); 19 Jun 2014 04:34:19 -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;
	19 Jun 2014 04:34:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3G-0002QW-F3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3G-0007OX-Be
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:18 +0000
Date: Thu, 19 Jun 2014 04:34:18 +0000
Message-Id: <E1WxU3G-0007OX-Be@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pvh dom0: allow get_pg_owner for
	translated domains if pvh
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 594e6fd413d646521cc29b38bc89f897b4570977
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Mon Jun 2 10:31:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:31:49 2014 +0200

    pvh dom0: allow get_pg_owner for translated domains if pvh
    
    When creating a PV guest, toolstack on pvh dom0 will do_mmuext_op
    to pin guest tables. do_mmuext_op calls get_pg_owner, which must allow
    foreign mappings for pvh.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/x86/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dd8d98c..2543916 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2811,7 +2811,7 @@ static struct domain *get_pg_owner(domid_t domid)
         goto out;
     }
 
-    if ( unlikely(paging_mode_translate(curr)) )
+    if ( !is_pvh_domain(curr) && unlikely(paging_mode_translate(curr)) )
     {
         MEM_LOG("Cannot mix foreign mappings with translated domains");
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3K-0000YQ-QZ; Thu, 19 Jun 2014 04:34:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3I-0000Y2-TL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:21 +0000
Received: from [85.158.143.35:51821] by server-1.bemta-4.messagelabs.com id
	0A/BF-09496-C4862A35; Thu, 19 Jun 2014 04:34:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1403152458!12370631!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11308 invoked from network); 19 Jun 2014 04:34:19 -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;
	19 Jun 2014 04:34:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3G-0002QW-F3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3G-0007OX-Be
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:18 +0000
Date: Thu, 19 Jun 2014 04:34:18 +0000
Message-Id: <E1WxU3G-0007OX-Be@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pvh dom0: allow get_pg_owner for
	translated domains if pvh
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 594e6fd413d646521cc29b38bc89f897b4570977
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Mon Jun 2 10:31:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:31:49 2014 +0200

    pvh dom0: allow get_pg_owner for translated domains if pvh
    
    When creating a PV guest, toolstack on pvh dom0 will do_mmuext_op
    to pin guest tables. do_mmuext_op calls get_pg_owner, which must allow
    foreign mappings for pvh.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/x86/mm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index dd8d98c..2543916 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2811,7 +2811,7 @@ static struct domain *get_pg_owner(domid_t domid)
         goto out;
     }
 
-    if ( unlikely(paging_mode_translate(curr)) )
+    if ( !is_pvh_domain(curr) && unlikely(paging_mode_translate(curr)) )
     {
         MEM_LOG("Cannot mix foreign mappings with translated domains");
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3U-0000a9-V2; Thu, 19 Jun 2014 04:34:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3T-0000Zv-Gf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:31 +0000
Received: from [85.158.137.68:9558] by server-10.bemta-3.messagelabs.com id
	89/9C-09305-65862A35; Thu, 19 Jun 2014 04:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1403152468!10952704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5942 invoked from network); 19 Jun 2014 04:34:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:34:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3Q-0002Qc-Kd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3Q-0007P7-JR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:28 +0000
Date: Thu, 19 Jun 2014 04:34:28 +0000
Message-Id: <E1WxU3Q-0007P7-JR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] dom0: add opt_dom0pvh to setup.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6390ad57bdf11881e6375f6227b5a594b4bcc3f
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Mon Jun 2 10:32:22 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:32:22 2014 +0200

    dom0: add opt_dom0pvh to setup.c
    
    Finally last patch in the series to enable creation of pvh dom0.
    A pvh dom0 is created by adding dom0pvh to grub xen command line.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/misc/pvh-readme.txt            |    2 ++
 docs/misc/xen-command-line.markdown |    7 +++++++
 xen/arch/x86/setup.c                |   11 +++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/docs/misc/pvh-readme.txt b/docs/misc/pvh-readme.txt
index 9fea137..c5b3de4 100644
--- a/docs/misc/pvh-readme.txt
+++ b/docs/misc/pvh-readme.txt
@@ -37,6 +37,8 @@ supported. Phase I patches are broken into three parts:
    - tools changes for creating a PVH guest
    - boot of 64bit dom0 in PVH mode.
 
+To boot 64bit dom0 in PVH mode, add dom0pvh to grub xen command line.
+
 Following fixme's exist in the code:
   - arch/x86/time.c: support more tsc modes.
 
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a7ac53d..b45ba7e 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -494,6 +494,13 @@ Practices](http://wiki.xen.org/wiki/Xen_Best_Practices#Xen_dom0_dedicated_memory
 
 Pin dom0 vcpus to their respective pcpus
 
+### dom0pvh
+> `= <boolean>`
+
+> Default: `false`
+
+Flag that makes a 64bit dom0 boot in PVH mode. No 32bit support at present.
+
 ### e820-mtrr-clip
 > `= <boolean>`
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 508649d..d7df750 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -65,6 +65,10 @@ invbool_param("smep", disable_smep);
 static bool_t __initdata disable_smap;
 invbool_param("smap", disable_smap);
 
+/* Boot dom0 in pvh mode */
+static bool_t __initdata opt_dom0pvh;
+boolean_param("dom0pvh", opt_dom0pvh);
+
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
 /* "acpi=force":  Override the disable blacklist.                   */
@@ -539,7 +543,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 {
     char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
-    unsigned int initrdidx;
+    unsigned int initrdidx, domcr_flags = DOMCRF_s3_integrity;
     multiboot_info_t *mbi = __va(mbi_p);
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     unsigned long nr_pages, raw_max_page, modules_headroom, *module_map;
@@ -1345,8 +1349,11 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( !tboot_protect_mem_regions() )
         panic("Could not protect TXT memory regions");
 
+    if ( opt_dom0pvh )
+        domcr_flags |= DOMCRF_pvh | DOMCRF_hap;
+
     /* Create initial domain 0. */
-    dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
+    dom0 = domain_create(0, domcr_flags, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
         panic("Error creating domain 0");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3U-0000a9-V2; Thu, 19 Jun 2014 04:34:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3T-0000Zv-Gf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:31 +0000
Received: from [85.158.137.68:9558] by server-10.bemta-3.messagelabs.com id
	89/9C-09305-65862A35; Thu, 19 Jun 2014 04:34:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1403152468!10952704!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5942 invoked from network); 19 Jun 2014 04:34:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:34:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3Q-0002Qc-Kd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3Q-0007P7-JR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:28 +0000
Date: Thu, 19 Jun 2014 04:34:28 +0000
Message-Id: <E1WxU3Q-0007P7-JR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] dom0: add opt_dom0pvh to setup.c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e6390ad57bdf11881e6375f6227b5a594b4bcc3f
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Mon Jun 2 10:32:22 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 2 10:32:22 2014 +0200

    dom0: add opt_dom0pvh to setup.c
    
    Finally last patch in the series to enable creation of pvh dom0.
    A pvh dom0 is created by adding dom0pvh to grub xen command line.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 docs/misc/pvh-readme.txt            |    2 ++
 docs/misc/xen-command-line.markdown |    7 +++++++
 xen/arch/x86/setup.c                |   11 +++++++++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/docs/misc/pvh-readme.txt b/docs/misc/pvh-readme.txt
index 9fea137..c5b3de4 100644
--- a/docs/misc/pvh-readme.txt
+++ b/docs/misc/pvh-readme.txt
@@ -37,6 +37,8 @@ supported. Phase I patches are broken into three parts:
    - tools changes for creating a PVH guest
    - boot of 64bit dom0 in PVH mode.
 
+To boot 64bit dom0 in PVH mode, add dom0pvh to grub xen command line.
+
 Following fixme's exist in the code:
   - arch/x86/time.c: support more tsc modes.
 
diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index a7ac53d..b45ba7e 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -494,6 +494,13 @@ Practices](http://wiki.xen.org/wiki/Xen_Best_Practices#Xen_dom0_dedicated_memory
 
 Pin dom0 vcpus to their respective pcpus
 
+### dom0pvh
+> `= <boolean>`
+
+> Default: `false`
+
+Flag that makes a 64bit dom0 boot in PVH mode. No 32bit support at present.
+
 ### e820-mtrr-clip
 > `= <boolean>`
 
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 508649d..d7df750 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -65,6 +65,10 @@ invbool_param("smep", disable_smep);
 static bool_t __initdata disable_smap;
 invbool_param("smap", disable_smap);
 
+/* Boot dom0 in pvh mode */
+static bool_t __initdata opt_dom0pvh;
+boolean_param("dom0pvh", opt_dom0pvh);
+
 /* **** Linux config option: propagated to domain0. */
 /* "acpi=off":    Sisables both ACPI table parsing and interpreter. */
 /* "acpi=force":  Override the disable blacklist.                   */
@@ -539,7 +543,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 {
     char *memmap_type = NULL;
     char *cmdline, *kextra, *loader;
-    unsigned int initrdidx;
+    unsigned int initrdidx, domcr_flags = DOMCRF_s3_integrity;
     multiboot_info_t *mbi = __va(mbi_p);
     module_t *mod = (module_t *)__va(mbi->mods_addr);
     unsigned long nr_pages, raw_max_page, modules_headroom, *module_map;
@@ -1345,8 +1349,11 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( !tboot_protect_mem_regions() )
         panic("Could not protect TXT memory regions");
 
+    if ( opt_dom0pvh )
+        domcr_flags |= DOMCRF_pvh | DOMCRF_hap;
+
     /* Create initial domain 0. */
-    dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
+    dom0 = domain_create(0, domcr_flags, 0);
     if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
         panic("Error creating domain 0");
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3g-0000c2-1p; Thu, 19 Jun 2014 04:34:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3d-0000bg-VS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:42 +0000
Received: from [193.109.254.147:14108] by server-11.bemta-14.messagelabs.com
	id 78/6D-09902-16862A35; Thu, 19 Jun 2014 04:34:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403152479!12248804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10065 invoked from network); 19 Jun 2014 04:34:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:34:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3a-0002Qi-Rt
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3a-0007Ph-QP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:38 +0000
Date: Thu, 19 Jun 2014 04:34:38 +0000
Message-Id: <E1WxU3a-0007Ph-QP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce asynchronous
	execution API
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3916203231355713478=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 0716682851b9c29f3464b807246077aa085734cd
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon May 5 12:14:25 2014 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:34:56 2014 +0100

    libxl: introduce asynchronous execution API
    
    1.introduce asynchronous execution API:
      libxl__async_exec_init
      libxl__async_exec_start
      libxl__async_exec_inuse
    2.use the async exec API to execute device hotplug scripts
    
    Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_aoutils.c  |   89 ++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_device.c   |   78 ++++++++++--------------------------
 tools/libxl/libxl_internal.h |   34 ++++++++++++++--
 3 files changed, 141 insertions(+), 60 deletions(-)

diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index 1c9eb9e..b10d2e1 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -451,3 +451,92 @@ int libxl__openptys(libxl__openpty_state *op,
     return rc;
 }
 
+static void async_exec_timeout(libxl__egc *egc,
+                               libxl__ev_time *ev,
+                               const struct timeval *requested_abs)
+{
+    libxl__async_exec_state *aes = CONTAINER_OF(ev, *aes, time);
+    STATE_AO_GC(aes->ao);
+
+    libxl__ev_time_deregister(gc, &aes->time);
+
+    assert(libxl__ev_child_inuse(&aes->child));
+    LOG(ERROR, "killing execution of %s because of timeout", aes->what);
+
+    if (kill(aes->child.pid, SIGKILL)) {
+        LOGEV(ERROR, errno, "unable to kill %s [%ld]",
+              aes->what, (unsigned long)aes->child.pid);
+    }
+
+    return;
+}
+
+static void async_exec_done(libxl__egc *egc,
+                            libxl__ev_child *child,
+                            pid_t pid, int status)
+{
+    libxl__async_exec_state *aes = CONTAINER_OF(child, *aes, child);
+    STATE_AO_GC(aes->ao);
+
+    libxl__ev_time_deregister(gc, &aes->time);
+
+    if (status) {
+        libxl_report_child_exitstatus(CTX, LIBXL__LOG_ERROR,
+                                      aes->what, pid, status);
+    }
+
+    aes->callback(egc, aes, status);
+}
+
+void libxl__async_exec_init(libxl__async_exec_state *aes)
+{
+    libxl__ev_time_init(&aes->time);
+    libxl__ev_child_init(&aes->child);
+}
+
+int libxl__async_exec_start(libxl__gc *gc, libxl__async_exec_state *aes)
+{
+    pid_t pid;
+
+    /* Convenience aliases */
+    libxl__ev_child *const child = &aes->child;
+    char ** const args = aes->args;
+
+    /* Set execution timeout */
+    if (libxl__ev_time_register_rel(gc, &aes->time,
+                                    async_exec_timeout,
+                                    aes->timeout_ms)) {
+        LOG(ERROR, "unable to register timeout for executing: %s", aes->what);
+        goto out;
+    }
+
+    LOG(DEBUG, "forking to execute: %s ", aes->what);
+
+    /* Fork and exec */
+    pid = libxl__ev_child_fork(gc, child, async_exec_done);
+    if (pid == -1) {
+        LOG(ERROR, "unable to fork");
+        goto out;
+    }
+
+    if (!pid) {
+        /* child */
+        libxl__exec(gc, aes->stdfds[0], aes->stdfds[1],
+                    aes->stdfds[2], args[0], args, aes->env);
+        /* notreached */
+        abort();
+    }
+
+    return 0;
+
+out:
+    return ERROR_FAIL;
+}
+
+bool libxl__async_exec_inuse(const libxl__async_exec_state *aes)
+{
+    bool time_inuse = libxl__ev_time_isregistered(&aes->time);
+    bool child_inuse = libxl__ev_child_inuse(&aes->child);
+    assert(time_inuse == child_inuse);
+    return child_inuse;
+}
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index fa99f77..90ae564 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -430,7 +430,7 @@ void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev)
     aodev->rc = 0;
     aodev->dev = NULL;
     aodev->num_exec = 0;
-    /* Initialize timer for QEMU Bodge and hotplug execution */
+    /* Initialize timer for QEMU Bodge */
     libxl__ev_time_init(&aodev->timeout);
     /*
      * Initialize xs_watch, because it's not used on all possible
@@ -440,7 +440,7 @@ void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev)
     aodev->active = 1;
     /* We init this here because we might call device_hotplug_done
      * without actually calling any hotplug script */
-    libxl__ev_child_init(&aodev->child);
+    libxl__async_exec_init(&aodev->aes);
 }
 
 /* multidev */
@@ -707,12 +707,9 @@ static void device_backend_cleanup(libxl__gc *gc,
 
 static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev);
 
-static void device_hotplug_timeout_cb(libxl__egc *egc, libxl__ev_time *ev,
-                                      const struct timeval *requested_abs);
-
 static void device_hotplug_child_death_cb(libxl__egc *egc,
-                                          libxl__ev_child *child,
-                                          pid_t pid, int status);
+                                          libxl__async_exec_state *aes,
+                                          int status);
 
 static void device_destroy_be_timeout_cb(libxl__egc *egc, libxl__ev_time *ev,
                                          const struct timeval *requested_abs);
@@ -953,11 +950,11 @@ static void device_backend_cleanup(libxl__gc *gc, libxl__ao_device *aodev)
 static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
 {
     STATE_AO_GC(aodev->ao);
+    libxl__async_exec_state *aes = &aodev->aes;
     char *be_path = libxl__device_backend_path(gc, aodev->dev);
     char **args = NULL, **env = NULL;
     int rc = 0;
     int hotplug, nullfd = -1;
-    pid_t pid;
     uint32_t domid;
 
     /*
@@ -1009,16 +1006,6 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
         goto out;
     }
 
-    /* Set hotplug timeout */
-    rc = libxl__ev_time_register_rel(gc, &aodev->timeout,
-                                     device_hotplug_timeout_cb,
-                                     LIBXL_HOTPLUG_TIMEOUT * 1000);
-    if (rc) {
-        LOG(ERROR, "unable to register timeout for hotplug device %s", be_path);
-        goto out;
-    }
-
-    aodev->what = GCSPRINTF("%s %s", args[0], args[1]);
     LOG(DEBUG, "calling hotplug script: %s %s", args[0], args[1]);
 
     nullfd = open("/dev/null", O_RDONLY);
@@ -1028,23 +1015,22 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
         goto out;
     }
 
-    /* fork and execute hotplug script */
-    pid = libxl__ev_child_fork(gc, &aodev->child, device_hotplug_child_death_cb);
-    if (pid == -1) {
-        LOG(ERROR, "unable to fork");
-        rc = ERROR_FAIL;
+    aes->ao = ao;
+    aes->what = GCSPRINTF("%s %s", args[0], args[1]);
+    aes->env = env;
+    aes->args = args;
+    aes->callback = device_hotplug_child_death_cb;
+    aes->timeout_ms = LIBXL_HOTPLUG_TIMEOUT * 1000;
+    aes->stdfds[0] = nullfd;
+    aes->stdfds[1] = 2;
+    aes->stdfds[2] = -1;
+
+    rc = libxl__async_exec_start(gc, aes);
+    if (rc)
         goto out;
-    }
-
-    if (!pid) {
-        /* child */
-        libxl__exec(gc, nullfd, 2, -1, args[0], args, env);
-        /* notreached */
-        abort();
-    }
 
     close(nullfd);
-    assert(libxl__ev_child_inuse(&aodev->child));
+    assert(libxl__async_exec_inuse(&aodev->aes));
 
     return;
 
@@ -1055,29 +1041,11 @@ out:
     return;
 }
 
-static void device_hotplug_timeout_cb(libxl__egc *egc, libxl__ev_time *ev,
-                                      const struct timeval *requested_abs)
-{
-    libxl__ao_device *aodev = CONTAINER_OF(ev, *aodev, timeout);
-    STATE_AO_GC(aodev->ao);
-
-    libxl__ev_time_deregister(gc, &aodev->timeout);
-
-    assert(libxl__ev_child_inuse(&aodev->child));
-    LOG(DEBUG, "killing hotplug script %s because of timeout", aodev->what);
-    if (kill(aodev->child.pid, SIGKILL)) {
-        LOGEV(ERROR, errno, "unable to kill hotplug script %s [%ld]",
-                            aodev->what, (unsigned long)aodev->child.pid);
-    }
-
-    return;
-}
-
 static void device_hotplug_child_death_cb(libxl__egc *egc,
-                                          libxl__ev_child *child,
-                                          pid_t pid, int status)
+                                          libxl__async_exec_state *aes,
+                                          int status)
 {
-    libxl__ao_device *aodev = CONTAINER_OF(child, *aodev, child);
+    libxl__ao_device *aodev = CONTAINER_OF(aes, *aodev, aes);
     STATE_AO_GC(aodev->ao);
     char *be_path = libxl__device_backend_path(gc, aodev->dev);
     char *hotplug_error;
@@ -1085,8 +1053,6 @@ static void device_hotplug_child_death_cb(libxl__egc *egc,
     device_hotplug_clean(gc, aodev);
 
     if (status) {
-        libxl_report_child_exitstatus(CTX, LIBXL__LOG_ERROR,
-                                      aodev->what, pid, status);
         hotplug_error = libxl__xs_read(gc, XBT_NULL,
                                        GCSPRINTF("%s/hotplug-error", be_path));
         if (hotplug_error)
@@ -1178,7 +1144,7 @@ static void device_hotplug_clean(libxl__gc *gc, libxl__ao_device *aodev)
     /* Clean events and check reentrancy */
     libxl__ev_time_deregister(gc, &aodev->timeout);
     libxl__ev_xswatch_deregister(gc, &aodev->xs_watch);
-    assert(!libxl__ev_child_inuse(&aodev->child));
+    assert(!libxl__async_exec_inuse(&aodev->aes));
 }
 
 static void devices_remove_callback(libxl__egc *egc,
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 082749e..5968485 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2050,6 +2050,33 @@ _hidden const char *libxl__xen_script_dir_path(void);
 _hidden const char *libxl__lock_dir_path(void);
 _hidden const char *libxl__run_dir_path(void);
 
+/*----- subprocess execution with timeout -----*/
+
+typedef struct libxl__async_exec_state libxl__async_exec_state;
+
+typedef void libxl__async_exec_callback(libxl__egc *egc,
+                        libxl__async_exec_state *aes, int status);
+
+struct libxl__async_exec_state {
+    /* caller must fill these in */
+    libxl__ao *ao;
+    const char *what; /* for error msgs, what we're executing */
+    int timeout_ms;
+    libxl__async_exec_callback *callback;
+    /* caller must fill in; as for libxl__exec */
+    int stdfds[3];
+    char **args; /* execution arguments */
+    char **env; /* execution environment */
+
+    /* private */
+    libxl__ev_time time;
+    libxl__ev_child child;
+};
+
+void libxl__async_exec_init(libxl__async_exec_state *aes);
+int libxl__async_exec_start(libxl__gc *gc, libxl__async_exec_state *aes);
+bool libxl__async_exec_inuse(const libxl__async_exec_state *aes);
+
 /*----- device addition/removal -----*/
 
 typedef struct libxl__ao_device libxl__ao_device;
@@ -2086,14 +2113,13 @@ struct libxl__ao_device {
     libxl__multidev *multidev; /* reference to the containing multidev */
     /* private for add/remove implementation */
     libxl__ev_devstate backend_ds;
-    /* Bodge for Qemu devices, also used for timeout of hotplug execution */
+    /* Bodge for Qemu devices */
     libxl__ev_time timeout;
     /* xenstore watch for backend path of driver domains */
     libxl__ev_xswatch xs_watch;
-    /* device hotplug execution */
-    const char *what;
     int num_exec;
-    libxl__ev_child child;
+    /* for calling hotplug scripts */
+    libxl__async_exec_state aes;
 };
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3g-0000c2-1p; Thu, 19 Jun 2014 04:34:44 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3d-0000bg-VS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:42 +0000
Received: from [193.109.254.147:14108] by server-11.bemta-14.messagelabs.com
	id 78/6D-09902-16862A35; Thu, 19 Jun 2014 04:34:41 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403152479!12248804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10065 invoked from network); 19 Jun 2014 04:34:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:34:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3a-0002Qi-Rt
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3a-0007Ph-QP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:38 +0000
Date: Thu, 19 Jun 2014 04:34:38 +0000
Message-Id: <E1WxU3a-0007Ph-QP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce asynchronous
	execution API
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3916203231355713478=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 0716682851b9c29f3464b807246077aa085734cd
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Mon May 5 12:14:25 2014 +0800
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:34:56 2014 +0100

    libxl: introduce asynchronous execution API
    
    1.introduce asynchronous execution API:
      libxl__async_exec_init
      libxl__async_exec_start
      libxl__async_exec_inuse
    2.use the async exec API to execute device hotplug scripts
    
    Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
    Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    Acked-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_aoutils.c  |   89 ++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_device.c   |   78 ++++++++++--------------------------
 tools/libxl/libxl_internal.h |   34 ++++++++++++++--
 3 files changed, 141 insertions(+), 60 deletions(-)

diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index 1c9eb9e..b10d2e1 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -451,3 +451,92 @@ int libxl__openptys(libxl__openpty_state *op,
     return rc;
 }
 
+static void async_exec_timeout(libxl__egc *egc,
+                               libxl__ev_time *ev,
+                               const struct timeval *requested_abs)
+{
+    libxl__async_exec_state *aes = CONTAINER_OF(ev, *aes, time);
+    STATE_AO_GC(aes->ao);
+
+    libxl__ev_time_deregister(gc, &aes->time);
+
+    assert(libxl__ev_child_inuse(&aes->child));
+    LOG(ERROR, "killing execution of %s because of timeout", aes->what);
+
+    if (kill(aes->child.pid, SIGKILL)) {
+        LOGEV(ERROR, errno, "unable to kill %s [%ld]",
+              aes->what, (unsigned long)aes->child.pid);
+    }
+
+    return;
+}
+
+static void async_exec_done(libxl__egc *egc,
+                            libxl__ev_child *child,
+                            pid_t pid, int status)
+{
+    libxl__async_exec_state *aes = CONTAINER_OF(child, *aes, child);
+    STATE_AO_GC(aes->ao);
+
+    libxl__ev_time_deregister(gc, &aes->time);
+
+    if (status) {
+        libxl_report_child_exitstatus(CTX, LIBXL__LOG_ERROR,
+                                      aes->what, pid, status);
+    }
+
+    aes->callback(egc, aes, status);
+}
+
+void libxl__async_exec_init(libxl__async_exec_state *aes)
+{
+    libxl__ev_time_init(&aes->time);
+    libxl__ev_child_init(&aes->child);
+}
+
+int libxl__async_exec_start(libxl__gc *gc, libxl__async_exec_state *aes)
+{
+    pid_t pid;
+
+    /* Convenience aliases */
+    libxl__ev_child *const child = &aes->child;
+    char ** const args = aes->args;
+
+    /* Set execution timeout */
+    if (libxl__ev_time_register_rel(gc, &aes->time,
+                                    async_exec_timeout,
+                                    aes->timeout_ms)) {
+        LOG(ERROR, "unable to register timeout for executing: %s", aes->what);
+        goto out;
+    }
+
+    LOG(DEBUG, "forking to execute: %s ", aes->what);
+
+    /* Fork and exec */
+    pid = libxl__ev_child_fork(gc, child, async_exec_done);
+    if (pid == -1) {
+        LOG(ERROR, "unable to fork");
+        goto out;
+    }
+
+    if (!pid) {
+        /* child */
+        libxl__exec(gc, aes->stdfds[0], aes->stdfds[1],
+                    aes->stdfds[2], args[0], args, aes->env);
+        /* notreached */
+        abort();
+    }
+
+    return 0;
+
+out:
+    return ERROR_FAIL;
+}
+
+bool libxl__async_exec_inuse(const libxl__async_exec_state *aes)
+{
+    bool time_inuse = libxl__ev_time_isregistered(&aes->time);
+    bool child_inuse = libxl__ev_child_inuse(&aes->child);
+    assert(time_inuse == child_inuse);
+    return child_inuse;
+}
diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index fa99f77..90ae564 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -430,7 +430,7 @@ void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev)
     aodev->rc = 0;
     aodev->dev = NULL;
     aodev->num_exec = 0;
-    /* Initialize timer for QEMU Bodge and hotplug execution */
+    /* Initialize timer for QEMU Bodge */
     libxl__ev_time_init(&aodev->timeout);
     /*
      * Initialize xs_watch, because it's not used on all possible
@@ -440,7 +440,7 @@ void libxl__prepare_ao_device(libxl__ao *ao, libxl__ao_device *aodev)
     aodev->active = 1;
     /* We init this here because we might call device_hotplug_done
      * without actually calling any hotplug script */
-    libxl__ev_child_init(&aodev->child);
+    libxl__async_exec_init(&aodev->aes);
 }
 
 /* multidev */
@@ -707,12 +707,9 @@ static void device_backend_cleanup(libxl__gc *gc,
 
 static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev);
 
-static void device_hotplug_timeout_cb(libxl__egc *egc, libxl__ev_time *ev,
-                                      const struct timeval *requested_abs);
-
 static void device_hotplug_child_death_cb(libxl__egc *egc,
-                                          libxl__ev_child *child,
-                                          pid_t pid, int status);
+                                          libxl__async_exec_state *aes,
+                                          int status);
 
 static void device_destroy_be_timeout_cb(libxl__egc *egc, libxl__ev_time *ev,
                                          const struct timeval *requested_abs);
@@ -953,11 +950,11 @@ static void device_backend_cleanup(libxl__gc *gc, libxl__ao_device *aodev)
 static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
 {
     STATE_AO_GC(aodev->ao);
+    libxl__async_exec_state *aes = &aodev->aes;
     char *be_path = libxl__device_backend_path(gc, aodev->dev);
     char **args = NULL, **env = NULL;
     int rc = 0;
     int hotplug, nullfd = -1;
-    pid_t pid;
     uint32_t domid;
 
     /*
@@ -1009,16 +1006,6 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
         goto out;
     }
 
-    /* Set hotplug timeout */
-    rc = libxl__ev_time_register_rel(gc, &aodev->timeout,
-                                     device_hotplug_timeout_cb,
-                                     LIBXL_HOTPLUG_TIMEOUT * 1000);
-    if (rc) {
-        LOG(ERROR, "unable to register timeout for hotplug device %s", be_path);
-        goto out;
-    }
-
-    aodev->what = GCSPRINTF("%s %s", args[0], args[1]);
     LOG(DEBUG, "calling hotplug script: %s %s", args[0], args[1]);
 
     nullfd = open("/dev/null", O_RDONLY);
@@ -1028,23 +1015,22 @@ static void device_hotplug(libxl__egc *egc, libxl__ao_device *aodev)
         goto out;
     }
 
-    /* fork and execute hotplug script */
-    pid = libxl__ev_child_fork(gc, &aodev->child, device_hotplug_child_death_cb);
-    if (pid == -1) {
-        LOG(ERROR, "unable to fork");
-        rc = ERROR_FAIL;
+    aes->ao = ao;
+    aes->what = GCSPRINTF("%s %s", args[0], args[1]);
+    aes->env = env;
+    aes->args = args;
+    aes->callback = device_hotplug_child_death_cb;
+    aes->timeout_ms = LIBXL_HOTPLUG_TIMEOUT * 1000;
+    aes->stdfds[0] = nullfd;
+    aes->stdfds[1] = 2;
+    aes->stdfds[2] = -1;
+
+    rc = libxl__async_exec_start(gc, aes);
+    if (rc)
         goto out;
-    }
-
-    if (!pid) {
-        /* child */
-        libxl__exec(gc, nullfd, 2, -1, args[0], args, env);
-        /* notreached */
-        abort();
-    }
 
     close(nullfd);
-    assert(libxl__ev_child_inuse(&aodev->child));
+    assert(libxl__async_exec_inuse(&aodev->aes));
 
     return;
 
@@ -1055,29 +1041,11 @@ out:
     return;
 }
 
-static void device_hotplug_timeout_cb(libxl__egc *egc, libxl__ev_time *ev,
-                                      const struct timeval *requested_abs)
-{
-    libxl__ao_device *aodev = CONTAINER_OF(ev, *aodev, timeout);
-    STATE_AO_GC(aodev->ao);
-
-    libxl__ev_time_deregister(gc, &aodev->timeout);
-
-    assert(libxl__ev_child_inuse(&aodev->child));
-    LOG(DEBUG, "killing hotplug script %s because of timeout", aodev->what);
-    if (kill(aodev->child.pid, SIGKILL)) {
-        LOGEV(ERROR, errno, "unable to kill hotplug script %s [%ld]",
-                            aodev->what, (unsigned long)aodev->child.pid);
-    }
-
-    return;
-}
-
 static void device_hotplug_child_death_cb(libxl__egc *egc,
-                                          libxl__ev_child *child,
-                                          pid_t pid, int status)
+                                          libxl__async_exec_state *aes,
+                                          int status)
 {
-    libxl__ao_device *aodev = CONTAINER_OF(child, *aodev, child);
+    libxl__ao_device *aodev = CONTAINER_OF(aes, *aodev, aes);
     STATE_AO_GC(aodev->ao);
     char *be_path = libxl__device_backend_path(gc, aodev->dev);
     char *hotplug_error;
@@ -1085,8 +1053,6 @@ static void device_hotplug_child_death_cb(libxl__egc *egc,
     device_hotplug_clean(gc, aodev);
 
     if (status) {
-        libxl_report_child_exitstatus(CTX, LIBXL__LOG_ERROR,
-                                      aodev->what, pid, status);
         hotplug_error = libxl__xs_read(gc, XBT_NULL,
                                        GCSPRINTF("%s/hotplug-error", be_path));
         if (hotplug_error)
@@ -1178,7 +1144,7 @@ static void device_hotplug_clean(libxl__gc *gc, libxl__ao_device *aodev)
     /* Clean events and check reentrancy */
     libxl__ev_time_deregister(gc, &aodev->timeout);
     libxl__ev_xswatch_deregister(gc, &aodev->xs_watch);
-    assert(!libxl__ev_child_inuse(&aodev->child));
+    assert(!libxl__async_exec_inuse(&aodev->aes));
 }
 
 static void devices_remove_callback(libxl__egc *egc,
diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 082749e..5968485 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -2050,6 +2050,33 @@ _hidden const char *libxl__xen_script_dir_path(void);
 _hidden const char *libxl__lock_dir_path(void);
 _hidden const char *libxl__run_dir_path(void);
 
+/*----- subprocess execution with timeout -----*/
+
+typedef struct libxl__async_exec_state libxl__async_exec_state;
+
+typedef void libxl__async_exec_callback(libxl__egc *egc,
+                        libxl__async_exec_state *aes, int status);
+
+struct libxl__async_exec_state {
+    /* caller must fill these in */
+    libxl__ao *ao;
+    const char *what; /* for error msgs, what we're executing */
+    int timeout_ms;
+    libxl__async_exec_callback *callback;
+    /* caller must fill in; as for libxl__exec */
+    int stdfds[3];
+    char **args; /* execution arguments */
+    char **env; /* execution environment */
+
+    /* private */
+    libxl__ev_time time;
+    libxl__ev_child child;
+};
+
+void libxl__async_exec_init(libxl__async_exec_state *aes);
+int libxl__async_exec_start(libxl__gc *gc, libxl__async_exec_state *aes);
+bool libxl__async_exec_inuse(const libxl__async_exec_state *aes);
+
 /*----- device addition/removal -----*/
 
 typedef struct libxl__ao_device libxl__ao_device;
@@ -2086,14 +2113,13 @@ struct libxl__ao_device {
     libxl__multidev *multidev; /* reference to the containing multidev */
     /* private for add/remove implementation */
     libxl__ev_devstate backend_ds;
-    /* Bodge for Qemu devices, also used for timeout of hotplug execution */
+    /* Bodge for Qemu devices */
     libxl__ev_time timeout;
     /* xenstore watch for backend path of driver domains */
     libxl__ev_xswatch xs_watch;
-    /* device hotplug execution */
-    const char *what;
     int num_exec;
-    libxl__ev_child child;
+    /* for calling hotplug scripts */
+    libxl__async_exec_state aes;
 };
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3p-0000dU-4d; Thu, 19 Jun 2014 04:34:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3n-0000dB-EC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:51 +0000
Received: from [193.109.254.147:54607] by server-4.bemta-14.messagelabs.com id
	64/E1-02781-A6862A35; Thu, 19 Jun 2014 04:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1403152489!12260765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 466 invoked from network); 19 Jun 2014 04:34:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:34:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3l-0002Qo-1V
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3l-0007QI-0E
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:49 +0000
Date: Thu, 19 Jun 2014 04:34:49 +0000
Message-Id: <E1WxU3l-0007QI-0E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libvchan: Make raw_get_{data_ready,
	buffer_space} match
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 821096dd8acc4b5ba32f942e3daf9ff2b928ce09
Author:     Jason Andryuk <andryuk@aero.org>
AuthorDate: Fri May 16 16:48:16 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:36:05 2014 +0100

    libvchan: Make raw_get_{data_ready, buffer_space} match
    
    For writing into a vchan, raw_get_buffer_space used >, allowing the full
    ring size to be written.  On the read side, raw_get_data_ready compared
    the ring size with >=.  This mismatch means a completely filled buffer
    cannot be read.  Fix this by making the size checks identical.
    
    Signed-off-by: Jason Andryuk <andryuk@aero.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libvchan/io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 804c63c..6e6e239 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -118,7 +118,7 @@ static inline int send_notify(struct libxenvchan *ctrl, uint8_t bit)
 static inline int raw_get_data_ready(struct libxenvchan *ctrl)
 {
 	uint32_t ready = rd_prod(ctrl) - rd_cons(ctrl);
-	if (ready >= rd_ring_size(ctrl))
+	if (ready > rd_ring_size(ctrl))
 		/* We have no way to return errors.  Locking up the ring is
 		 * better than the alternatives. */
 		return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:34:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:34:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU3p-0000dU-4d; Thu, 19 Jun 2014 04:34:53 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3n-0000dB-EC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:51 +0000
Received: from [193.109.254.147:54607] by server-4.bemta-14.messagelabs.com id
	64/E1-02781-A6862A35; Thu, 19 Jun 2014 04:34:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1403152489!12260765!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 466 invoked from network); 19 Jun 2014 04:34:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:34:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3l-0002Qo-1V
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3l-0007QI-0E
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:49 +0000
Date: Thu, 19 Jun 2014 04:34:49 +0000
Message-Id: <E1WxU3l-0007QI-0E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libvchan: Make raw_get_{data_ready,
	buffer_space} match
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 821096dd8acc4b5ba32f942e3daf9ff2b928ce09
Author:     Jason Andryuk <andryuk@aero.org>
AuthorDate: Fri May 16 16:48:16 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:36:05 2014 +0100

    libvchan: Make raw_get_{data_ready, buffer_space} match
    
    For writing into a vchan, raw_get_buffer_space used >, allowing the full
    ring size to be written.  On the read side, raw_get_data_ready compared
    the ring size with >=.  This mismatch means a completely filled buffer
    cannot be read.  Fix this by making the size checks identical.
    
    Signed-off-by: Jason Andryuk <andryuk@aero.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libvchan/io.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/libvchan/io.c b/tools/libvchan/io.c
index 804c63c..6e6e239 100644
--- a/tools/libvchan/io.c
+++ b/tools/libvchan/io.c
@@ -118,7 +118,7 @@ static inline int send_notify(struct libxenvchan *ctrl, uint8_t bit)
 static inline int raw_get_data_ready(struct libxenvchan *ctrl)
 {
 	uint32_t ready = rd_prod(ctrl) - rd_cons(ctrl);
-	if (ready >= rd_ring_size(ctrl))
+	if (ready > rd_ring_size(ctrl))
 		/* We have no way to return errors.  Locking up the ring is
 		 * better than the alternatives. */
 		return 0;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU40-0000f7-7S; Thu, 19 Jun 2014 04:35:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3x-0000ek-IF
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:03 +0000
Received: from [85.158.143.35:53411] by server-2.bemta-4.messagelabs.com id
	C9/1D-06539-47862A35; Thu, 19 Jun 2014 04:35:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1403152499!12370072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26167 invoked from network); 19 Jun 2014 04:35:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3v-0002Qu-7L
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3v-0007Qt-68
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:59 +0000
Date: Thu, 19 Jun 2014 04:34:59 +0000
Message-Id: <E1WxU3v-0007Qt-68@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxenstat: handle renamed VIFs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2a332bfde7aff580f461a1d81b5340573d556d1
Author:     Jacek Konieczny <jajcus@jajcus.net>
AuthorDate: Fri May 23 14:47:21 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:36:55 2014 +0100

    libxenstat: handle renamed VIFs
    
    Before trying to parse network interface name as 'vif*.*'
    try to get the domid and network number from sysfs.
    
    Fixes xentop output for domains with VIF renamed through the
    'vifname' xl option.
    
    Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstat/libxenstat/src/xenstat_linux.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_linux.c b/tools/xenstat/libxenstat/src/xenstat_linux.c
index 24335e1..7fdf70a 100644
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c
@@ -233,6 +233,29 @@ int parseNetDevLine(char *line, char *iface, unsigned long long *rxBytes, unsign
 	return 0;
 }
 
+/* Find out the domid and network number given an interface name.
+ * Return 0 if the iface cannot be recognized as a Xen VIF. */
+static int get_iface_domid_network(const char *iface, unsigned int *domid_p, unsigned int *netid_p)
+{
+	char nodename_path[48];
+	FILE * nodename_file;
+	int ret;
+
+	snprintf(nodename_path, 48, "/sys/class/net/%s/device/nodename", iface);
+	nodename_file = fopen(nodename_path, "r");
+	if (nodename_file != NULL) {
+		ret = fscanf(nodename_file, "backend/vif/%u/%u", domid_p, netid_p);
+		fclose(nodename_file);
+		if (ret == 2)
+			return 1;
+	}
+
+	if (sscanf(iface, "vif%u.%u", domid_p, netid_p) == 2)
+		return 1;
+
+	return 0;
+}
+
 /* Collect information about networks */
 int xenstat_collect_networks(xenstat_node * node)
 {
@@ -309,8 +332,7 @@ int xenstat_collect_networks(xenstat_node * node)
 			}
 		}
 		else /* Otherwise we need to preserve old behaviour */
-		if (strstr(iface, "vif") != NULL) {
-			sscanf(iface, "vif%u.%u", &domid, &net.id);
+		if (get_iface_domid_network(iface, &domid, &net.id)) {
 
 			net.tbytes = txBytes;
 			net.tpackets = txPackets;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU40-0000f7-7S; Thu, 19 Jun 2014 04:35:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3x-0000ek-IF
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:03 +0000
Received: from [85.158.143.35:53411] by server-2.bemta-4.messagelabs.com id
	C9/1D-06539-47862A35; Thu, 19 Jun 2014 04:35:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1403152499!12370072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26167 invoked from network); 19 Jun 2014 04:35:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3v-0002Qu-7L
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU3v-0007Qt-68
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:34:59 +0000
Date: Thu, 19 Jun 2014 04:34:59 +0000
Message-Id: <E1WxU3v-0007Qt-68@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxenstat: handle renamed VIFs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b2a332bfde7aff580f461a1d81b5340573d556d1
Author:     Jacek Konieczny <jajcus@jajcus.net>
AuthorDate: Fri May 23 14:47:21 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:36:55 2014 +0100

    libxenstat: handle renamed VIFs
    
    Before trying to parse network interface name as 'vif*.*'
    try to get the domid and network number from sysfs.
    
    Fixes xentop output for domains with VIF renamed through the
    'vifname' xl option.
    
    Signed-off-by: Jacek Konieczny <jajcus@jajcus.net>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstat/libxenstat/src/xenstat_linux.c |   26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/tools/xenstat/libxenstat/src/xenstat_linux.c b/tools/xenstat/libxenstat/src/xenstat_linux.c
index 24335e1..7fdf70a 100644
--- a/tools/xenstat/libxenstat/src/xenstat_linux.c
+++ b/tools/xenstat/libxenstat/src/xenstat_linux.c
@@ -233,6 +233,29 @@ int parseNetDevLine(char *line, char *iface, unsigned long long *rxBytes, unsign
 	return 0;
 }
 
+/* Find out the domid and network number given an interface name.
+ * Return 0 if the iface cannot be recognized as a Xen VIF. */
+static int get_iface_domid_network(const char *iface, unsigned int *domid_p, unsigned int *netid_p)
+{
+	char nodename_path[48];
+	FILE * nodename_file;
+	int ret;
+
+	snprintf(nodename_path, 48, "/sys/class/net/%s/device/nodename", iface);
+	nodename_file = fopen(nodename_path, "r");
+	if (nodename_file != NULL) {
+		ret = fscanf(nodename_file, "backend/vif/%u/%u", domid_p, netid_p);
+		fclose(nodename_file);
+		if (ret == 2)
+			return 1;
+	}
+
+	if (sscanf(iface, "vif%u.%u", domid_p, netid_p) == 2)
+		return 1;
+
+	return 0;
+}
+
 /* Collect information about networks */
 int xenstat_collect_networks(xenstat_node * node)
 {
@@ -309,8 +332,7 @@ int xenstat_collect_networks(xenstat_node * node)
 			}
 		}
 		else /* Otherwise we need to preserve old behaviour */
-		if (strstr(iface, "vif") != NULL) {
-			sscanf(iface, "vif%u.%u", &domid, &net.id);
+		if (get_iface_domid_network(iface, &domid, &net.id)) {
 
 			net.tbytes = txBytes;
 			net.tpackets = txPackets;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4E-0000h3-AS; Thu, 19 Jun 2014 04:35:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4D-0000gv-5e
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:17 +0000
Received: from [85.158.143.35:53970] by server-1.bemta-4.messagelabs.com id
	14/30-09496-48862A35; Thu, 19 Jun 2014 04:35:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403152514!12381097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31998 invoked from network); 19 Jun 2014 04:35:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4A-0002RT-Fr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU45-0007RS-CQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:09 +0000
Date: Thu, 19 Jun 2014 04:35:09 +0000
Message-Id: <E1WxU45-0007RS-CQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vcpu: Correctly release
	resources when a VCPU fails to initialize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 911232f02a637f65726d9f7cf7f480f34786b8e1
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Apr 30 20:15:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:38:12 2014 +0100

    xen/arm: vcpu: Correctly release resources when a VCPU fails to initialize
    
    While I was adding new failing code at the end of the function, I noticed
    that the vtimers are not freed which messes up all the timers and will crash
    Xen quickly when the page s reused.
    
    Currently neither vcpu_vgic_init nor vcpu_vtimer_init fails, so we
    are safe for now. With the new GICv3 code, the former function will be able
    to fail. This will result in a memory leak.
    
    Call vcpu_destroy if the initialization has failed. We also need to add a
    boolean to know if the vtimers are correctly setup as the timer common code
    doesn't have any safeguard against removing a non-initialized timer.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |    8 ++++++--
 xen/arch/arm/vtimer.c        |    5 +++++
 xen/include/asm-arm/domain.h |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2ae6941..04d0cd0 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -470,12 +470,16 @@ int vcpu_initialise(struct vcpu *v)
     processor_vcpu_initialise(v);
 
     if ( (rc = vcpu_vgic_init(v)) != 0 )
-        return rc;
+        goto fail;
 
     if ( (rc = vcpu_vtimer_init(v)) != 0 )
-        return rc;
+        goto fail;
 
     return rc;
+
+fail:
+    vcpu_destroy(v);
+    return rc;
 }
 
 void vcpu_destroy(struct vcpu *v)
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index b93153e..7b50826 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -77,11 +77,16 @@ int vcpu_vtimer_init(struct vcpu *v)
         : GUEST_TIMER_VIRT_PPI;
     t->v = v;
 
+    v->arch.vtimer_initialized = 1;
+
     return 0;
 }
 
 void vcpu_timer_destroy(struct vcpu *v)
 {
+    if ( !v->arch.vtimer_initialized )
+        return;
+
     kill_timer(&v->arch.virt_timer.timer);
     kill_timer(&v->arch.phys_timer.timer);
 }
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index b296923..f6cb1c0 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -289,6 +289,7 @@ struct arch_vcpu
 
     struct vtimer phys_timer;
     struct vtimer virt_timer;
+    bool_t vtimer_initialized;
 }  __cacheline_aligned;
 
 void vcpu_show_execution_state(struct vcpu *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4E-0000h3-AS; Thu, 19 Jun 2014 04:35:18 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4D-0000gv-5e
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:17 +0000
Received: from [85.158.143.35:53970] by server-1.bemta-4.messagelabs.com id
	14/30-09496-48862A35; Thu, 19 Jun 2014 04:35:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403152514!12381097!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31998 invoked from network); 19 Jun 2014 04:35:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4A-0002RT-Fr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU45-0007RS-CQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:09 +0000
Date: Thu, 19 Jun 2014 04:35:09 +0000
Message-Id: <E1WxU45-0007RS-CQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: vcpu: Correctly release
	resources when a VCPU fails to initialize
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 911232f02a637f65726d9f7cf7f480f34786b8e1
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Wed Apr 30 20:15:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:38:12 2014 +0100

    xen/arm: vcpu: Correctly release resources when a VCPU fails to initialize
    
    While I was adding new failing code at the end of the function, I noticed
    that the vtimers are not freed which messes up all the timers and will crash
    Xen quickly when the page s reused.
    
    Currently neither vcpu_vgic_init nor vcpu_vtimer_init fails, so we
    are safe for now. With the new GICv3 code, the former function will be able
    to fail. This will result in a memory leak.
    
    Call vcpu_destroy if the initialization has failed. We also need to add a
    boolean to know if the vtimers are correctly setup as the timer common code
    doesn't have any safeguard against removing a non-initialized timer.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c        |    8 ++++++--
 xen/arch/arm/vtimer.c        |    5 +++++
 xen/include/asm-arm/domain.h |    1 +
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 2ae6941..04d0cd0 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -470,12 +470,16 @@ int vcpu_initialise(struct vcpu *v)
     processor_vcpu_initialise(v);
 
     if ( (rc = vcpu_vgic_init(v)) != 0 )
-        return rc;
+        goto fail;
 
     if ( (rc = vcpu_vtimer_init(v)) != 0 )
-        return rc;
+        goto fail;
 
     return rc;
+
+fail:
+    vcpu_destroy(v);
+    return rc;
 }
 
 void vcpu_destroy(struct vcpu *v)
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index b93153e..7b50826 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -77,11 +77,16 @@ int vcpu_vtimer_init(struct vcpu *v)
         : GUEST_TIMER_VIRT_PPI;
     t->v = v;
 
+    v->arch.vtimer_initialized = 1;
+
     return 0;
 }
 
 void vcpu_timer_destroy(struct vcpu *v)
 {
+    if ( !v->arch.vtimer_initialized )
+        return;
+
     kill_timer(&v->arch.virt_timer.timer);
     kill_timer(&v->arch.phys_timer.timer);
 }
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index b296923..f6cb1c0 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -289,6 +289,7 @@ struct arch_vcpu
 
     struct vtimer phys_timer;
     struct vtimer virt_timer;
+    bool_t vtimer_initialized;
 }  __cacheline_aligned;
 
 void vcpu_show_execution_state(struct vcpu *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4O-0000io-GI; Thu, 19 Jun 2014 04:35:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4N-0000id-L0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:27 +0000
Received: from [85.158.137.68:17378] by server-17.bemta-3.messagelabs.com id
	56/45-22741-E8862A35; Thu, 19 Jun 2014 04:35:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403152524!8567710!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9476 invoked from network); 19 Jun 2014 04:35:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4K-0002RZ-NK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4K-0007SY-Ks
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:24 +0000
Date: Thu, 19 Jun 2014 04:35:24 +0000
Message-Id: <E1WxU4K-0007SY-Ks@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: install qemu into xen private
	directory and add rpath for the libraries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2fd0257fbf39305ea63afd784c74c7a3bbbcfa30
Author:     Zhigang Wang <zhigang.x.wang@oracle.com>
AuthorDate: Tue May 20 13:30:54 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:45:26 2014 +0100

    tools: install qemu into xen private directory and add rpath for the libraries
    
    This patch will prevent our qemu from conflicting with system qemu.
    
    Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 992fe3e..63382b1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -187,7 +187,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
-		--prefix=$(PREFIX) \
+		--prefix=$(PREFIX)/lib/xen \
+		--libdir=$(PREFIX)/lib/xen/lib \
+		--includedir=$(PREFIX)/lib/xen/include \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc \
@@ -195,7 +197,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-I$(XEN_ROOT)/tools/xenstore/compat \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
-		-L$(XEN_ROOT)/tools/xenstore" \
+		-L$(XEN_ROOT)/tools/xenstore \
+		-Wl,-rpath=$(PREFIX)/lib/xen/lib" \
 		--bindir=$(LIBEXEC) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=/var \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4O-0000io-GI; Thu, 19 Jun 2014 04:35:28 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4N-0000id-L0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:27 +0000
Received: from [85.158.137.68:17378] by server-17.bemta-3.messagelabs.com id
	56/45-22741-E8862A35; Thu, 19 Jun 2014 04:35:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403152524!8567710!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9476 invoked from network); 19 Jun 2014 04:35:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4K-0002RZ-NK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4K-0007SY-Ks
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:24 +0000
Date: Thu, 19 Jun 2014 04:35:24 +0000
Message-Id: <E1WxU4K-0007SY-Ks@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: install qemu into xen private
	directory and add rpath for the libraries
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2fd0257fbf39305ea63afd784c74c7a3bbbcfa30
Author:     Zhigang Wang <zhigang.x.wang@oracle.com>
AuthorDate: Tue May 20 13:30:54 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:45:26 2014 +0100

    tools: install qemu into xen private directory and add rpath for the libraries
    
    This patch will prevent our qemu from conflicting with system qemu.
    
    Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/Makefile |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index 992fe3e..63382b1 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -187,7 +187,9 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 	cd qemu-xen-dir; \
 	$$source/configure --enable-xen --target-list=i386-softmmu \
 		$(QEMU_XEN_ENABLE_DEBUG) \
-		--prefix=$(PREFIX) \
+		--prefix=$(PREFIX)/lib/xen \
+		--libdir=$(PREFIX)/lib/xen/lib \
+		--includedir=$(PREFIX)/lib/xen/include \
 		--source-path=$$source \
 		--extra-cflags="-I$(XEN_ROOT)/tools/include \
 		-I$(XEN_ROOT)/tools/libxc \
@@ -195,7 +197,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
 		-I$(XEN_ROOT)/tools/xenstore/compat \
 		$(EXTRA_CFLAGS_QEMU_XEN)" \
 		--extra-ldflags="-L$(XEN_ROOT)/tools/libxc \
-		-L$(XEN_ROOT)/tools/xenstore" \
+		-L$(XEN_ROOT)/tools/xenstore \
+		-Wl,-rpath=$(PREFIX)/lib/xen/lib" \
 		--bindir=$(LIBEXEC) \
 		--datadir=$(SHAREDIR)/qemu-xen \
 		--localstatedir=/var \
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4Y-0000kF-J6; Thu, 19 Jun 2014 04:35:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4X-0000k3-IR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:37 +0000
Received: from [193.109.254.147:49889] by server-3.bemta-14.messagelabs.com id
	12/12-22179-89862A35; Thu, 19 Jun 2014 04:35:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403152535!12256229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30624 invoked from network); 19 Jun 2014 04:35:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4U-0002Rf-TJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4U-0007T8-RY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:34 +0000
Date: Thu, 19 Jun 2014 04:35:34 +0000
Message-Id: <E1WxU4U-0007T8-RY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Fix memory leaks in
	the client
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 42e896b257ad361137fd7629e20f2e1580c1a6cf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 23 11:32:01 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:47:34 2014 +0100

    tools/xenstore: Fix memory leaks in the client
    
    Free the expanding buffer and output buffer after use.  Close the xenstore
    handle after use.
    
    The command line client is now valgrind-clean.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/xenstore_client.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 0ec103f..56b9309 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -40,6 +40,7 @@ enum mode {
 
 static char *output_buf = NULL;
 static int output_pos = 0;
+static struct expanding_buffer ebuf;
 
 static int output_size = 0;
 
@@ -126,7 +127,6 @@ static int show_whole_path = 0;
 
 static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms)
 {
-    static struct expanding_buffer ebuf;
     char **e;
     char newpath[STRING_MAX], *val;
     int newpath_len;
@@ -308,7 +308,6 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
             /* CANNOT BE REACHED */
             errx(1, "invalid mode %d", mode);
         case MODE_read: {
-            static struct expanding_buffer ebuf;
             unsigned len;
             char *val = xs_read(xsh, xth, argv[optind], &len);
             if (val == NULL) {
@@ -323,7 +322,6 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
             break;
         }
         case MODE_write: {
-            static struct expanding_buffer ebuf;
             char *val_spec = argv[optind + 1];
             unsigned len;
             expanding_buffer_ensure(&ebuf, strlen(val_spec)+1);
@@ -655,5 +653,11 @@ again:
     if (output_pos)
 	printf("%s", output_buf);
 
+    free(output_buf);
+    free(ebuf.buf);
+
+    if (xsh)
+        xs_close(xsh);
+
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4Y-0000kF-J6; Thu, 19 Jun 2014 04:35:38 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4X-0000k3-IR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:37 +0000
Received: from [193.109.254.147:49889] by server-3.bemta-14.messagelabs.com id
	12/12-22179-89862A35; Thu, 19 Jun 2014 04:35:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403152535!12256229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30624 invoked from network); 19 Jun 2014 04:35:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4U-0002Rf-TJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4U-0007T8-RY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:34 +0000
Date: Thu, 19 Jun 2014 04:35:34 +0000
Message-Id: <E1WxU4U-0007T8-RY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/xenstore: Fix memory leaks in
	the client
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 42e896b257ad361137fd7629e20f2e1580c1a6cf
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Fri May 23 11:32:01 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:47:34 2014 +0100

    tools/xenstore: Fix memory leaks in the client
    
    Free the expanding buffer and output buffer after use.  Close the xenstore
    handle after use.
    
    The command line client is now valgrind-clean.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/xenstore_client.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/tools/xenstore/xenstore_client.c b/tools/xenstore/xenstore_client.c
index 0ec103f..56b9309 100644
--- a/tools/xenstore/xenstore_client.c
+++ b/tools/xenstore/xenstore_client.c
@@ -40,6 +40,7 @@ enum mode {
 
 static char *output_buf = NULL;
 static int output_pos = 0;
+static struct expanding_buffer ebuf;
 
 static int output_size = 0;
 
@@ -126,7 +127,6 @@ static int show_whole_path = 0;
 
 static void do_ls(struct xs_handle *h, char *path, int cur_depth, int show_perms)
 {
-    static struct expanding_buffer ebuf;
     char **e;
     char newpath[STRING_MAX], *val;
     int newpath_len;
@@ -308,7 +308,6 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
             /* CANNOT BE REACHED */
             errx(1, "invalid mode %d", mode);
         case MODE_read: {
-            static struct expanding_buffer ebuf;
             unsigned len;
             char *val = xs_read(xsh, xth, argv[optind], &len);
             if (val == NULL) {
@@ -323,7 +322,6 @@ perform(enum mode mode, int optind, int argc, char **argv, struct xs_handle *xsh
             break;
         }
         case MODE_write: {
-            static struct expanding_buffer ebuf;
             char *val_spec = argv[optind + 1];
             unsigned len;
             expanding_buffer_ensure(&ebuf, strlen(val_spec)+1);
@@ -655,5 +653,11 @@ again:
     if (output_pos)
 	printf("%s", output_buf);
 
+    free(output_buf);
+    free(ebuf.buf);
+
+    if (xsh)
+        xs_close(xsh);
+
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4i-0000ll-Mz; Thu, 19 Jun 2014 04:35:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4h-0000la-O3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:47 +0000
Received: from [85.158.143.35:55139] by server-2.bemta-4.messagelabs.com id
	B0/8D-06539-3A862A35; Thu, 19 Jun 2014 04:35:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1403152545!12017293!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 354 invoked from network); 19 Jun 2014 04:35:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4f-0002Rl-3f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4f-0007Tg-1t
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:45 +0000
Date: Thu, 19 Jun 2014 04:35:45 +0000
Message-Id: <E1WxU4f-0007Tg-1t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: use uint64_t not
	unsigned long long for addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e3f5f45294cf2c275d96deef1193099a08ef454
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:36 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: libxl: use uint64_t not unsigned long long for addresses
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_arm.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 4f0f0e2..215ef9e 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -256,11 +256,10 @@ static int make_psci_node(libxl__gc *gc, void *fdt)
 }
 
 static int make_memory_node(libxl__gc *gc, void *fdt,
-                            unsigned long long base,
-                            unsigned long long size)
+                            uint64_t base, uint64_t size)
 {
     int res;
-    const char *name = GCSPRINTF("memory@%08llx", base);
+    const char *name = GCSPRINTF("memory@%"PRIx64, base);
 
     res = fdt_begin_node(fdt, name);
     if (res) return res;
@@ -269,7 +268,7 @@ static int make_memory_node(libxl__gc *gc, void *fdt,
     if (res) return res;
 
     res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
-                            1, (uint64_t)base, (uint64_t)size);
+                            1, base, size);
     if (res) return res;
 
     res = fdt_end_node(fdt);
@@ -279,13 +278,11 @@ static int make_memory_node(libxl__gc *gc, void *fdt,
 }
 
 static int make_intc_node(libxl__gc *gc, void *fdt,
-                          unsigned long long gicd_base,
-                          unsigned long long gicd_size,
-                          unsigned long long gicc_base,
-                          unsigned long long gicc_size)
+                          uint64_t gicd_base, uint64_t gicd_size,
+                          uint64_t gicc_base, uint64_t gicc_size)
 {
     int res;
-    const char *name = GCSPRINTF("interrupt-controller@%08llx", gicd_base);
+    const char *name = GCSPRINTF("interrupt-controller@%"PRIx64, gicd_base);
 
     res = fdt_begin_node(fdt, name);
     if (res) return res;
@@ -307,8 +304,8 @@ static int make_intc_node(libxl__gc *gc, void *fdt,
 
     res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
                             2,
-                            (uint64_t)gicd_base, (uint64_t)gicd_size,
-                            (uint64_t)gicc_base, (uint64_t)gicc_size);
+                            gicd_base, gicd_size,
+                            gicc_base, gicc_size);
     if (res) return res;
 
     res = fdt_property_cell(fdt, "linux,phandle", PHANDLE_GIC);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4i-0000ll-Mz; Thu, 19 Jun 2014 04:35:48 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4h-0000la-O3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:47 +0000
Received: from [85.158.143.35:55139] by server-2.bemta-4.messagelabs.com id
	B0/8D-06539-3A862A35; Thu, 19 Jun 2014 04:35:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1403152545!12017293!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 354 invoked from network); 19 Jun 2014 04:35:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4f-0002Rl-3f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4f-0007Tg-1t
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:45 +0000
Date: Thu, 19 Jun 2014 04:35:45 +0000
Message-Id: <E1WxU4f-0007Tg-1t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: libxl: use uint64_t not
	unsigned long long for addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2e3f5f45294cf2c275d96deef1193099a08ef454
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:36 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: libxl: use uint64_t not unsigned long long for addresses
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_arm.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 4f0f0e2..215ef9e 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -256,11 +256,10 @@ static int make_psci_node(libxl__gc *gc, void *fdt)
 }
 
 static int make_memory_node(libxl__gc *gc, void *fdt,
-                            unsigned long long base,
-                            unsigned long long size)
+                            uint64_t base, uint64_t size)
 {
     int res;
-    const char *name = GCSPRINTF("memory@%08llx", base);
+    const char *name = GCSPRINTF("memory@%"PRIx64, base);
 
     res = fdt_begin_node(fdt, name);
     if (res) return res;
@@ -269,7 +268,7 @@ static int make_memory_node(libxl__gc *gc, void *fdt,
     if (res) return res;
 
     res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
-                            1, (uint64_t)base, (uint64_t)size);
+                            1, base, size);
     if (res) return res;
 
     res = fdt_end_node(fdt);
@@ -279,13 +278,11 @@ static int make_memory_node(libxl__gc *gc, void *fdt,
 }
 
 static int make_intc_node(libxl__gc *gc, void *fdt,
-                          unsigned long long gicd_base,
-                          unsigned long long gicd_size,
-                          unsigned long long gicc_base,
-                          unsigned long long gicc_size)
+                          uint64_t gicd_base, uint64_t gicd_size,
+                          uint64_t gicc_base, uint64_t gicc_size)
 {
     int res;
-    const char *name = GCSPRINTF("interrupt-controller@%08llx", gicd_base);
+    const char *name = GCSPRINTF("interrupt-controller@%"PRIx64, gicd_base);
 
     res = fdt_begin_node(fdt, name);
     if (res) return res;
@@ -307,8 +304,8 @@ static int make_intc_node(libxl__gc *gc, void *fdt,
 
     res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
                             2,
-                            (uint64_t)gicd_base, (uint64_t)gicd_size,
-                            (uint64_t)gicc_base, (uint64_t)gicc_size);
+                            gicd_base, gicd_size,
+                            gicc_base, gicc_size);
     if (res) return res;
 
     res = fdt_property_cell(fdt, "linux,phandle", PHANDLE_GIC);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4s-0000nB-Pa; Thu, 19 Jun 2014 04:35:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4r-0000mx-UH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:58 +0000
Received: from [85.158.143.35:55452] by server-3.bemta-4.messagelabs.com id
	CB/5B-16194-DA862A35; Thu, 19 Jun 2014 04:35:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403152555!12381178!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1165 invoked from network); 19 Jun 2014 04:35:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4p-0002Rr-Ae
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4p-0007UH-99
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:55 +0000
Date: Thu, 19 Jun 2014 04:35:55 +0000
Message-Id: <E1WxU4p-0007UH-99@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: report an error if the
	guest RAM is too large
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a959f44ed03398870b6ec0dfebb59dcd5981f94
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:37 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: arm: report an error if the guest RAM is too large
    
    Due to the layout of the guest physical address space we cannot support more
    than 768M of RAM before overrunning the area set aside for the grant table. Due
    to the presence of the magic pages at the end of the RAM region guests are
    actually limited to 767M.
    
    Catch this case during domain build and fail gracefully instead of obscurely
    later on.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_arm.c      |    9 +++++++++
 xen/include/public/arch-arm.h |    3 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 60ac51a..d5831a2 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -272,6 +272,15 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         return -1;
     }
 
+    if ( ramsize > GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE )
+    {
+        DOMPRINTF("%s: ram size is too large for guest address space: "
+                  "%"PRIx64" > %llx",
+                  __FUNCTION__, ramsize,
+                  GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE);
+        return -1;
+    }
+
     rc = set_mode(dom->xch, dom->guest_domid, dom->guest_type);
     if ( rc )
         return rc;
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 7496556..dd53c94 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -369,7 +369,8 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICC_BASE   0x2c002000ULL
 #define GUEST_GICC_SIZE   0x100ULL
 
-#define GUEST_RAM_BASE    0x80000000ULL
+#define GUEST_RAM_BASE    0x80000000ULL /* 768M @ 2GB */
+#define GUEST_RAM_SIZE    0x30000000ULL
 
 #define GUEST_GNTTAB_BASE 0xb0000000ULL
 #define GUEST_GNTTAB_SIZE 0x00020000ULL
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:35:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:35:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU4s-0000nB-Pa; Thu, 19 Jun 2014 04:35:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4r-0000mx-UH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:58 +0000
Received: from [85.158.143.35:55452] by server-3.bemta-4.messagelabs.com id
	CB/5B-16194-DA862A35; Thu, 19 Jun 2014 04:35:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403152555!12381178!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1165 invoked from network); 19 Jun 2014 04:35:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:35:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4p-0002Rr-Ae
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4p-0007UH-99
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:35:55 +0000
Date: Thu, 19 Jun 2014 04:35:55 +0000
Message-Id: <E1WxU4p-0007UH-99@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: report an error if the
	guest RAM is too large
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5a959f44ed03398870b6ec0dfebb59dcd5981f94
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:37 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: arm: report an error if the guest RAM is too large
    
    Due to the layout of the guest physical address space we cannot support more
    than 768M of RAM before overrunning the area set aside for the grant table. Due
    to the presence of the magic pages at the end of the RAM region guests are
    actually limited to 767M.
    
    Catch this case during domain build and fail gracefully instead of obscurely
    later on.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_arm.c      |    9 +++++++++
 xen/include/public/arch-arm.h |    3 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 60ac51a..d5831a2 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -272,6 +272,15 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         return -1;
     }
 
+    if ( ramsize > GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE )
+    {
+        DOMPRINTF("%s: ram size is too large for guest address space: "
+                  "%"PRIx64" > %llx",
+                  __FUNCTION__, ramsize,
+                  GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE);
+        return -1;
+    }
+
     rc = set_mode(dom->xch, dom->guest_domid, dom->guest_type);
     if ( rc )
         return rc;
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 7496556..dd53c94 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -369,7 +369,8 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICC_BASE   0x2c002000ULL
 #define GUEST_GICC_SIZE   0x100ULL
 
-#define GUEST_RAM_BASE    0x80000000ULL
+#define GUEST_RAM_BASE    0x80000000ULL /* 768M @ 2GB */
+#define GUEST_RAM_SIZE    0x30000000ULL
 
 #define GUEST_GNTTAB_BASE 0xb0000000ULL
 #define GUEST_GNTTAB_SIZE 0x00020000ULL
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU53-0000p3-SJ; Thu, 19 Jun 2014 04:36:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU52-0000oi-E3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:08 +0000
Received: from [85.158.137.68:36656] by server-8.bemta-3.messagelabs.com id
	CD/74-21547-7B862A35; Thu, 19 Jun 2014 04:36:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403152565!11000905!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1093 invoked from network); 19 Jun 2014 04:36:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4z-0002SQ-HS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4z-0007V2-Er
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:05 +0000
Date: Thu, 19 Jun 2014 04:36:05 +0000
Message-Id: <E1WxU4z-0007V2-Er@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: move magic pfns out of
	guest RAM region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 180596a1ebac570d68b0ed393139c0d4a3dc991b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:38 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: arm: move magic pfns out of guest RAM region
    
    Because toolstacks (at least libxl) only allow RAM to be specified in 1M
    increments these two pages were effectively costing 1M of guest RAM space.
    
    Since these pages don't actually need to live in RAM just move them out.
    
    With this a guest can now use the full 768M of the address space reserved
    for RAM. (ok, not that impressive, but it simplifies things later)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    --
    v3: make the size of the region explicit.
    v2: remove spurious w/s change
    
    tools: arm: make the size of the magic page region explicit
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_arm.c      |   14 ++++++++------
 xen/include/public/arch-arm.h |    3 +++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index d5831a2..81d5fc7 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -58,12 +58,15 @@ static int setup_pgtables_arm(struct xc_dom_image *dom)
 static int alloc_magic_pages(struct xc_dom_image *dom)
 {
     int rc, i;
+    const xen_pfn_t base = GUEST_MAGIC_BASE >> XC_PAGE_SHIFT;
     xen_pfn_t p2m[NR_MAGIC_PAGES];
 
+    XC_BUILD_BUG_ON(NR_MAGIC_PAGES > GUEST_MAGIC_SIZE >> XC_PAGE_SHIFT);
+
     DOMPRINTF_CALLED(dom->xch);
 
     for (i = 0; i < NR_MAGIC_PAGES; i++)
-        p2m[i] = dom->rambase_pfn + dom->total_pages + i;
+        p2m[i] = base + i;
 
     rc = xc_domain_populate_physmap_exact(
             dom->xch, dom->guest_domid, NR_MAGIC_PAGES,
@@ -71,8 +74,8 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     if ( rc < 0 )
         return rc;
 
-    dom->console_pfn = dom->rambase_pfn + dom->total_pages + CONSOLE_PFN_OFFSET;
-    dom->xenstore_pfn = dom->rambase_pfn + dom->total_pages + XENSTORE_PFN_OFFSET;
+    dom->console_pfn = base + CONSOLE_PFN_OFFSET;
+    dom->xenstore_pfn = base + XENSTORE_PFN_OFFSET;
 
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
@@ -272,12 +275,11 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         return -1;
     }
 
-    if ( ramsize > GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE )
+    if ( ramsize > GUEST_RAM_SIZE )
     {
         DOMPRINTF("%s: ram size is too large for guest address space: "
                   "%"PRIx64" > %llx",
-                  __FUNCTION__, ramsize,
-                  GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE);
+                  __FUNCTION__, ramsize, GUEST_RAM_SIZE);
         return -1;
     }
 
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index dd53c94..6630f36 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -375,6 +375,9 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GNTTAB_BASE 0xb0000000ULL
 #define GUEST_GNTTAB_SIZE 0x00020000ULL
 
+#define GUEST_MAGIC_BASE  0xc0000000ULL
+#define GUEST_MAGIC_SIZE  0x01000000ULL
+
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
 #define GUEST_TIMER_PHYS_S_PPI  29
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU53-0000p3-SJ; Thu, 19 Jun 2014 04:36:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU52-0000oi-E3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:08 +0000
Received: from [85.158.137.68:36656] by server-8.bemta-3.messagelabs.com id
	CD/74-21547-7B862A35; Thu, 19 Jun 2014 04:36:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403152565!11000905!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1093 invoked from network); 19 Jun 2014 04:36:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4z-0002SQ-HS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU4z-0007V2-Er
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:05 +0000
Date: Thu, 19 Jun 2014 04:36:05 +0000
Message-Id: <E1WxU4z-0007V2-Er@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: move magic pfns out of
	guest RAM region
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 180596a1ebac570d68b0ed393139c0d4a3dc991b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:38 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: arm: move magic pfns out of guest RAM region
    
    Because toolstacks (at least libxl) only allow RAM to be specified in 1M
    increments these two pages were effectively costing 1M of guest RAM space.
    
    Since these pages don't actually need to live in RAM just move them out.
    
    With this a guest can now use the full 768M of the address space reserved
    for RAM. (ok, not that impressive, but it simplifies things later)
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    --
    v3: make the size of the region explicit.
    v2: remove spurious w/s change
    
    tools: arm: make the size of the magic page region explicit
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_arm.c      |   14 ++++++++------
 xen/include/public/arch-arm.h |    3 +++
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index d5831a2..81d5fc7 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -58,12 +58,15 @@ static int setup_pgtables_arm(struct xc_dom_image *dom)
 static int alloc_magic_pages(struct xc_dom_image *dom)
 {
     int rc, i;
+    const xen_pfn_t base = GUEST_MAGIC_BASE >> XC_PAGE_SHIFT;
     xen_pfn_t p2m[NR_MAGIC_PAGES];
 
+    XC_BUILD_BUG_ON(NR_MAGIC_PAGES > GUEST_MAGIC_SIZE >> XC_PAGE_SHIFT);
+
     DOMPRINTF_CALLED(dom->xch);
 
     for (i = 0; i < NR_MAGIC_PAGES; i++)
-        p2m[i] = dom->rambase_pfn + dom->total_pages + i;
+        p2m[i] = base + i;
 
     rc = xc_domain_populate_physmap_exact(
             dom->xch, dom->guest_domid, NR_MAGIC_PAGES,
@@ -71,8 +74,8 @@ static int alloc_magic_pages(struct xc_dom_image *dom)
     if ( rc < 0 )
         return rc;
 
-    dom->console_pfn = dom->rambase_pfn + dom->total_pages + CONSOLE_PFN_OFFSET;
-    dom->xenstore_pfn = dom->rambase_pfn + dom->total_pages + XENSTORE_PFN_OFFSET;
+    dom->console_pfn = base + CONSOLE_PFN_OFFSET;
+    dom->xenstore_pfn = base + XENSTORE_PFN_OFFSET;
 
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->console_pfn);
     xc_clear_domain_page(dom->xch, dom->guest_domid, dom->xenstore_pfn);
@@ -272,12 +275,11 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         return -1;
     }
 
-    if ( ramsize > GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE )
+    if ( ramsize > GUEST_RAM_SIZE )
     {
         DOMPRINTF("%s: ram size is too large for guest address space: "
                   "%"PRIx64" > %llx",
-                  __FUNCTION__, ramsize,
-                  GUEST_RAM_SIZE - NR_MAGIC_PAGES*XC_PAGE_SIZE);
+                  __FUNCTION__, ramsize, GUEST_RAM_SIZE);
         return -1;
     }
 
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index dd53c94..6630f36 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -375,6 +375,9 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GNTTAB_BASE 0xb0000000ULL
 #define GUEST_GNTTAB_SIZE 0x00020000ULL
 
+#define GUEST_MAGIC_BASE  0xc0000000ULL
+#define GUEST_MAGIC_SIZE  0x01000000ULL
+
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
 #define GUEST_TIMER_PHYS_S_PPI  29
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5D-0000qe-VO; Thu, 19 Jun 2014 04:36:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5C-0000qJ-J2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:18 +0000
Received: from [85.158.137.68:2681] by server-13.bemta-3.messagelabs.com id
	46/A9-18692-1C862A35; Thu, 19 Jun 2014 04:36:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403152575!6570771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13149 invoked from network); 19 Jun 2014 04:36:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU59-0002ST-NV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU59-0007Vd-M9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:15 +0000
Date: Thu, 19 Jun 2014 04:36:15 +0000
Message-Id: <E1WxU59-0007Vd-M9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: rearrange guest physical
	address space to increase max RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d72d29bd432f800c8455b9eb16b68dc8f99ce9c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:39 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: arm: rearrange guest physical address space to increase max RAM
    
    By switching things around we can manage to expose up to 3GB of RAM to guests.
    
    I deliberately didn't place the RAM at address 0 to avoid coming to rely on
    this, so the various peripherals, MMIO and magic pages etc all live in the
    lower 1GB leaving the upper 3GB available for RAM.
    
    It would likely have been possible to reduce the space used by the peripherals
    etc and allow for 3.5 or 3.75GB but I decided to keep things simple and will
    handle >3GB memory in a subsequent patch.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 6630f36..d5090fb 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -364,20 +364,20 @@ typedef uint64_t xen_callback_t;
  */
 
 /* Physical Address Space */
-#define GUEST_GICD_BASE   0x2c001000ULL
-#define GUEST_GICD_SIZE   0x1000ULL
-#define GUEST_GICC_BASE   0x2c002000ULL
-#define GUEST_GICC_SIZE   0x100ULL
+#define GUEST_GICD_BASE   0x03001000ULL
+#define GUEST_GICD_SIZE   0x00001000ULL
+#define GUEST_GICC_BASE   0x03002000ULL
+#define GUEST_GICC_SIZE   0x00000100ULL
 
-#define GUEST_RAM_BASE    0x80000000ULL /* 768M @ 2GB */
-#define GUEST_RAM_SIZE    0x30000000ULL
-
-#define GUEST_GNTTAB_BASE 0xb0000000ULL
+#define GUEST_GNTTAB_BASE 0x38000000ULL
 #define GUEST_GNTTAB_SIZE 0x00020000ULL
 
-#define GUEST_MAGIC_BASE  0xc0000000ULL
+#define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
 
+#define GUEST_RAM_BASE    0x40000000ULL /* 3GB of RAM @ 1GB */
+#define GUEST_RAM_SIZE    0xc0000000ULL
+
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
 #define GUEST_TIMER_PHYS_S_PPI  29
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5D-0000qe-VO; Thu, 19 Jun 2014 04:36:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5C-0000qJ-J2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:18 +0000
Received: from [85.158.137.68:2681] by server-13.bemta-3.messagelabs.com id
	46/A9-18692-1C862A35; Thu, 19 Jun 2014 04:36:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403152575!6570771!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13149 invoked from network); 19 Jun 2014 04:36:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU59-0002ST-NV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU59-0007Vd-M9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:15 +0000
Date: Thu, 19 Jun 2014 04:36:15 +0000
Message-Id: <E1WxU59-0007Vd-M9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: rearrange guest physical
	address space to increase max RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2d72d29bd432f800c8455b9eb16b68dc8f99ce9c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:39 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:20 2014 +0100

    tools: arm: rearrange guest physical address space to increase max RAM
    
    By switching things around we can manage to expose up to 3GB of RAM to guests.
    
    I deliberately didn't place the RAM at address 0 to avoid coming to rely on
    this, so the various peripherals, MMIO and magic pages etc all live in the
    lower 1GB leaving the upper 3GB available for RAM.
    
    It would likely have been possible to reduce the space used by the peripherals
    etc and allow for 3.5 or 3.75GB but I decided to keep things simple and will
    handle >3GB memory in a subsequent patch.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index 6630f36..d5090fb 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -364,20 +364,20 @@ typedef uint64_t xen_callback_t;
  */
 
 /* Physical Address Space */
-#define GUEST_GICD_BASE   0x2c001000ULL
-#define GUEST_GICD_SIZE   0x1000ULL
-#define GUEST_GICC_BASE   0x2c002000ULL
-#define GUEST_GICC_SIZE   0x100ULL
+#define GUEST_GICD_BASE   0x03001000ULL
+#define GUEST_GICD_SIZE   0x00001000ULL
+#define GUEST_GICC_BASE   0x03002000ULL
+#define GUEST_GICC_SIZE   0x00000100ULL
 
-#define GUEST_RAM_BASE    0x80000000ULL /* 768M @ 2GB */
-#define GUEST_RAM_SIZE    0x30000000ULL
-
-#define GUEST_GNTTAB_BASE 0xb0000000ULL
+#define GUEST_GNTTAB_BASE 0x38000000ULL
 #define GUEST_GNTTAB_SIZE 0x00020000ULL
 
-#define GUEST_MAGIC_BASE  0xc0000000ULL
+#define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
 
+#define GUEST_RAM_BASE    0x40000000ULL /* 3GB of RAM @ 1GB */
+#define GUEST_RAM_SIZE    0xc0000000ULL
+
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
 #define GUEST_TIMER_PHYS_S_PPI  29
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5O-0000sC-1i; Thu, 19 Jun 2014 04:36:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5M-0000rq-CV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:28 +0000
Received: from [193.109.254.147:61790] by server-1.bemta-14.messagelabs.com id
	8B/14-00839-BC862A35; Thu, 19 Jun 2014 04:36:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1403152586!12258201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31176 invoked from network); 19 Jun 2014 04:36:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5J-0002Sc-TC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5J-0007Wf-S0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:25 +0000
Date: Thu, 19 Jun 2014 04:36:25 +0000
Message-Id: <E1WxU5J-0007Wf-S0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: refactor code to setup
	guest p2m and fill it with RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db57c96dc0afebc1c72c0b0c66489bdfd91872c9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:40 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:57 2014 +0100

    tools: arm: refactor code to setup guest p2m and fill it with RAM
    
    This will help when we have more guest RAM banks.
    
    Mostly code motion of the p2m_host initialisation and allocation loop into the
    new function populate_guest_memory, but in addition in the caller we now
    initialise the p2m all the INVALID_MFN to handle any holes, although in this
    patch we still fill in the entire allocated region.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_arm.c |   60 +++++++++++++++++++++++++++++++--------------
 1 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 81d5fc7..f663206 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -248,16 +248,48 @@ static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
     return rc;
 }
 
+static int populate_guest_memory(struct xc_dom_image *dom,
+                                 xen_pfn_t base_pfn, xen_pfn_t nr_pfns)
+{
+    int rc;
+    xen_pfn_t allocsz, pfn;
+
+    DOMPRINTF("%s: populating RAM @ %016"PRIx64"-%016"PRIx64" (%"PRId64"MB)",
+              __FUNCTION__,
+              (uint64_t)base_pfn << XC_PAGE_SHIFT,
+              (uint64_t)(base_pfn + nr_pfns) << XC_PAGE_SHIFT,
+              (uint64_t)nr_pfns >> (20-XC_PAGE_SHIFT));
+
+    for ( pfn = 0; pfn < nr_pfns; pfn++ )
+        dom->p2m_host[pfn] = base_pfn + pfn;
+
+    for ( pfn = rc = allocsz = 0; (pfn < nr_pfns) && !rc; pfn += allocsz )
+    {
+        allocsz = nr_pfns - pfn;
+        if ( allocsz > 1024*1024 )
+            allocsz = 1024*1024;
+
+        rc = xc_domain_populate_physmap_exact(
+            dom->xch, dom->guest_domid, allocsz,
+            0, 0, &dom->p2m_host[pfn]);
+    }
+
+    return rc;
+}
+
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
     int rc;
-    xen_pfn_t pfn, allocsz, i;
+    xen_pfn_t pfn;
     uint64_t modbase;
 
     /* Convenient */
     const uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT;
     const uint64_t ramsize = dom->total_pages << XC_PAGE_SHIFT;
     const uint64_t ramend = rambase + ramsize;
+
+    const xen_pfn_t p2m_size = dom->total_pages;
+
     const uint64_t kernbase = dom->kernel_seg.vstart;
     const uint64_t kernend = ROUNDUP(dom->kernel_seg.vend, 21/*2MB*/);
     const uint64_t kernsize = kernend - kernbase;
@@ -289,27 +321,17 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 
     dom->shadow_enabled = 1;
 
-    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages);
+    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
     if ( dom->p2m_host == NULL )
         return -EINVAL;
+    for ( pfn = 0; pfn < p2m_size; pfn++ )
+        dom->p2m_host[pfn] = INVALID_MFN;
 
-    /* setup initial p2m */
-    for ( pfn = 0; pfn < dom->total_pages; pfn++ )
-        dom->p2m_host[pfn] = pfn + dom->rambase_pfn;
-
-    /* allocate guest memory */
-    for ( i = rc = allocsz = 0;
-          (i < dom->total_pages) && !rc;
-          i += allocsz )
-    {
-        allocsz = dom->total_pages - i;
-        if ( allocsz > 1024*1024 )
-            allocsz = 1024*1024;
-
-        rc = xc_domain_populate_physmap_exact(
-            dom->xch, dom->guest_domid, allocsz,
-            0, 0, &dom->p2m_host[i]);
-    }
+    /* setup initial p2m and allocate guest memory */
+    if ((rc = populate_guest_memory(dom,
+                                    GUEST_RAM_BASE >> XC_PAGE_SHIFT,
+                                    ramsize >> XC_PAGE_SHIFT)))
+        return rc;
 
     /*
      * We try to place dtb+initrd at 128MB or if we have less RAM
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5O-0000sC-1i; Thu, 19 Jun 2014 04:36:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5M-0000rq-CV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:28 +0000
Received: from [193.109.254.147:61790] by server-1.bemta-14.messagelabs.com id
	8B/14-00839-BC862A35; Thu, 19 Jun 2014 04:36:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1403152586!12258201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31176 invoked from network); 19 Jun 2014 04:36:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5J-0002Sc-TC
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5J-0007Wf-S0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:25 +0000
Date: Thu, 19 Jun 2014 04:36:25 +0000
Message-Id: <E1WxU5J-0007Wf-S0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: refactor code to setup
	guest p2m and fill it with RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db57c96dc0afebc1c72c0b0c66489bdfd91872c9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:40 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:56:57 2014 +0100

    tools: arm: refactor code to setup guest p2m and fill it with RAM
    
    This will help when we have more guest RAM banks.
    
    Mostly code motion of the p2m_host initialisation and allocation loop into the
    new function populate_guest_memory, but in addition in the caller we now
    initialise the p2m all the INVALID_MFN to handle any holes, although in this
    patch we still fill in the entire allocated region.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_arm.c |   60 +++++++++++++++++++++++++++++++--------------
 1 files changed, 41 insertions(+), 19 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 81d5fc7..f663206 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -248,16 +248,48 @@ static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
     return rc;
 }
 
+static int populate_guest_memory(struct xc_dom_image *dom,
+                                 xen_pfn_t base_pfn, xen_pfn_t nr_pfns)
+{
+    int rc;
+    xen_pfn_t allocsz, pfn;
+
+    DOMPRINTF("%s: populating RAM @ %016"PRIx64"-%016"PRIx64" (%"PRId64"MB)",
+              __FUNCTION__,
+              (uint64_t)base_pfn << XC_PAGE_SHIFT,
+              (uint64_t)(base_pfn + nr_pfns) << XC_PAGE_SHIFT,
+              (uint64_t)nr_pfns >> (20-XC_PAGE_SHIFT));
+
+    for ( pfn = 0; pfn < nr_pfns; pfn++ )
+        dom->p2m_host[pfn] = base_pfn + pfn;
+
+    for ( pfn = rc = allocsz = 0; (pfn < nr_pfns) && !rc; pfn += allocsz )
+    {
+        allocsz = nr_pfns - pfn;
+        if ( allocsz > 1024*1024 )
+            allocsz = 1024*1024;
+
+        rc = xc_domain_populate_physmap_exact(
+            dom->xch, dom->guest_domid, allocsz,
+            0, 0, &dom->p2m_host[pfn]);
+    }
+
+    return rc;
+}
+
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
     int rc;
-    xen_pfn_t pfn, allocsz, i;
+    xen_pfn_t pfn;
     uint64_t modbase;
 
     /* Convenient */
     const uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT;
     const uint64_t ramsize = dom->total_pages << XC_PAGE_SHIFT;
     const uint64_t ramend = rambase + ramsize;
+
+    const xen_pfn_t p2m_size = dom->total_pages;
+
     const uint64_t kernbase = dom->kernel_seg.vstart;
     const uint64_t kernend = ROUNDUP(dom->kernel_seg.vend, 21/*2MB*/);
     const uint64_t kernsize = kernend - kernbase;
@@ -289,27 +321,17 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 
     dom->shadow_enabled = 1;
 
-    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * dom->total_pages);
+    dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
     if ( dom->p2m_host == NULL )
         return -EINVAL;
+    for ( pfn = 0; pfn < p2m_size; pfn++ )
+        dom->p2m_host[pfn] = INVALID_MFN;
 
-    /* setup initial p2m */
-    for ( pfn = 0; pfn < dom->total_pages; pfn++ )
-        dom->p2m_host[pfn] = pfn + dom->rambase_pfn;
-
-    /* allocate guest memory */
-    for ( i = rc = allocsz = 0;
-          (i < dom->total_pages) && !rc;
-          i += allocsz )
-    {
-        allocsz = dom->total_pages - i;
-        if ( allocsz > 1024*1024 )
-            allocsz = 1024*1024;
-
-        rc = xc_domain_populate_physmap_exact(
-            dom->xch, dom->guest_domid, allocsz,
-            0, 0, &dom->p2m_host[i]);
-    }
+    /* setup initial p2m and allocate guest memory */
+    if ((rc = populate_guest_memory(dom,
+                                    GUEST_RAM_BASE >> XC_PAGE_SHIFT,
+                                    ramsize >> XC_PAGE_SHIFT)))
+        return rc;
 
     /*
      * We try to place dtb+initrd at 128MB or if we have less RAM
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5Y-0000u4-7A; Thu, 19 Jun 2014 04:36:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5W-0000to-UT
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:39 +0000
Received: from [85.158.143.35:33311] by server-2.bemta-4.messagelabs.com id
	BE/DD-06539-6D862A35; Thu, 19 Jun 2014 04:36:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1403152596!12017370!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3286 invoked from network); 19 Jun 2014 04:36:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5U-0002Si-1p
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5U-0007XB-0h
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:36 +0000
Date: Thu, 19 Jun 2014 04:36:36 +0000
Message-Id: <E1WxU5U-0007XB-0h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: prepare domain builder for
	multiple banks of guest RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45d9867837f099e9eed4189dac5ed39d1fe2ed49
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:41 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:57:12 2014 +0100

    tools: arm: prepare domain builder for multiple banks of guest RAM
    
    Prepare for adding more banks of guest RAM by renaming a bunch of defines
    as RAM0 and replacing variables with arrays and introducing loops.
    
    Also in preparation switch to using GUEST_RAM0_BASE explicitly instead of
    implicitly via dom->rambase_pfn (while asserting that they must be the same).
    This makes the multiple bank case cleaner (although it looks a bit odd for
    now).
    
    GUEST_RAM_BASE is defined as the address of the lowest RAM bank, it is used in
    tools/libxl/libxl_dom.c to call xc_dom_rambase_init().
    
    Lastly for now ramsize (total size) and rambank_size[0] (size of first bank)
    are the same, but use the appropriate one for each context.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_arm.c      |   67 ++++++++++++++++++++++++++++++-----------
 xen/include/public/arch-arm.h |   13 +++++++-
 2 files changed, 60 insertions(+), 20 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index f663206..beec1f1 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -18,6 +18,7 @@
  * Copyright (c) 2011, Citrix Systems
  */
 #include <inttypes.h>
+#include <assert.h>
 
 #include <xen/xen.h>
 #include <xen/io/protocols.h>
@@ -279,17 +280,16 @@ static int populate_guest_memory(struct xc_dom_image *dom,
 
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
-    int rc;
+    int i, rc;
     xen_pfn_t pfn;
     uint64_t modbase;
 
-    /* Convenient */
-    const uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT;
-    const uint64_t ramsize = dom->total_pages << XC_PAGE_SHIFT;
-    const uint64_t ramend = rambase + ramsize;
+    uint64_t ramsize = (uint64_t)dom->total_pages << XC_PAGE_SHIFT;
 
-    const xen_pfn_t p2m_size = dom->total_pages;
+    const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
+    const uint64_t bankmax[] = GUEST_RAM_BANK_SIZES;
 
+    /* Convenient */
     const uint64_t kernbase = dom->kernel_seg.vstart;
     const uint64_t kernend = ROUNDUP(dom->kernel_seg.vend, 21/*2MB*/);
     const uint64_t kernsize = kernend - kernbase;
@@ -298,20 +298,32 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     const uint64_t ramdisk_size = dom->ramdisk_blob ?
         ROUNDUP(dom->ramdisk_size, XC_PAGE_SHIFT) : 0;
     const uint64_t modsize = dtb_size + ramdisk_size;
-    const uint64_t ram128mb = rambase + (128<<20);
+    const uint64_t ram128mb = bankbase[0] + (128<<20);
+
+    xen_pfn_t p2m_size;
+    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
+    uint64_t bank0end;
+
+    assert(dom->rambase_pfn << XC_PAGE_SHIFT == bankbase[0]);
 
-    if ( modsize + kernsize > ramsize )
+    if ( modsize + kernsize > bankmax[0] )
     {
         DOMPRINTF("%s: Not enough memory for the kernel+dtb+initrd",
                   __FUNCTION__);
         return -1;
     }
 
-    if ( ramsize > GUEST_RAM_SIZE )
+    if ( ramsize == 0 )
+    {
+        DOMPRINTF("%s: ram size is 0", __FUNCTION__);
+        return -1;
+    }
+
+    if ( ramsize > GUEST_RAM_MAX )
     {
         DOMPRINTF("%s: ram size is too large for guest address space: "
                   "%"PRIx64" > %llx",
-                  __FUNCTION__, ramsize, GUEST_RAM_SIZE);
+                  __FUNCTION__, ramsize, GUEST_RAM_MAX);
         return -1;
     }
 
@@ -321,6 +333,20 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 
     dom->shadow_enabled = 1;
 
+    for ( i = 0; ramsize && i < GUEST_RAM_BANKS; i++ )
+    {
+        uint64_t banksize = ramsize > bankmax[i] ? bankmax[i] : ramsize;
+
+        ramsize -= banksize;
+
+        p2m_size = ( bankbase[i] + banksize - bankbase[0] ) >> XC_PAGE_SHIFT;
+
+        rambank_size[i] = banksize >> XC_PAGE_SHIFT;
+    }
+
+    assert(rambank_size[0] != 0);
+    assert(ramsize == 0); /* Too much RAM is rejected above */
+
     dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
     if ( dom->p2m_host == NULL )
         return -EINVAL;
@@ -328,10 +354,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_MFN;
 
     /* setup initial p2m and allocate guest memory */
-    if ((rc = populate_guest_memory(dom,
-                                    GUEST_RAM_BASE >> XC_PAGE_SHIFT,
-                                    ramsize >> XC_PAGE_SHIFT)))
-        return rc;
+    for ( i = 0; rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    {
+        if ((rc = populate_guest_memory(dom,
+                                        bankbase[i] >> XC_PAGE_SHIFT,
+                                        rambank_size[i])))
+            return rc;
+    }
 
     /*
      * We try to place dtb+initrd at 128MB or if we have less RAM
@@ -341,11 +370,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
      * If changing this then consider
      * xen/arch/arm/kernel.c:place_modules as well.
      */
-    if ( ramend >= ram128mb + modsize && kernend < ram128mb )
+    bank0end = bankbase[0] + ((uint64_t)rambank_size[0] << XC_PAGE_SHIFT);
+
+    if ( bank0end >= ram128mb + modsize && kernend < ram128mb )
         modbase = ram128mb;
-    else if ( ramend - modsize > kernend )
-        modbase = ramend - modsize;
-    else if (kernbase - rambase > modsize )
+    else if ( bank0end - modsize > kernend )
+        modbase = bank0end - modsize;
+    else if (kernbase - bankbase[0] > modsize )
         modbase = kernbase - modsize;
     else
         return -1;
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index d5090fb..ea74295 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -375,8 +375,17 @@ typedef uint64_t xen_callback_t;
 #define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
 
-#define GUEST_RAM_BASE    0x40000000ULL /* 3GB of RAM @ 1GB */
-#define GUEST_RAM_SIZE    0xc0000000ULL
+#define GUEST_RAM_BANKS   1
+
+#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of RAM @ 1GB */
+#define GUEST_RAM0_SIZE   0xc0000000ULL
+
+#define GUEST_RAM_BASE    GUEST_RAM0_BASE /* Lowest RAM address */
+/* Largest amount of actual RAM, not including holes */
+#define GUEST_RAM_MAX     (GUEST_RAM0_SIZE)
+/* Suitable for e.g. const uint64_t ramfoo[] = GUEST_RAM_BANK_FOOS; */
+#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE }
+#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE }
 
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5Y-0000u4-7A; Thu, 19 Jun 2014 04:36:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5W-0000to-UT
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:39 +0000
Received: from [85.158.143.35:33311] by server-2.bemta-4.messagelabs.com id
	BE/DD-06539-6D862A35; Thu, 19 Jun 2014 04:36:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1403152596!12017370!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3286 invoked from network); 19 Jun 2014 04:36:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5U-0002Si-1p
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5U-0007XB-0h
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:36 +0000
Date: Thu, 19 Jun 2014 04:36:36 +0000
Message-Id: <E1WxU5U-0007XB-0h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: prepare domain builder for
	multiple banks of guest RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 45d9867837f099e9eed4189dac5ed39d1fe2ed49
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:41 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:57:12 2014 +0100

    tools: arm: prepare domain builder for multiple banks of guest RAM
    
    Prepare for adding more banks of guest RAM by renaming a bunch of defines
    as RAM0 and replacing variables with arrays and introducing loops.
    
    Also in preparation switch to using GUEST_RAM0_BASE explicitly instead of
    implicitly via dom->rambase_pfn (while asserting that they must be the same).
    This makes the multiple bank case cleaner (although it looks a bit odd for
    now).
    
    GUEST_RAM_BASE is defined as the address of the lowest RAM bank, it is used in
    tools/libxl/libxl_dom.c to call xc_dom_rambase_init().
    
    Lastly for now ramsize (total size) and rambank_size[0] (size of first bank)
    are the same, but use the appropriate one for each context.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_dom_arm.c      |   67 ++++++++++++++++++++++++++++++-----------
 xen/include/public/arch-arm.h |   13 +++++++-
 2 files changed, 60 insertions(+), 20 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index f663206..beec1f1 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -18,6 +18,7 @@
  * Copyright (c) 2011, Citrix Systems
  */
 #include <inttypes.h>
+#include <assert.h>
 
 #include <xen/xen.h>
 #include <xen/io/protocols.h>
@@ -279,17 +280,16 @@ static int populate_guest_memory(struct xc_dom_image *dom,
 
 int arch_setup_meminit(struct xc_dom_image *dom)
 {
-    int rc;
+    int i, rc;
     xen_pfn_t pfn;
     uint64_t modbase;
 
-    /* Convenient */
-    const uint64_t rambase = dom->rambase_pfn << XC_PAGE_SHIFT;
-    const uint64_t ramsize = dom->total_pages << XC_PAGE_SHIFT;
-    const uint64_t ramend = rambase + ramsize;
+    uint64_t ramsize = (uint64_t)dom->total_pages << XC_PAGE_SHIFT;
 
-    const xen_pfn_t p2m_size = dom->total_pages;
+    const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
+    const uint64_t bankmax[] = GUEST_RAM_BANK_SIZES;
 
+    /* Convenient */
     const uint64_t kernbase = dom->kernel_seg.vstart;
     const uint64_t kernend = ROUNDUP(dom->kernel_seg.vend, 21/*2MB*/);
     const uint64_t kernsize = kernend - kernbase;
@@ -298,20 +298,32 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     const uint64_t ramdisk_size = dom->ramdisk_blob ?
         ROUNDUP(dom->ramdisk_size, XC_PAGE_SHIFT) : 0;
     const uint64_t modsize = dtb_size + ramdisk_size;
-    const uint64_t ram128mb = rambase + (128<<20);
+    const uint64_t ram128mb = bankbase[0] + (128<<20);
+
+    xen_pfn_t p2m_size;
+    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
+    uint64_t bank0end;
+
+    assert(dom->rambase_pfn << XC_PAGE_SHIFT == bankbase[0]);
 
-    if ( modsize + kernsize > ramsize )
+    if ( modsize + kernsize > bankmax[0] )
     {
         DOMPRINTF("%s: Not enough memory for the kernel+dtb+initrd",
                   __FUNCTION__);
         return -1;
     }
 
-    if ( ramsize > GUEST_RAM_SIZE )
+    if ( ramsize == 0 )
+    {
+        DOMPRINTF("%s: ram size is 0", __FUNCTION__);
+        return -1;
+    }
+
+    if ( ramsize > GUEST_RAM_MAX )
     {
         DOMPRINTF("%s: ram size is too large for guest address space: "
                   "%"PRIx64" > %llx",
-                  __FUNCTION__, ramsize, GUEST_RAM_SIZE);
+                  __FUNCTION__, ramsize, GUEST_RAM_MAX);
         return -1;
     }
 
@@ -321,6 +333,20 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 
     dom->shadow_enabled = 1;
 
+    for ( i = 0; ramsize && i < GUEST_RAM_BANKS; i++ )
+    {
+        uint64_t banksize = ramsize > bankmax[i] ? bankmax[i] : ramsize;
+
+        ramsize -= banksize;
+
+        p2m_size = ( bankbase[i] + banksize - bankbase[0] ) >> XC_PAGE_SHIFT;
+
+        rambank_size[i] = banksize >> XC_PAGE_SHIFT;
+    }
+
+    assert(rambank_size[0] != 0);
+    assert(ramsize == 0); /* Too much RAM is rejected above */
+
     dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
     if ( dom->p2m_host == NULL )
         return -EINVAL;
@@ -328,10 +354,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_MFN;
 
     /* setup initial p2m and allocate guest memory */
-    if ((rc = populate_guest_memory(dom,
-                                    GUEST_RAM_BASE >> XC_PAGE_SHIFT,
-                                    ramsize >> XC_PAGE_SHIFT)))
-        return rc;
+    for ( i = 0; rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    {
+        if ((rc = populate_guest_memory(dom,
+                                        bankbase[i] >> XC_PAGE_SHIFT,
+                                        rambank_size[i])))
+            return rc;
+    }
 
     /*
      * We try to place dtb+initrd at 128MB or if we have less RAM
@@ -341,11 +370,13 @@ int arch_setup_meminit(struct xc_dom_image *dom)
      * If changing this then consider
      * xen/arch/arm/kernel.c:place_modules as well.
      */
-    if ( ramend >= ram128mb + modsize && kernend < ram128mb )
+    bank0end = bankbase[0] + ((uint64_t)rambank_size[0] << XC_PAGE_SHIFT);
+
+    if ( bank0end >= ram128mb + modsize && kernend < ram128mb )
         modbase = ram128mb;
-    else if ( ramend - modsize > kernend )
-        modbase = ramend - modsize;
-    else if (kernbase - rambase > modsize )
+    else if ( bank0end - modsize > kernend )
+        modbase = bank0end - modsize;
+    else if (kernbase - bankbase[0] > modsize )
         modbase = kernbase - modsize;
     else
         return -1;
diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index d5090fb..ea74295 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -375,8 +375,17 @@ typedef uint64_t xen_callback_t;
 #define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
 
-#define GUEST_RAM_BASE    0x40000000ULL /* 3GB of RAM @ 1GB */
-#define GUEST_RAM_SIZE    0xc0000000ULL
+#define GUEST_RAM_BANKS   1
+
+#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of RAM @ 1GB */
+#define GUEST_RAM0_SIZE   0xc0000000ULL
+
+#define GUEST_RAM_BASE    GUEST_RAM0_BASE /* Lowest RAM address */
+/* Largest amount of actual RAM, not including holes */
+#define GUEST_RAM_MAX     (GUEST_RAM0_SIZE)
+/* Suitable for e.g. const uint64_t ramfoo[] = GUEST_RAM_BANK_FOOS; */
+#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE }
+#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE }
 
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5j-0000vd-9x; Thu, 19 Jun 2014 04:36:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5h-0000vF-6L
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:49 +0000
Received: from [85.158.139.211:57889] by server-6.bemta-5.messagelabs.com id
	26/F1-25531-0E862A35; Thu, 19 Jun 2014 04:36:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403152606!10755793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18255 invoked from network); 19 Jun 2014 04:36:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5e-0002So-GI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5e-0007Xp-5c
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:46 +0000
Date: Thu, 19 Jun 2014 04:36:46 +0000
Message-Id: <E1WxU5e-0007Xp-5c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: prepare guest FDT building
	for multiple RAM banks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 705df41e532d90bcec4b6827c70ca869b89543e9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:42 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:58:05 2014 +0100

    tools: arm: prepare guest FDT building for multiple RAM banks
    
    This required exposing the sizes of the banks determined by the domain builder
    up to libxl via xc_dom_image.
    
    Since the domain build needs to know the size of the DTB we create placeholder
    nodes for each possible bank and when we finalise the DTB we fill in the ones
    which are actually populated and NOP out the rest.
    
    Note that the number of guest RAM banks is still 1 after this change.
    
    Also fixes a coding style violation in
    libxl__arch_domain_finalise_hw_description while there.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- minor coding style fix ]
---
 tools/libxc/xc_dom.h     |   10 ++++++-
 tools/libxc/xc_dom_arm.c |   11 +++----
 tools/libxl/libxl_arm.c  |   73 +++++++++++++++++++++++++++++++++++-----------
 3 files changed, 70 insertions(+), 24 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index c9af0ce..6ae6a9f 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -114,13 +114,21 @@ struct xc_dom_image {
 
     /* physical memory
      *
-     * A PV guest has a single contiguous block of physical RAM,
+     * An x86 PV guest has a single contiguous block of physical RAM,
      * consisting of total_pages starting at rambase_pfn.
+     *
+     * An ARM guest has GUEST_RAM_BANKS regions of RAM, with
+     * rambank_size[i] pages in each. The lowest RAM address
+     * (corresponding to the base of the p2m arrays above) is stored
+     * in rambase_pfn.
      */
     xen_pfn_t rambase_pfn;
     xen_pfn_t total_pages;
     struct xc_dom_phys *phys_pages;
     int realmodearea_log;
+#if defined (__arm__) || defined(__aarch64__)
+    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
+#endif
 
     /* malloc memory pool */
     struct xc_dom_mem *memblocks;
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index beec1f1..75f8363 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -301,7 +301,6 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     const uint64_t ram128mb = bankbase[0] + (128<<20);
 
     xen_pfn_t p2m_size;
-    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
     uint64_t bank0end;
 
     assert(dom->rambase_pfn << XC_PAGE_SHIFT == bankbase[0]);
@@ -341,10 +340,10 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 
         p2m_size = ( bankbase[i] + banksize - bankbase[0] ) >> XC_PAGE_SHIFT;
 
-        rambank_size[i] = banksize >> XC_PAGE_SHIFT;
+        dom->rambank_size[i] = banksize >> XC_PAGE_SHIFT;
     }
 
-    assert(rambank_size[0] != 0);
+    assert(dom->rambank_size[0] != 0);
     assert(ramsize == 0); /* Too much RAM is rejected above */
 
     dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
@@ -354,11 +353,11 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_MFN;
 
     /* setup initial p2m and allocate guest memory */
-    for ( i = 0; rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; dom->rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
     {
         if ((rc = populate_guest_memory(dom,
                                         bankbase[i] >> XC_PAGE_SHIFT,
-                                        rambank_size[i])))
+                                        dom->rambank_size[i])))
             return rc;
     }
 
@@ -370,7 +369,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
      * If changing this then consider
      * xen/arch/arm/kernel.c:place_modules as well.
      */
-    bank0end = bankbase[0] + ((uint64_t)rambank_size[0] << XC_PAGE_SHIFT);
+    bank0end = bankbase[0] + ((uint64_t)dom->rambank_size[0] << XC_PAGE_SHIFT);
 
     if ( bank0end >= ram128mb + modsize && kernend < ram128mb )
         modbase = ram128mb;
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 215ef9e..21c3399 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -255,24 +255,31 @@ static int make_psci_node(libxl__gc *gc, void *fdt)
     return 0;
 }
 
-static int make_memory_node(libxl__gc *gc, void *fdt,
-                            uint64_t base, uint64_t size)
+static int make_memory_nodes(libxl__gc *gc, void *fdt,
+                             const struct xc_dom_image *dom)
 {
-    int res;
-    const char *name = GCSPRINTF("memory@%"PRIx64, base);
+    int res, i;
+    const char *name;
+    const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
 
-    res = fdt_begin_node(fdt, name);
-    if (res) return res;
+    for (i = 0; i < GUEST_RAM_BANKS; i++) {
+        name = GCSPRINTF("memory@%"PRIx64, bankbase[i]);
 
-    res = fdt_property_string(fdt, "device_type", "memory");
-    if (res) return res;
+        LOG(DEBUG, "Creating placeholder node /%s", name);
 
-    res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
-                            1, base, size);
-    if (res) return res;
+        res = fdt_begin_node(fdt, name);
+        if (res) return res;
 
-    res = fdt_end_node(fdt);
-    if (res) return res;
+        res = fdt_property_string(fdt, "device_type", "memory");
+        if (res) return res;
+
+        res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
+                                1, 0, 0);
+        if (res) return res;
+
+        res = fdt_end_node(fdt);
+        if (res) return res;
+    }
 
     return 0;
 }
@@ -489,9 +496,7 @@ next_resize:
         FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
-        FDT( make_memory_node(gc, fdt,
-                              dom->rambase_pfn << XC_PAGE_SHIFT,
-                              info->target_memkb * 1024) );
+        FDT( make_memory_nodes(gc, fdt, dom) );
         FDT( make_intc_node(gc, fdt,
                             GUEST_GICD_BASE, GUEST_GICD_SIZE,
                             GUEST_GICC_BASE, GUEST_GICD_SIZE) );
@@ -521,11 +526,38 @@ out:
     return rc;
 }
 
+static void finalise_one_memory_node(libxl__gc *gc, void *fdt,
+                                     uint64_t base, uint64_t size)
+{
+    int node, res;
+    const char *name = GCSPRINTF("/memory@%"PRIx64, base);
+
+    node = fdt_path_offset(fdt, name);
+    assert(node > 0);
+
+    if (size == 0) {
+        LOG(DEBUG, "Nopping out placeholder node %s", name);
+        fdt_nop_node(fdt, node);
+    } else {
+        uint32_t regs[ROOT_ADDRESS_CELLS+ROOT_SIZE_CELLS];
+        be32 *cells = &regs[0];
+
+        LOG(DEBUG, "Populating placeholder node %s", name);
+
+        set_range(&cells, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS, base, size);
+
+        res = fdt_setprop_inplace(fdt, node, "reg", regs, sizeof(regs));
+        assert(!res);
+    }
+}
+
 int libxl__arch_domain_finalise_hw_description(libxl__gc *gc,
                                                libxl_domain_build_info *info,
                                                struct xc_dom_image *dom)
 {
     void *fdt = dom->devicetree_blob;
+    int i;
+    const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
 
     const struct xc_dom_seg *ramdisk = dom->ramdisk_blob ?
         &dom->ramdisk_seg : NULL;
@@ -552,9 +584,16 @@ int libxl__arch_domain_finalise_hw_description(libxl__gc *gc,
         assert(!res);
 
         val = cpu_to_fdt64(ramdisk->vend);
-        res = fdt_setprop_inplace(fdt, chosen,PROP_INITRD_END,
+        res = fdt_setprop_inplace(fdt, chosen, PROP_INITRD_END,
                                   &val, sizeof(val));
         assert(!res);
+
+    }
+
+    for (i = 0; i < GUEST_RAM_BANKS; i++) {
+        const uint64_t size = (uint64_t)dom->rambank_size[i] << XC_PAGE_SHIFT;
+
+        finalise_one_memory_node(gc, fdt, bankbase[i], size);
     }
 
     debug_dump_fdt(gc, fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:36:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:36:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5j-0000vd-9x; Thu, 19 Jun 2014 04:36:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5h-0000vF-6L
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:49 +0000
Received: from [85.158.139.211:57889] by server-6.bemta-5.messagelabs.com id
	26/F1-25531-0E862A35; Thu, 19 Jun 2014 04:36:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403152606!10755793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18255 invoked from network); 19 Jun 2014 04:36:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5e-0002So-GI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5e-0007Xp-5c
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:46 +0000
Date: Thu, 19 Jun 2014 04:36:46 +0000
Message-Id: <E1WxU5e-0007Xp-5c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: prepare guest FDT building
	for multiple RAM banks
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 705df41e532d90bcec4b6827c70ca869b89543e9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:42 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:58:05 2014 +0100

    tools: arm: prepare guest FDT building for multiple RAM banks
    
    This required exposing the sizes of the banks determined by the domain builder
    up to libxl via xc_dom_image.
    
    Since the domain build needs to know the size of the DTB we create placeholder
    nodes for each possible bank and when we finalise the DTB we fill in the ones
    which are actually populated and NOP out the rest.
    
    Note that the number of guest RAM banks is still 1 after this change.
    
    Also fixes a coding style violation in
    libxl__arch_domain_finalise_hw_description while there.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    [ ijc -- minor coding style fix ]
---
 tools/libxc/xc_dom.h     |   10 ++++++-
 tools/libxc/xc_dom_arm.c |   11 +++----
 tools/libxl/libxl_arm.c  |   73 +++++++++++++++++++++++++++++++++++-----------
 3 files changed, 70 insertions(+), 24 deletions(-)

diff --git a/tools/libxc/xc_dom.h b/tools/libxc/xc_dom.h
index c9af0ce..6ae6a9f 100644
--- a/tools/libxc/xc_dom.h
+++ b/tools/libxc/xc_dom.h
@@ -114,13 +114,21 @@ struct xc_dom_image {
 
     /* physical memory
      *
-     * A PV guest has a single contiguous block of physical RAM,
+     * An x86 PV guest has a single contiguous block of physical RAM,
      * consisting of total_pages starting at rambase_pfn.
+     *
+     * An ARM guest has GUEST_RAM_BANKS regions of RAM, with
+     * rambank_size[i] pages in each. The lowest RAM address
+     * (corresponding to the base of the p2m arrays above) is stored
+     * in rambase_pfn.
      */
     xen_pfn_t rambase_pfn;
     xen_pfn_t total_pages;
     struct xc_dom_phys *phys_pages;
     int realmodearea_log;
+#if defined (__arm__) || defined(__aarch64__)
+    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
+#endif
 
     /* malloc memory pool */
     struct xc_dom_mem *memblocks;
diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index beec1f1..75f8363 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -301,7 +301,6 @@ int arch_setup_meminit(struct xc_dom_image *dom)
     const uint64_t ram128mb = bankbase[0] + (128<<20);
 
     xen_pfn_t p2m_size;
-    xen_pfn_t rambank_size[GUEST_RAM_BANKS];
     uint64_t bank0end;
 
     assert(dom->rambase_pfn << XC_PAGE_SHIFT == bankbase[0]);
@@ -341,10 +340,10 @@ int arch_setup_meminit(struct xc_dom_image *dom)
 
         p2m_size = ( bankbase[i] + banksize - bankbase[0] ) >> XC_PAGE_SHIFT;
 
-        rambank_size[i] = banksize >> XC_PAGE_SHIFT;
+        dom->rambank_size[i] = banksize >> XC_PAGE_SHIFT;
     }
 
-    assert(rambank_size[0] != 0);
+    assert(dom->rambank_size[0] != 0);
     assert(ramsize == 0); /* Too much RAM is rejected above */
 
     dom->p2m_host = xc_dom_malloc(dom, sizeof(xen_pfn_t) * p2m_size);
@@ -354,11 +353,11 @@ int arch_setup_meminit(struct xc_dom_image *dom)
         dom->p2m_host[pfn] = INVALID_MFN;
 
     /* setup initial p2m and allocate guest memory */
-    for ( i = 0; rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
+    for ( i = 0; dom->rambank_size[i] && i < GUEST_RAM_BANKS; i++ )
     {
         if ((rc = populate_guest_memory(dom,
                                         bankbase[i] >> XC_PAGE_SHIFT,
-                                        rambank_size[i])))
+                                        dom->rambank_size[i])))
             return rc;
     }
 
@@ -370,7 +369,7 @@ int arch_setup_meminit(struct xc_dom_image *dom)
      * If changing this then consider
      * xen/arch/arm/kernel.c:place_modules as well.
      */
-    bank0end = bankbase[0] + ((uint64_t)rambank_size[0] << XC_PAGE_SHIFT);
+    bank0end = bankbase[0] + ((uint64_t)dom->rambank_size[0] << XC_PAGE_SHIFT);
 
     if ( bank0end >= ram128mb + modsize && kernend < ram128mb )
         modbase = ram128mb;
diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
index 215ef9e..21c3399 100644
--- a/tools/libxl/libxl_arm.c
+++ b/tools/libxl/libxl_arm.c
@@ -255,24 +255,31 @@ static int make_psci_node(libxl__gc *gc, void *fdt)
     return 0;
 }
 
-static int make_memory_node(libxl__gc *gc, void *fdt,
-                            uint64_t base, uint64_t size)
+static int make_memory_nodes(libxl__gc *gc, void *fdt,
+                             const struct xc_dom_image *dom)
 {
-    int res;
-    const char *name = GCSPRINTF("memory@%"PRIx64, base);
+    int res, i;
+    const char *name;
+    const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
 
-    res = fdt_begin_node(fdt, name);
-    if (res) return res;
+    for (i = 0; i < GUEST_RAM_BANKS; i++) {
+        name = GCSPRINTF("memory@%"PRIx64, bankbase[i]);
 
-    res = fdt_property_string(fdt, "device_type", "memory");
-    if (res) return res;
+        LOG(DEBUG, "Creating placeholder node /%s", name);
 
-    res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
-                            1, base, size);
-    if (res) return res;
+        res = fdt_begin_node(fdt, name);
+        if (res) return res;
 
-    res = fdt_end_node(fdt);
-    if (res) return res;
+        res = fdt_property_string(fdt, "device_type", "memory");
+        if (res) return res;
+
+        res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS,
+                                1, 0, 0);
+        if (res) return res;
+
+        res = fdt_end_node(fdt);
+        if (res) return res;
+    }
 
     return 0;
 }
@@ -489,9 +496,7 @@ next_resize:
         FDT( make_cpus_node(gc, fdt, info->max_vcpus, ainfo) );
         FDT( make_psci_node(gc, fdt) );
 
-        FDT( make_memory_node(gc, fdt,
-                              dom->rambase_pfn << XC_PAGE_SHIFT,
-                              info->target_memkb * 1024) );
+        FDT( make_memory_nodes(gc, fdt, dom) );
         FDT( make_intc_node(gc, fdt,
                             GUEST_GICD_BASE, GUEST_GICD_SIZE,
                             GUEST_GICC_BASE, GUEST_GICD_SIZE) );
@@ -521,11 +526,38 @@ out:
     return rc;
 }
 
+static void finalise_one_memory_node(libxl__gc *gc, void *fdt,
+                                     uint64_t base, uint64_t size)
+{
+    int node, res;
+    const char *name = GCSPRINTF("/memory@%"PRIx64, base);
+
+    node = fdt_path_offset(fdt, name);
+    assert(node > 0);
+
+    if (size == 0) {
+        LOG(DEBUG, "Nopping out placeholder node %s", name);
+        fdt_nop_node(fdt, node);
+    } else {
+        uint32_t regs[ROOT_ADDRESS_CELLS+ROOT_SIZE_CELLS];
+        be32 *cells = &regs[0];
+
+        LOG(DEBUG, "Populating placeholder node %s", name);
+
+        set_range(&cells, ROOT_ADDRESS_CELLS, ROOT_SIZE_CELLS, base, size);
+
+        res = fdt_setprop_inplace(fdt, node, "reg", regs, sizeof(regs));
+        assert(!res);
+    }
+}
+
 int libxl__arch_domain_finalise_hw_description(libxl__gc *gc,
                                                libxl_domain_build_info *info,
                                                struct xc_dom_image *dom)
 {
     void *fdt = dom->devicetree_blob;
+    int i;
+    const uint64_t bankbase[] = GUEST_RAM_BANK_BASES;
 
     const struct xc_dom_seg *ramdisk = dom->ramdisk_blob ?
         &dom->ramdisk_seg : NULL;
@@ -552,9 +584,16 @@ int libxl__arch_domain_finalise_hw_description(libxl__gc *gc,
         assert(!res);
 
         val = cpu_to_fdt64(ramdisk->vend);
-        res = fdt_setprop_inplace(fdt, chosen,PROP_INITRD_END,
+        res = fdt_setprop_inplace(fdt, chosen, PROP_INITRD_END,
                                   &val, sizeof(val));
         assert(!res);
+
+    }
+
+    for (i = 0; i < GUEST_RAM_BANKS; i++) {
+        const uint64_t size = (uint64_t)dom->rambank_size[i] << XC_PAGE_SHIFT;
+
+        finalise_one_memory_node(gc, fdt, bankbase[i], size);
     }
 
     debug_dump_fdt(gc, fdt);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5t-0000wv-Cb; Thu, 19 Jun 2014 04:37:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5r-0000wd-H4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:59 +0000
Received: from [85.158.137.68:43959] by server-14.bemta-3.messagelabs.com id
	9C/98-30903-AE862A35; Thu, 19 Jun 2014 04:36:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403152616!11008563!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14543 invoked from network); 19 Jun 2014 04:36:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5o-0002Su-Ow
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5o-0007YN-Mx
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:56 +0000
Date: Thu, 19 Jun 2014 04:36:56 +0000
Message-Id: <E1WxU5o-0007YN-Mx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: support up to (almost) 1TB
	of guest RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf52565e0da9bef64a9a6a32e848ce6de87da05e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:43 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:58:27 2014 +0100

    tools: arm: support up to (almost) 1TB of guest RAM
    
    This creates a second bank of RAM starting at 8GB and potentially
    extending to the 1TB boundary, which is the limit imposed by our
    current use of a 3 level p2m with 2 pages at level 0 (2^40 bits).
    
    I've deliberately left a gap between the two banks just to
    exercise those code paths.
    
    The second bank is 1016GB in size which plus the 3GB below 4GB is
    1019GB maximum guest RAM. At the point where the fact that this
    is slightly less than a full TB starts to become an issue for
    people then we can switch to a 4 level p2m, which would be needed
    to support guests larger than 1TB anyhow.
    
    Tested on 32-bit with 1, 4 and 6GB guests. Anything more than
    ~3GB requires an LPAE enabled kernel, or a 64-bit guest.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ea74295..fd30782 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -375,17 +375,20 @@ typedef uint64_t xen_callback_t;
 #define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
 
-#define GUEST_RAM_BANKS   1
+#define GUEST_RAM_BANKS   2
 
-#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of RAM @ 1GB */
+#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of low RAM @ 1GB */
 #define GUEST_RAM0_SIZE   0xc0000000ULL
 
+#define GUEST_RAM1_BASE   0x0200000000ULL /* 1016GB of RAM @ 8GB */
+#define GUEST_RAM1_SIZE   0xfe00000000ULL
+
 #define GUEST_RAM_BASE    GUEST_RAM0_BASE /* Lowest RAM address */
 /* Largest amount of actual RAM, not including holes */
-#define GUEST_RAM_MAX     (GUEST_RAM0_SIZE)
+#define GUEST_RAM_MAX     (GUEST_RAM0_SIZE + GUEST_RAM1_SIZE)
 /* Suitable for e.g. const uint64_t ramfoo[] = GUEST_RAM_BANK_FOOS; */
-#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE }
-#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE }
+#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
+#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
 
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU5t-0000wv-Cb; Thu, 19 Jun 2014 04:37:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5r-0000wd-H4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:59 +0000
Received: from [85.158.137.68:43959] by server-14.bemta-3.messagelabs.com id
	9C/98-30903-AE862A35; Thu, 19 Jun 2014 04:36:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403152616!11008563!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14543 invoked from network); 19 Jun 2014 04:36:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:36:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5o-0002Su-Ow
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5o-0007YN-Mx
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:36:56 +0000
Date: Thu, 19 Jun 2014 04:36:56 +0000
Message-Id: <E1WxU5o-0007YN-Mx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: support up to (almost) 1TB
	of guest RAM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf52565e0da9bef64a9a6a32e848ce6de87da05e
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:43 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:58:27 2014 +0100

    tools: arm: support up to (almost) 1TB of guest RAM
    
    This creates a second bank of RAM starting at 8GB and potentially
    extending to the 1TB boundary, which is the limit imposed by our
    current use of a 3 level p2m with 2 pages at level 0 (2^40 bits).
    
    I've deliberately left a gap between the two banks just to
    exercise those code paths.
    
    The second bank is 1016GB in size which plus the 3GB below 4GB is
    1019GB maximum guest RAM. At the point where the fact that this
    is slightly less than a full TB starts to become an issue for
    people then we can switch to a 4 level p2m, which would be needed
    to support guests larger than 1TB anyhow.
    
    Tested on 32-bit with 1, 4 and 6GB guests. Anything more than
    ~3GB requires an LPAE enabled kernel, or a 64-bit guest.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/include/public/arch-arm.h |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index ea74295..fd30782 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -375,17 +375,20 @@ typedef uint64_t xen_callback_t;
 #define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
 
-#define GUEST_RAM_BANKS   1
+#define GUEST_RAM_BANKS   2
 
-#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of RAM @ 1GB */
+#define GUEST_RAM0_BASE   0x40000000ULL /* 3GB of low RAM @ 1GB */
 #define GUEST_RAM0_SIZE   0xc0000000ULL
 
+#define GUEST_RAM1_BASE   0x0200000000ULL /* 1016GB of RAM @ 8GB */
+#define GUEST_RAM1_SIZE   0xfe00000000ULL
+
 #define GUEST_RAM_BASE    GUEST_RAM0_BASE /* Lowest RAM address */
 /* Largest amount of actual RAM, not including holes */
-#define GUEST_RAM_MAX     (GUEST_RAM0_SIZE)
+#define GUEST_RAM_MAX     (GUEST_RAM0_SIZE + GUEST_RAM1_SIZE)
 /* Suitable for e.g. const uint64_t ramfoo[] = GUEST_RAM_BANK_FOOS; */
-#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE }
-#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE }
+#define GUEST_RAM_BANK_BASES   { GUEST_RAM0_BASE, GUEST_RAM1_BASE }
+#define GUEST_RAM_BANK_SIZES   { GUEST_RAM0_SIZE, GUEST_RAM1_SIZE }
 
 /* Interrupts */
 #define GUEST_TIMER_VIRT_PPI    27
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU63-0000yM-FA; Thu, 19 Jun 2014 04:37:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU61-0000y2-GY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:09 +0000
Received: from [85.158.137.68:32734] by server-17.bemta-3.messagelabs.com id
	E1/86-22741-4F862A35; Thu, 19 Jun 2014 04:37:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1403152627!11024425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21145 invoked from network); 19 Jun 2014 04:37:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5y-0002TT-VK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5y-0007Yw-TJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:06 +0000
Date: Thu, 19 Jun 2014 04:37:06 +0000
Message-Id: <E1WxU5y-0007Yw-TJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: increase size of region
	set aside for guest grant table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0af0306c2700dee81280a0eb1034a2c706d11968
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:44 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:58:42 2014 +0100

    tools: arm: increase size of region set aside for guest grant table
    
    The current size is sufficient for the default maximum grant table size
    (32-frames), but increase the reserved region to 16M/4096 pages to allow for
    the use of the gnttab_max_nr_frames command line option.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/include/public/arch-arm.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index fd30782..ac54cd6 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -369,8 +369,11 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICC_BASE   0x03002000ULL
 #define GUEST_GICC_SIZE   0x00000100ULL
 
+/* 16MB == 4096 pages reserved for guest to use as a region to map its
+ * grant table in.
+ */
 #define GUEST_GNTTAB_BASE 0x38000000ULL
-#define GUEST_GNTTAB_SIZE 0x00020000ULL
+#define GUEST_GNTTAB_SIZE 0x01000000ULL
 
 #define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU63-0000yM-FA; Thu, 19 Jun 2014 04:37:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU61-0000y2-GY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:09 +0000
Received: from [85.158.137.68:32734] by server-17.bemta-3.messagelabs.com id
	E1/86-22741-4F862A35; Thu, 19 Jun 2014 04:37:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1403152627!11024425!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21145 invoked from network); 19 Jun 2014 04:37:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5y-0002TT-VK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU5y-0007Yw-TJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:06 +0000
Date: Thu, 19 Jun 2014 04:37:06 +0000
Message-Id: <E1WxU5y-0007Yw-TJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: arm: increase size of region
	set aside for guest grant table
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0af0306c2700dee81280a0eb1034a2c706d11968
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Thu May 22 10:46:44 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 14:58:42 2014 +0100

    tools: arm: increase size of region set aside for guest grant table
    
    The current size is sufficient for the default maximum grant table size
    (32-frames), but increase the reserved region to 16M/4096 pages to allow for
    the use of the gnttab_max_nr_frames command line option.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 xen/include/public/arch-arm.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/xen/include/public/arch-arm.h b/xen/include/public/arch-arm.h
index fd30782..ac54cd6 100644
--- a/xen/include/public/arch-arm.h
+++ b/xen/include/public/arch-arm.h
@@ -369,8 +369,11 @@ typedef uint64_t xen_callback_t;
 #define GUEST_GICC_BASE   0x03002000ULL
 #define GUEST_GICC_SIZE   0x00000100ULL
 
+/* 16MB == 4096 pages reserved for guest to use as a region to map its
+ * grant table in.
+ */
 #define GUEST_GNTTAB_BASE 0x38000000ULL
-#define GUEST_GNTTAB_SIZE 0x00020000ULL
+#define GUEST_GNTTAB_SIZE 0x01000000ULL
 
 #define GUEST_MAGIC_BASE  0x39000000ULL
 #define GUEST_MAGIC_SIZE  0x01000000ULL
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6D-0000zy-Hm; Thu, 19 Jun 2014 04:37:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6B-0000zf-W5
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:20 +0000
Received: from [193.109.254.147:63482] by server-13.bemta-14.messagelabs.com
	id 99/DE-23211-FF862A35; Thu, 19 Jun 2014 04:37:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1403152637!12261596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31784 invoked from network); 19 Jun 2014 04:37:18 -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;
	19 Jun 2014 04:37:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU69-0002TZ-5f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU69-0007a1-3Y
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:17 +0000
Date: Thu, 19 Jun 2014 04:37:17 +0000
Message-Id: <E1WxU69-0007a1-3Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: update to seabios rel-1.7.4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cde61591f93c6bd0a8c3b43f65f06674a1b93293
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed May 14 10:10:03 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 15:08:25 2014 +0100

    tools: update to seabios rel-1.7.4
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk                     |    6 +++---
 tools/firmware/seabios-config |   10 ++++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6a93533..5e03e87 100644
--- a/Config.mk
+++ b/Config.mk
@@ -235,9 +235,9 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
-# Fri Aug 2 14:12:09 2013 -0400
-# Fix bug in CBFS file walking with compressed files.
+SEABIOS_UPSTREAM_TAG ?= rel-1.7.4
+# Sun Dec 22 10:42:26 2013 -0500
+# coreboot: Make sure to print the SeaBIOS version in cbmem debug output.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
diff --git a/tools/firmware/seabios-config b/tools/firmware/seabios-config
index a497162..f42d497 100644
--- a/tools/firmware/seabios-config
+++ b/tools/firmware/seabios-config
@@ -1,7 +1,6 @@
 #
-# Automatically generated make config: don't edit
+# Automatically generated file; DO NOT EDIT.
 # SeaBIOS Configuration
-# Mon Sep 23 12:59:01 2013
 #
 
 #
@@ -19,6 +18,8 @@ CONFIG_BOOTMENU=y
 # CONFIG_BOOTSPLASH is not set
 CONFIG_BOOTORDER=y
 CONFIG_ENTRY_EXTRASTACK=y
+CONFIG_MALLOC_UPPERMEMORY=y
+CONFIG_ROM_SIZE=0
 
 #
 # Hardware support
@@ -29,6 +30,7 @@ CONFIG_ATA_PIO32=y
 CONFIG_AHCI=y
 CONFIG_VIRTIO_BLK=y
 CONFIG_VIRTIO_SCSI=y
+CONFIG_PVSCSI=y
 CONFIG_ESP_SCSI=y
 CONFIG_LSI_SCSI=y
 CONFIG_MEGASAS=y
@@ -38,6 +40,7 @@ CONFIG_USB=y
 CONFIG_USB_UHCI=y
 CONFIG_USB_OHCI=y
 CONFIG_USB_EHCI=y
+CONFIG_USB_XHCI=y
 CONFIG_USB_MSC=y
 CONFIG_USB_UAS=y
 CONFIG_USB_HUB=y
@@ -68,6 +71,7 @@ CONFIG_MOUSE=y
 CONFIG_S3_RESUME=y
 CONFIG_VGAHOOKS=y
 # CONFIG_DISABLE_A20 is not set
+# CONFIG_WRITABLE_UPPERMEMORY is not set
 
 #
 # BIOS Tables
@@ -77,6 +81,7 @@ CONFIG_MPTABLE=y
 CONFIG_SMBIOS=y
 CONFIG_ACPI=y
 CONFIG_ACPI_DSDT=y
+CONFIG_FW_ROMFILE_LOAD=y
 
 #
 # VGA ROM
@@ -88,6 +93,7 @@ CONFIG_NO_VGABIOS=y
 # CONFIG_VGA_GEODEGX2 is not set
 # CONFIG_VGA_GEODELX is not set
 # CONFIG_BUILD_VGABIOS is not set
+CONFIG_VGA_EXTRA_STACK_SIZE=512
 
 #
 # Debugging
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6D-0000zy-Hm; Thu, 19 Jun 2014 04:37:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6B-0000zf-W5
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:20 +0000
Received: from [193.109.254.147:63482] by server-13.bemta-14.messagelabs.com
	id 99/DE-23211-FF862A35; Thu, 19 Jun 2014 04:37:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1403152637!12261596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD,UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31784 invoked from network); 19 Jun 2014 04:37:18 -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;
	19 Jun 2014 04:37:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU69-0002TZ-5f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU69-0007a1-3Y
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:17 +0000
Date: Thu, 19 Jun 2014 04:37:17 +0000
Message-Id: <E1WxU69-0007a1-3Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: update to seabios rel-1.7.4
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cde61591f93c6bd0a8c3b43f65f06674a1b93293
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed May 14 10:10:03 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 15:08:25 2014 +0100

    tools: update to seabios rel-1.7.4
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 Config.mk                     |    6 +++---
 tools/firmware/seabios-config |   10 ++++++++--
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Config.mk b/Config.mk
index 6a93533..5e03e87 100644
--- a/Config.mk
+++ b/Config.mk
@@ -235,9 +235,9 @@ SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
-# Fri Aug 2 14:12:09 2013 -0400
-# Fix bug in CBFS file walking with compressed files.
+SEABIOS_UPSTREAM_TAG ?= rel-1.7.4
+# Sun Dec 22 10:42:26 2013 -0500
+# coreboot: Make sure to print the SeaBIOS version in cbmem debug output.
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
diff --git a/tools/firmware/seabios-config b/tools/firmware/seabios-config
index a497162..f42d497 100644
--- a/tools/firmware/seabios-config
+++ b/tools/firmware/seabios-config
@@ -1,7 +1,6 @@
 #
-# Automatically generated make config: don't edit
+# Automatically generated file; DO NOT EDIT.
 # SeaBIOS Configuration
-# Mon Sep 23 12:59:01 2013
 #
 
 #
@@ -19,6 +18,8 @@ CONFIG_BOOTMENU=y
 # CONFIG_BOOTSPLASH is not set
 CONFIG_BOOTORDER=y
 CONFIG_ENTRY_EXTRASTACK=y
+CONFIG_MALLOC_UPPERMEMORY=y
+CONFIG_ROM_SIZE=0
 
 #
 # Hardware support
@@ -29,6 +30,7 @@ CONFIG_ATA_PIO32=y
 CONFIG_AHCI=y
 CONFIG_VIRTIO_BLK=y
 CONFIG_VIRTIO_SCSI=y
+CONFIG_PVSCSI=y
 CONFIG_ESP_SCSI=y
 CONFIG_LSI_SCSI=y
 CONFIG_MEGASAS=y
@@ -38,6 +40,7 @@ CONFIG_USB=y
 CONFIG_USB_UHCI=y
 CONFIG_USB_OHCI=y
 CONFIG_USB_EHCI=y
+CONFIG_USB_XHCI=y
 CONFIG_USB_MSC=y
 CONFIG_USB_UAS=y
 CONFIG_USB_HUB=y
@@ -68,6 +71,7 @@ CONFIG_MOUSE=y
 CONFIG_S3_RESUME=y
 CONFIG_VGAHOOKS=y
 # CONFIG_DISABLE_A20 is not set
+# CONFIG_WRITABLE_UPPERMEMORY is not set
 
 #
 # BIOS Tables
@@ -77,6 +81,7 @@ CONFIG_MPTABLE=y
 CONFIG_SMBIOS=y
 CONFIG_ACPI=y
 CONFIG_ACPI_DSDT=y
+CONFIG_FW_ROMFILE_LOAD=y
 
 #
 # VGA ROM
@@ -88,6 +93,7 @@ CONFIG_NO_VGABIOS=y
 # CONFIG_VGA_GEODEGX2 is not set
 # CONFIG_VGA_GEODELX is not set
 # CONFIG_BUILD_VGABIOS is not set
+CONFIG_VGA_EXTRA_STACK_SIZE=512
 
 #
 # Debugging
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6M-000128-NV; Thu, 19 Jun 2014 04:37:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6M-00011s-2K
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:30 +0000
Received: from [85.158.137.68:45147] by server-1.bemta-3.messagelabs.com id
	8A/7B-13056-90962A35; Thu, 19 Jun 2014 04:37:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403152647!10883756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.9 required=7.0 tests=BIZ_TLD,UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6720 invoked from network); 19 Jun 2014 04:37:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6J-0002Tf-DX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6J-0007aN-Bc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:27 +0000
Date: Thu, 19 Jun 2014 04:37:27 +0000
Message-Id: <E1WxU6J-0007aN-Bc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Use SeaBIOS's defconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79e0f772a9857ac101b4608e05951964d928a02c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed May 14 10:10:04 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 15:09:15 2014 +0100

    tools: Use SeaBIOS's defconfig
    
    Compared with our local config this enables CONFIG_BOOTSPLASH and disables
    CONFIG_ATA_DMA and CONFIG_ATA_PIO32.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Don Slutz <dslutz@verizon.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/firmware/Makefile       |    2 +-
 tools/firmware/seabios-config |  103 -----------------------------------------
 2 files changed, 1 insertions(+), 104 deletions(-)

diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index dcb56e5..9d1fdec 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -23,7 +23,7 @@ ovmf-dir:
 
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
-	cp seabios-config seabios-dir/.config;
+	$(MAKE) -C seabios-dir defconfig
 
 .PHONY: all
 all: $(SUBDIRS-y)
diff --git a/tools/firmware/seabios-config b/tools/firmware/seabios-config
deleted file mode 100644
index f42d497..0000000
--- a/tools/firmware/seabios-config
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Automatically generated file; DO NOT EDIT.
-# SeaBIOS Configuration
-#
-
-#
-# General Features
-#
-# CONFIG_COREBOOT is not set
-CONFIG_QEMU=y
-# CONFIG_CSM is not set
-CONFIG_QEMU_HARDWARE=y
-CONFIG_XEN=y
-CONFIG_THREADS=y
-# CONFIG_THREAD_OPTIONROMS is not set
-CONFIG_RELOCATE_INIT=y
-CONFIG_BOOTMENU=y
-# CONFIG_BOOTSPLASH is not set
-CONFIG_BOOTORDER=y
-CONFIG_ENTRY_EXTRASTACK=y
-CONFIG_MALLOC_UPPERMEMORY=y
-CONFIG_ROM_SIZE=0
-
-#
-# Hardware support
-#
-CONFIG_ATA=y
-CONFIG_ATA_DMA=y
-CONFIG_ATA_PIO32=y
-CONFIG_AHCI=y
-CONFIG_VIRTIO_BLK=y
-CONFIG_VIRTIO_SCSI=y
-CONFIG_PVSCSI=y
-CONFIG_ESP_SCSI=y
-CONFIG_LSI_SCSI=y
-CONFIG_MEGASAS=y
-CONFIG_FLOPPY=y
-CONFIG_PS2PORT=y
-CONFIG_USB=y
-CONFIG_USB_UHCI=y
-CONFIG_USB_OHCI=y
-CONFIG_USB_EHCI=y
-CONFIG_USB_XHCI=y
-CONFIG_USB_MSC=y
-CONFIG_USB_UAS=y
-CONFIG_USB_HUB=y
-CONFIG_USB_KEYBOARD=y
-CONFIG_USB_MOUSE=y
-CONFIG_SERIAL=y
-CONFIG_LPT=y
-CONFIG_USE_SMM=y
-CONFIG_MTRR_INIT=y
-CONFIG_PMTIMER=y
-
-#
-# BIOS interfaces
-#
-CONFIG_DRIVES=y
-CONFIG_CDROM_BOOT=y
-CONFIG_CDROM_EMU=y
-CONFIG_PCIBIOS=y
-CONFIG_APMBIOS=y
-CONFIG_PNPBIOS=y
-CONFIG_OPTIONROMS=y
-# CONFIG_OPTIONROMS_DEPLOYED is not set
-CONFIG_PMM=y
-CONFIG_BOOT=y
-CONFIG_KEYBOARD=y
-CONFIG_KBD_CALL_INT15_4F=y
-CONFIG_MOUSE=y
-CONFIG_S3_RESUME=y
-CONFIG_VGAHOOKS=y
-# CONFIG_DISABLE_A20 is not set
-# CONFIG_WRITABLE_UPPERMEMORY is not set
-
-#
-# BIOS Tables
-#
-CONFIG_PIRTABLE=y
-CONFIG_MPTABLE=y
-CONFIG_SMBIOS=y
-CONFIG_ACPI=y
-CONFIG_ACPI_DSDT=y
-CONFIG_FW_ROMFILE_LOAD=y
-
-#
-# VGA ROM
-#
-CONFIG_NO_VGABIOS=y
-# CONFIG_VGA_STANDARD_VGA is not set
-# CONFIG_VGA_CIRRUS is not set
-# CONFIG_VGA_BOCHS is not set
-# CONFIG_VGA_GEODEGX2 is not set
-# CONFIG_VGA_GEODELX is not set
-# CONFIG_BUILD_VGABIOS is not set
-CONFIG_VGA_EXTRA_STACK_SIZE=512
-
-#
-# Debugging
-#
-CONFIG_DEBUG_LEVEL=1
-# CONFIG_DEBUG_SERIAL is not set
-CONFIG_DEBUG_IO=y
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6M-000128-NV; Thu, 19 Jun 2014 04:37:30 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6M-00011s-2K
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:30 +0000
Received: from [85.158.137.68:45147] by server-1.bemta-3.messagelabs.com id
	8A/7B-13056-90962A35; Thu, 19 Jun 2014 04:37:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403152647!10883756!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.9 required=7.0 tests=BIZ_TLD,UPPERCASE_50_75
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6720 invoked from network); 19 Jun 2014 04:37:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6J-0002Tf-DX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6J-0007aN-Bc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:27 +0000
Date: Thu, 19 Jun 2014 04:37:27 +0000
Message-Id: <E1WxU6J-0007aN-Bc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools: Use SeaBIOS's defconfig
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 79e0f772a9857ac101b4608e05951964d928a02c
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed May 14 10:10:04 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 15:09:15 2014 +0100

    tools: Use SeaBIOS's defconfig
    
    Compared with our local config this enables CONFIG_BOOTSPLASH and disables
    CONFIG_ATA_DMA and CONFIG_ATA_PIO32.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Don Slutz <dslutz@verizon.com>
    Tested-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/firmware/Makefile       |    2 +-
 tools/firmware/seabios-config |  103 -----------------------------------------
 2 files changed, 1 insertions(+), 104 deletions(-)

diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index dcb56e5..9d1fdec 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -23,7 +23,7 @@ ovmf-dir:
 
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
-	cp seabios-config seabios-dir/.config;
+	$(MAKE) -C seabios-dir defconfig
 
 .PHONY: all
 all: $(SUBDIRS-y)
diff --git a/tools/firmware/seabios-config b/tools/firmware/seabios-config
deleted file mode 100644
index f42d497..0000000
--- a/tools/firmware/seabios-config
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Automatically generated file; DO NOT EDIT.
-# SeaBIOS Configuration
-#
-
-#
-# General Features
-#
-# CONFIG_COREBOOT is not set
-CONFIG_QEMU=y
-# CONFIG_CSM is not set
-CONFIG_QEMU_HARDWARE=y
-CONFIG_XEN=y
-CONFIG_THREADS=y
-# CONFIG_THREAD_OPTIONROMS is not set
-CONFIG_RELOCATE_INIT=y
-CONFIG_BOOTMENU=y
-# CONFIG_BOOTSPLASH is not set
-CONFIG_BOOTORDER=y
-CONFIG_ENTRY_EXTRASTACK=y
-CONFIG_MALLOC_UPPERMEMORY=y
-CONFIG_ROM_SIZE=0
-
-#
-# Hardware support
-#
-CONFIG_ATA=y
-CONFIG_ATA_DMA=y
-CONFIG_ATA_PIO32=y
-CONFIG_AHCI=y
-CONFIG_VIRTIO_BLK=y
-CONFIG_VIRTIO_SCSI=y
-CONFIG_PVSCSI=y
-CONFIG_ESP_SCSI=y
-CONFIG_LSI_SCSI=y
-CONFIG_MEGASAS=y
-CONFIG_FLOPPY=y
-CONFIG_PS2PORT=y
-CONFIG_USB=y
-CONFIG_USB_UHCI=y
-CONFIG_USB_OHCI=y
-CONFIG_USB_EHCI=y
-CONFIG_USB_XHCI=y
-CONFIG_USB_MSC=y
-CONFIG_USB_UAS=y
-CONFIG_USB_HUB=y
-CONFIG_USB_KEYBOARD=y
-CONFIG_USB_MOUSE=y
-CONFIG_SERIAL=y
-CONFIG_LPT=y
-CONFIG_USE_SMM=y
-CONFIG_MTRR_INIT=y
-CONFIG_PMTIMER=y
-
-#
-# BIOS interfaces
-#
-CONFIG_DRIVES=y
-CONFIG_CDROM_BOOT=y
-CONFIG_CDROM_EMU=y
-CONFIG_PCIBIOS=y
-CONFIG_APMBIOS=y
-CONFIG_PNPBIOS=y
-CONFIG_OPTIONROMS=y
-# CONFIG_OPTIONROMS_DEPLOYED is not set
-CONFIG_PMM=y
-CONFIG_BOOT=y
-CONFIG_KEYBOARD=y
-CONFIG_KBD_CALL_INT15_4F=y
-CONFIG_MOUSE=y
-CONFIG_S3_RESUME=y
-CONFIG_VGAHOOKS=y
-# CONFIG_DISABLE_A20 is not set
-# CONFIG_WRITABLE_UPPERMEMORY is not set
-
-#
-# BIOS Tables
-#
-CONFIG_PIRTABLE=y
-CONFIG_MPTABLE=y
-CONFIG_SMBIOS=y
-CONFIG_ACPI=y
-CONFIG_ACPI_DSDT=y
-CONFIG_FW_ROMFILE_LOAD=y
-
-#
-# VGA ROM
-#
-CONFIG_NO_VGABIOS=y
-# CONFIG_VGA_STANDARD_VGA is not set
-# CONFIG_VGA_CIRRUS is not set
-# CONFIG_VGA_BOCHS is not set
-# CONFIG_VGA_GEODEGX2 is not set
-# CONFIG_VGA_GEODELX is not set
-# CONFIG_BUILD_VGABIOS is not set
-CONFIG_VGA_EXTRA_STACK_SIZE=512
-
-#
-# Debugging
-#
-CONFIG_DEBUG_LEVEL=1
-# CONFIG_DEBUG_SERIAL is not set
-CONFIG_DEBUG_IO=y
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6h-000158-S0; Thu, 19 Jun 2014 04:37:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6g-00014s-S4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:51 +0000
Received: from [85.158.137.68:51931] by server-16.bemta-3.messagelabs.com id
	A5/95-13481-E1962A35; Thu, 19 Jun 2014 04:37:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1403152668!7281433!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25737 invoked from network); 19 Jun 2014 04:37:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6d-0002Tl-Ql
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6d-0007b9-Pg
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:47 +0000
Date: Thu, 19 Jun 2014 04:37:47 +0000
Message-Id: <E1WxU6d-0007b9-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: grant: Add another entry to
	map MFN 1:1 in dom0 p2m
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 552710b388630dfa461932940a998e120c42277d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue May 27 12:11:41 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 16:46:41 2014 +0100

    xen/arm: grant: Add another entry to map MFN 1:1 in dom0 p2m
    
    Grant mappings can be used for DMA requests. Currently the dev_bus_addr returned
    by the hypercall is the MFN (not the IPA). Guest expects to be able the returned
    address for DMA. When the device is protected by IOMMU the request will fail.
    Therefore, we have to add 1:1 mapping in the domain p2m to allow DMA request
    to work.
    
    This is valid because DOM0 has its memory mapped 1:1 and therefore we know
    that RAM and devices cannot clash.
    
    If the guest only owns protected device, the return dev_bus_addr should be an
    IPA. This will allow us to remove safely the 1:1 mapping and make grant mapping
    works correctly in the guest. For now, this is not addressed by this patch.
    
    The grant mapping code does the reference counting on every MFN and will
    call iommu_{map,unmap}_page when necessary. This was already handle for x86
    PV guests, so we can reuse the same code path for ARM guest.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    [ ijc s/ld/d/ in both arch's gnttab_need_iommu_mapping() ]
---
 xen/arch/arm/p2m.c                 |    2 +
 xen/common/grant_table.c           |    4 +-
 xen/drivers/passthrough/arm/smmu.c |   42 ++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/grant_table.h  |    3 ++
 xen/include/asm-arm/p2m.h          |    3 ++
 xen/include/asm-x86/grant_table.h  |    3 ++
 6 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 96bc0ef..810459a 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -227,6 +227,7 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
         e.p2m.write = 0;
         break;
 
+    case p2m_iommu_map_rw:
     case p2m_map_foreign:
     case p2m_grant_map_rw:
     case p2m_mmio_direct:
@@ -234,6 +235,7 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
         e.p2m.write = 1;
         break;
 
+    case p2m_iommu_map_ro:
     case p2m_grant_map_ro:
     case p2m_invalid:
         e.p2m.xn = 1;
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2c93d9c..c08e957 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -727,7 +727,7 @@ __gnttab_map_grant_ref(
 
     double_gt_lock(lgt, rgt);
 
-    if ( !paging_mode_translate(ld) && need_iommu(ld) )
+    if ( gnttab_need_iommu_mapping(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
@@ -935,7 +935,7 @@ __gnttab_unmap_common(
             act->pin -= GNTPIN_hstw_inc;
     }
 
-    if ( !paging_mode_translate(ld) && need_iommu(ld) )
+    if ( gnttab_need_iommu_mapping(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 21b4572..f4eb2a2 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1536,6 +1536,46 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
     xfree(smmu_domain);
 }
 
+static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
+                             unsigned long mfn, unsigned int flags)
+{
+    p2m_type_t t;
+
+    /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
+     * the hypercall is the MFN (not the IPA). For device protected by
+     * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
+     * allow DMA request to work.
+     * This is only valid when the domain is directed mapped. Hence this
+     * function should only be used by gnttab code with gfn == mfn.
+     */
+    BUG_ON(!is_domain_direct_mapped(d));
+    BUG_ON(mfn != gfn);
+
+    /* We only support readable and writable flags */
+    if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
+        return -EINVAL;
+
+    t = (flags & IOMMUF_writable) ? p2m_iommu_map_rw : p2m_iommu_map_ro;
+
+    /* The function guest_physmap_add_entry replaces the current mapping
+     * if there is already one...
+     */
+    return guest_physmap_add_entry(d, gfn, mfn, 0, t);
+}
+
+static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
+{
+    /* This function should only be used by gnttab code when the domain
+     * is direct mapped
+     */
+    if ( !is_domain_direct_mapped(d) )
+        return -EINVAL;
+
+    guest_physmap_remove_page(d, gfn, gfn, 0);
+
+    return 0;
+}
+
 static const struct iommu_ops arm_smmu_iommu_ops = {
     .init = arm_smmu_iommu_domain_init,
     .hwdom_init = arm_smmu_iommu_hwdom_init,
@@ -1544,6 +1584,8 @@ static const struct iommu_ops arm_smmu_iommu_ops = {
     .iotlb_flush_all = arm_smmu_iotlb_flush_all,
     .assign_dt_device = arm_smmu_attach_dev,
     .reassign_dt_device = arm_smmu_reassign_dt_dev,
+    .map_page = arm_smmu_map_page,
+    .unmap_page = arm_smmu_unmap_page,
 };
 
 static int __init smmu_init(struct dt_device_node *dev,
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index 6e0cc59..eac8a70 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -33,6 +33,9 @@ static inline int replace_grant_supported(void)
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
      (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
 
+#define gnttab_need_iommu_mapping(d)                    \
+    (is_domain_direct_mapped(d) && need_iommu(d))
+
 #endif /* __ASM_GRANT_TABLE_H__ */
 /*
  * Local variables:
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index bd71abe..911d32d 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -45,6 +45,9 @@ typedef enum {
     p2m_map_foreign,    /* Ram pages from foreign domain */
     p2m_grant_map_rw,   /* Read/write grant mapping */
     p2m_grant_map_ro,   /* Read-only grant mapping */
+    /* The types below are only used to decide the page attribute in the P2M */
+    p2m_iommu_map_rw,   /* Read/write iommu mapping */
+    p2m_iommu_map_ro,   /* Read-only iommu mapping */
     p2m_max_real_type,  /* Types after this won't be store in the p2m */
 } p2m_type_t;
 
diff --git a/xen/include/asm-x86/grant_table.h b/xen/include/asm-x86/grant_table.h
index 3013869..8c9bbcf 100644
--- a/xen/include/asm-x86/grant_table.h
+++ b/xen/include/asm-x86/grant_table.h
@@ -65,6 +65,9 @@ static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st)
 /* Done implicitly when page tables are destroyed. */
 #define gnttab_release_host_mappings(domain) ( paging_mode_external(domain) )
 
+#define gnttab_need_iommu_mapping(d)                \
+    (!paging_mode_translate(d) && need_iommu(d))
+
 static inline int replace_grant_supported(void)
 {
     return 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:37:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:37:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6h-000158-S0; Thu, 19 Jun 2014 04:37:51 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6g-00014s-S4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:51 +0000
Received: from [85.158.137.68:51931] by server-16.bemta-3.messagelabs.com id
	A5/95-13481-E1962A35; Thu, 19 Jun 2014 04:37:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-31.messagelabs.com!1403152668!7281433!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25737 invoked from network); 19 Jun 2014 04:37:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6d-0002Tl-Ql
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6d-0007b9-Pg
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:47 +0000
Date: Thu, 19 Jun 2014 04:37:47 +0000
Message-Id: <E1WxU6d-0007b9-Pg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: grant: Add another entry to
	map MFN 1:1 in dom0 p2m
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 552710b388630dfa461932940a998e120c42277d
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue May 27 12:11:41 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 16:46:41 2014 +0100

    xen/arm: grant: Add another entry to map MFN 1:1 in dom0 p2m
    
    Grant mappings can be used for DMA requests. Currently the dev_bus_addr returned
    by the hypercall is the MFN (not the IPA). Guest expects to be able the returned
    address for DMA. When the device is protected by IOMMU the request will fail.
    Therefore, we have to add 1:1 mapping in the domain p2m to allow DMA request
    to work.
    
    This is valid because DOM0 has its memory mapped 1:1 and therefore we know
    that RAM and devices cannot clash.
    
    If the guest only owns protected device, the return dev_bus_addr should be an
    IPA. This will allow us to remove safely the 1:1 mapping and make grant mapping
    works correctly in the guest. For now, this is not addressed by this patch.
    
    The grant mapping code does the reference counting on every MFN and will
    call iommu_{map,unmap}_page when necessary. This was already handle for x86
    PV guests, so we can reuse the same code path for ARM guest.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    [ ijc s/ld/d/ in both arch's gnttab_need_iommu_mapping() ]
---
 xen/arch/arm/p2m.c                 |    2 +
 xen/common/grant_table.c           |    4 +-
 xen/drivers/passthrough/arm/smmu.c |   42 ++++++++++++++++++++++++++++++++++++
 xen/include/asm-arm/grant_table.h  |    3 ++
 xen/include/asm-arm/p2m.h          |    3 ++
 xen/include/asm-x86/grant_table.h  |    3 ++
 6 files changed, 55 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 96bc0ef..810459a 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -227,6 +227,7 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
         e.p2m.write = 0;
         break;
 
+    case p2m_iommu_map_rw:
     case p2m_map_foreign:
     case p2m_grant_map_rw:
     case p2m_mmio_direct:
@@ -234,6 +235,7 @@ static lpae_t mfn_to_p2m_entry(unsigned long mfn, unsigned int mattr,
         e.p2m.write = 1;
         break;
 
+    case p2m_iommu_map_ro:
     case p2m_grant_map_ro:
     case p2m_invalid:
         e.p2m.xn = 1;
diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 2c93d9c..c08e957 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -727,7 +727,7 @@ __gnttab_map_grant_ref(
 
     double_gt_lock(lgt, rgt);
 
-    if ( !paging_mode_translate(ld) && need_iommu(ld) )
+    if ( gnttab_need_iommu_mapping(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
@@ -935,7 +935,7 @@ __gnttab_unmap_common(
             act->pin -= GNTPIN_hstw_inc;
     }
 
-    if ( !paging_mode_translate(ld) && need_iommu(ld) )
+    if ( gnttab_need_iommu_mapping(ld) )
     {
         unsigned int wrc, rdc;
         int err = 0;
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
index 21b4572..f4eb2a2 100644
--- a/xen/drivers/passthrough/arm/smmu.c
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -1536,6 +1536,46 @@ static void arm_smmu_iommu_domain_teardown(struct domain *d)
     xfree(smmu_domain);
 }
 
+static int arm_smmu_map_page(struct domain *d, unsigned long gfn,
+                             unsigned long mfn, unsigned int flags)
+{
+    p2m_type_t t;
+
+    /* Grant mappings can be used for DMA requests. The dev_bus_addr returned by
+     * the hypercall is the MFN (not the IPA). For device protected by
+     * an IOMMU, Xen needs to add a 1:1 mapping in the domain p2m to
+     * allow DMA request to work.
+     * This is only valid when the domain is directed mapped. Hence this
+     * function should only be used by gnttab code with gfn == mfn.
+     */
+    BUG_ON(!is_domain_direct_mapped(d));
+    BUG_ON(mfn != gfn);
+
+    /* We only support readable and writable flags */
+    if ( !(flags & (IOMMUF_readable | IOMMUF_writable)) )
+        return -EINVAL;
+
+    t = (flags & IOMMUF_writable) ? p2m_iommu_map_rw : p2m_iommu_map_ro;
+
+    /* The function guest_physmap_add_entry replaces the current mapping
+     * if there is already one...
+     */
+    return guest_physmap_add_entry(d, gfn, mfn, 0, t);
+}
+
+static int arm_smmu_unmap_page(struct domain *d, unsigned long gfn)
+{
+    /* This function should only be used by gnttab code when the domain
+     * is direct mapped
+     */
+    if ( !is_domain_direct_mapped(d) )
+        return -EINVAL;
+
+    guest_physmap_remove_page(d, gfn, gfn, 0);
+
+    return 0;
+}
+
 static const struct iommu_ops arm_smmu_iommu_ops = {
     .init = arm_smmu_iommu_domain_init,
     .hwdom_init = arm_smmu_iommu_hwdom_init,
@@ -1544,6 +1584,8 @@ static const struct iommu_ops arm_smmu_iommu_ops = {
     .iotlb_flush_all = arm_smmu_iotlb_flush_all,
     .assign_dt_device = arm_smmu_attach_dev,
     .reassign_dt_device = arm_smmu_reassign_dt_dev,
+    .map_page = arm_smmu_map_page,
+    .unmap_page = arm_smmu_unmap_page,
 };
 
 static int __init smmu_init(struct dt_device_node *dev,
diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h
index 6e0cc59..eac8a70 100644
--- a/xen/include/asm-arm/grant_table.h
+++ b/xen/include/asm-arm/grant_table.h
@@ -33,6 +33,9 @@ static inline int replace_grant_supported(void)
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
      (i < max_nr_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
 
+#define gnttab_need_iommu_mapping(d)                    \
+    (is_domain_direct_mapped(d) && need_iommu(d))
+
 #endif /* __ASM_GRANT_TABLE_H__ */
 /*
  * Local variables:
diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h
index bd71abe..911d32d 100644
--- a/xen/include/asm-arm/p2m.h
+++ b/xen/include/asm-arm/p2m.h
@@ -45,6 +45,9 @@ typedef enum {
     p2m_map_foreign,    /* Ram pages from foreign domain */
     p2m_grant_map_rw,   /* Read/write grant mapping */
     p2m_grant_map_ro,   /* Read-only grant mapping */
+    /* The types below are only used to decide the page attribute in the P2M */
+    p2m_iommu_map_rw,   /* Read/write iommu mapping */
+    p2m_iommu_map_ro,   /* Read-only iommu mapping */
     p2m_max_real_type,  /* Types after this won't be store in the p2m */
 } p2m_type_t;
 
diff --git a/xen/include/asm-x86/grant_table.h b/xen/include/asm-x86/grant_table.h
index 3013869..8c9bbcf 100644
--- a/xen/include/asm-x86/grant_table.h
+++ b/xen/include/asm-x86/grant_table.h
@@ -65,6 +65,9 @@ static inline void gnttab_clear_flag(unsigned int nr, uint16_t *st)
 /* Done implicitly when page tables are destroyed. */
 #define gnttab_release_host_mappings(domain) ( paging_mode_external(domain) )
 
+#define gnttab_need_iommu_mapping(d)                \
+    (!paging_mode_translate(d) && need_iommu(d))
+
 static inline int replace_grant_supported(void)
 {
     return 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6t-00016J-Hj; Thu, 19 Jun 2014 04:38:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6q-000168-E2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:00 +0000
Received: from [85.158.143.35:43952] by server-1.bemta-4.messagelabs.com id
	50/71-09496-72962A35; Thu, 19 Jun 2014 04:37:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1403152678!12371031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23262 invoked from network); 19 Jun 2014 04:37:59 -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;
	19 Jun 2014 04:37:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6n-0002Tv-VZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6n-0007bV-Tz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:57 +0000
Date: Thu, 19 Jun 2014 04:37:57 +0000
Message-Id: <E1WxU6n-0007bV-Tz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add definitions for NOP operation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1911b1b3106f410e411115ba8ac0ac69718ca9bf
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:29:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:29:12 2014 +0200

    x86: add definitions for NOP operation
    
    This patch adds definitions for different length of NOP operation.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/nops.h |   66 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/nops.h b/xen/include/asm-x86/nops.h
new file mode 100644
index 0000000..05f9162
--- /dev/null
+++ b/xen/include/asm-x86/nops.h
@@ -0,0 +1,66 @@
+#ifndef __X86_ASM_NOPS_H__
+#define __X86_ASM_NOPS_H__
+
+#include <xen/config.h>
+
+/*
+ * Define nops for use with alternative().
+ */
+
+/*
+ * Opteron 64bit nops
+ * 1: nop
+ * 2: osp nop
+ * 3: osp osp nop
+ * 4: osp osp osp nop
+ */
+#define K8_NOP1 0x90
+#define K8_NOP2 0x66,K8_NOP1
+#define K8_NOP3 0x66,K8_NOP2
+#define K8_NOP4 0x66,K8_NOP3
+#define K8_NOP5 K8_NOP3,K8_NOP2
+#define K8_NOP6 K8_NOP3,K8_NOP3
+#define K8_NOP7 K8_NOP4,K8_NOP3
+#define K8_NOP8 K8_NOP4,K8_NOP4
+
+/*
+ * P6 nops
+ * uses eax dependencies (Intel-recommended choice)
+ * 1: nop
+ * 2: osp nop
+ * 3: nopl (%eax)
+ * 4: nopl 0x00(%eax)
+ * 5: nopl 0x00(%eax,%eax,1)
+ * 6: osp nopl 0x00(%eax,%eax,1)
+ * 7: nopl 0x00000000(%eax)
+ * 8: nopl 0x00000000(%eax,%eax,1)
+ *    Note: All the above are assumed to be a single instruction.
+ *          There is kernel code that depends on this.
+ */
+#define P6_NOP1 0x90
+#define P6_NOP2 0x66,0x90
+#define P6_NOP3 0x0f,0x1f,0x00
+#define P6_NOP4 0x0f,0x1f,0x40,0
+#define P6_NOP5 0x0f,0x1f,0x44,0x00,0
+#define P6_NOP6 0x66,0x0f,0x1f,0x44,0x00,0
+#define P6_NOP7 0x0f,0x1f,0x80,0,0,0,0
+#define P6_NOP8 0x0f,0x1f,0x84,0x00,0,0,0,0
+
+#ifdef __ASSEMBLY__
+#define _ASM_MK_NOP(x) .byte x
+#else
+#define _ASM_MK_NOP(x) ".byte " __stringify(x) "\n"
+#endif
+
+#define ASM_NOP1 _ASM_MK_NOP(K8_NOP1)
+#define ASM_NOP2 _ASM_MK_NOP(K8_NOP2)
+#define ASM_NOP3 _ASM_MK_NOP(K8_NOP3)
+#define ASM_NOP4 _ASM_MK_NOP(K8_NOP4)
+#define ASM_NOP5 _ASM_MK_NOP(K8_NOP5)
+#define ASM_NOP6 _ASM_MK_NOP(K8_NOP6)
+#define ASM_NOP7 _ASM_MK_NOP(K8_NOP7)
+#define ASM_NOP8 _ASM_MK_NOP(K8_NOP8)
+
+#define ASM_NOP_MAX 8
+
+#endif /* __X86_ASM_NOPS_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU6t-00016J-Hj; Thu, 19 Jun 2014 04:38:03 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6q-000168-E2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:00 +0000
Received: from [85.158.143.35:43952] by server-1.bemta-4.messagelabs.com id
	50/71-09496-72962A35; Thu, 19 Jun 2014 04:37:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1403152678!12371031!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23262 invoked from network); 19 Jun 2014 04:37:59 -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;
	19 Jun 2014 04:37:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6n-0002Tv-VZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6n-0007bV-Tz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:57 +0000
Date: Thu, 19 Jun 2014 04:37:57 +0000
Message-Id: <E1WxU6n-0007bV-Tz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: add definitions for NOP operation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1911b1b3106f410e411115ba8ac0ac69718ca9bf
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:29:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:29:12 2014 +0200

    x86: add definitions for NOP operation
    
    This patch adds definitions for different length of NOP operation.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/include/asm-x86/nops.h |   66 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)

diff --git a/xen/include/asm-x86/nops.h b/xen/include/asm-x86/nops.h
new file mode 100644
index 0000000..05f9162
--- /dev/null
+++ b/xen/include/asm-x86/nops.h
@@ -0,0 +1,66 @@
+#ifndef __X86_ASM_NOPS_H__
+#define __X86_ASM_NOPS_H__
+
+#include <xen/config.h>
+
+/*
+ * Define nops for use with alternative().
+ */
+
+/*
+ * Opteron 64bit nops
+ * 1: nop
+ * 2: osp nop
+ * 3: osp osp nop
+ * 4: osp osp osp nop
+ */
+#define K8_NOP1 0x90
+#define K8_NOP2 0x66,K8_NOP1
+#define K8_NOP3 0x66,K8_NOP2
+#define K8_NOP4 0x66,K8_NOP3
+#define K8_NOP5 K8_NOP3,K8_NOP2
+#define K8_NOP6 K8_NOP3,K8_NOP3
+#define K8_NOP7 K8_NOP4,K8_NOP3
+#define K8_NOP8 K8_NOP4,K8_NOP4
+
+/*
+ * P6 nops
+ * uses eax dependencies (Intel-recommended choice)
+ * 1: nop
+ * 2: osp nop
+ * 3: nopl (%eax)
+ * 4: nopl 0x00(%eax)
+ * 5: nopl 0x00(%eax,%eax,1)
+ * 6: osp nopl 0x00(%eax,%eax,1)
+ * 7: nopl 0x00000000(%eax)
+ * 8: nopl 0x00000000(%eax,%eax,1)
+ *    Note: All the above are assumed to be a single instruction.
+ *          There is kernel code that depends on this.
+ */
+#define P6_NOP1 0x90
+#define P6_NOP2 0x66,0x90
+#define P6_NOP3 0x0f,0x1f,0x00
+#define P6_NOP4 0x0f,0x1f,0x40,0
+#define P6_NOP5 0x0f,0x1f,0x44,0x00,0
+#define P6_NOP6 0x66,0x0f,0x1f,0x44,0x00,0
+#define P6_NOP7 0x0f,0x1f,0x80,0,0,0,0
+#define P6_NOP8 0x0f,0x1f,0x84,0x00,0,0,0,0
+
+#ifdef __ASSEMBLY__
+#define _ASM_MK_NOP(x) .byte x
+#else
+#define _ASM_MK_NOP(x) ".byte " __stringify(x) "\n"
+#endif
+
+#define ASM_NOP1 _ASM_MK_NOP(K8_NOP1)
+#define ASM_NOP2 _ASM_MK_NOP(K8_NOP2)
+#define ASM_NOP3 _ASM_MK_NOP(K8_NOP3)
+#define ASM_NOP4 _ASM_MK_NOP(K8_NOP4)
+#define ASM_NOP5 _ASM_MK_NOP(K8_NOP5)
+#define ASM_NOP6 _ASM_MK_NOP(K8_NOP6)
+#define ASM_NOP7 _ASM_MK_NOP(K8_NOP7)
+#define ASM_NOP8 _ASM_MK_NOP(K8_NOP8)
+
+#define ASM_NOP_MAX 8
+
+#endif /* __X86_ASM_NOPS_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU72-00017d-LJ; Thu, 19 Jun 2014 04:38:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU70-00017K-O2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:10 +0000
Received: from [193.109.254.147:65094] by server-3.bemta-14.messagelabs.com id
	D0/33-22179-23962A35; Thu, 19 Jun 2014 04:38:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1403152688!8916350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27634 invoked from network); 19 Jun 2014 04:38:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6y-0002UU-5R
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6y-0007c1-4N
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:08 +0000
Date: Thu, 19 Jun 2014 04:38:08 +0000
Message-Id: <E1WxU6y-0007c1-4N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make set_nmi_callback return the
	old nmi callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 238faa9daf9f3dff782128302c5fd923e49f2143
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:29:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:29:38 2014 +0200

    x86: make set_nmi_callback return the old nmi callback
    
    This patch makes set_nmi_callback return the old nmi callback, so
    we can set it back later.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c      |    6 +++++-
 xen/include/asm-x86/nmi.h |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index b82b1b3..8161585 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3328,9 +3328,13 @@ void do_nmi(struct cpu_user_regs *regs)
     }
 }
 
-void set_nmi_callback(nmi_callback_t callback)
+nmi_callback_t set_nmi_callback(nmi_callback_t callback)
 {
+    nmi_callback_t old_nmi_callback = nmi_callback;
+
     nmi_callback = callback;
+
+    return old_nmi_callback;
 }
 
 void unset_nmi_callback(void)
diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
index 98b5e04..58cd9a1 100644
--- a/xen/include/asm-x86/nmi.h
+++ b/xen/include/asm-x86/nmi.h
@@ -15,9 +15,9 @@ typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  * set_nmi_callback
  *
  * Set a handler for an NMI. Only one handler may be
- * set. Return 1 if the NMI was handled.
+ * set. Return the old nmi callback handler.
  */
-void set_nmi_callback(nmi_callback_t callback);
+nmi_callback_t set_nmi_callback(nmi_callback_t callback);
  
 /** 
  * unset_nmi_callback
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU72-00017d-LJ; Thu, 19 Jun 2014 04:38:12 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU70-00017K-O2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:10 +0000
Received: from [193.109.254.147:65094] by server-3.bemta-14.messagelabs.com id
	D0/33-22179-23962A35; Thu, 19 Jun 2014 04:38:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1403152688!8916350!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27634 invoked from network); 19 Jun 2014 04:38:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6y-0002UU-5R
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6y-0007c1-4N
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:08 +0000
Date: Thu, 19 Jun 2014 04:38:08 +0000
Message-Id: <E1WxU6y-0007c1-4N@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: make set_nmi_callback return the
	old nmi callback
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 238faa9daf9f3dff782128302c5fd923e49f2143
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:29:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:29:38 2014 +0200

    x86: make set_nmi_callback return the old nmi callback
    
    This patch makes set_nmi_callback return the old nmi callback, so
    we can set it back later.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/traps.c      |    6 +++++-
 xen/include/asm-x86/nmi.h |    4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index b82b1b3..8161585 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3328,9 +3328,13 @@ void do_nmi(struct cpu_user_regs *regs)
     }
 }
 
-void set_nmi_callback(nmi_callback_t callback)
+nmi_callback_t set_nmi_callback(nmi_callback_t callback)
 {
+    nmi_callback_t old_nmi_callback = nmi_callback;
+
     nmi_callback = callback;
+
+    return old_nmi_callback;
 }
 
 void unset_nmi_callback(void)
diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
index 98b5e04..58cd9a1 100644
--- a/xen/include/asm-x86/nmi.h
+++ b/xen/include/asm-x86/nmi.h
@@ -15,9 +15,9 @@ typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  * set_nmi_callback
  *
  * Set a handler for an NMI. Only one handler may be
- * set. Return 1 if the NMI was handled.
+ * set. Return the old nmi callback handler.
  */
-void set_nmi_callback(nmi_callback_t callback);
+nmi_callback_t set_nmi_callback(nmi_callback_t callback);
  
 /** 
  * unset_nmi_callback
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7D-00019F-PS; Thu, 19 Jun 2014 04:38:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7B-00018u-Lh
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:22 +0000
Received: from [193.109.254.147:3621] by server-13.bemta-14.messagelabs.com id
	A3/4F-23211-D3962A35; Thu, 19 Jun 2014 04:38:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403152698!12164481!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32471 invoked from network); 19 Jun 2014 04:38:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU78-0002Ua-Dz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU78-0007ct-9k
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:18 +0000
Date: Thu, 19 Jun 2014 04:38:18 +0000
Message-Id: <E1WxU78-0007ct-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: port the basic alternative
	mechanism from Linux to Xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5542ac7f908c2819fcedb06ee9dc24af94d89566
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:31:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:54:23 2014 +0200

    x86: port the basic alternative mechanism from Linux to Xen
    
    This patch ports the basic alternative mechanism from Linux to Xen.
    With this mechanism, we can patch code based on the CPU features.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/Makefile             |    1 +
 xen/arch/x86/alternative.c        |  213 +++++++++++++++++++++++++++++++++++++
 xen/arch/x86/setup.c              |    3 +
 xen/arch/x86/xen.lds.S            |   15 +++
 xen/include/asm-x86/alternative.h |   78 ++++++++++++++
 5 files changed, 310 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d502bdf..6c90b1b 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -7,6 +7,7 @@ subdir-y += oprofile
 
 subdir-$(x86_64) += x86_64
 
+obj-y += alternative.o
 obj-y += apic.o
 obj-y += bitops.o
 obj-bin-y += bzimage.init.o
diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
new file mode 100644
index 0000000..4b6c948
--- /dev/null
+++ b/xen/arch/x86/alternative.c
@@ -0,0 +1,213 @@
+/******************************************************************************
+ * alternative.c
+ *
+ * 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#include <xen/types.h>
+#include <asm/processor.h>
+#include <asm/alternative.h>
+#include <xen/init.h>
+#include <asm/system.h>
+#include <asm/traps.h>
+#include <asm/nmi.h>
+
+#define MAX_PATCH_LEN (255-1)
+
+extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+
+#ifdef K8_NOP1
+static const unsigned char k8nops[] __initconst = {
+    K8_NOP1,
+    K8_NOP2,
+    K8_NOP3,
+    K8_NOP4,
+    K8_NOP5,
+    K8_NOP6,
+    K8_NOP7,
+    K8_NOP8
+};
+static const unsigned char * const k8_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
+    NULL,
+    k8nops,
+    k8nops + 1,
+    k8nops + 1 + 2,
+    k8nops + 1 + 2 + 3,
+    k8nops + 1 + 2 + 3 + 4,
+    k8nops + 1 + 2 + 3 + 4 + 5,
+    k8nops + 1 + 2 + 3 + 4 + 5 + 6,
+    k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7
+};
+#endif
+
+#ifdef P6_NOP1
+static const unsigned char p6nops[] __initconst = {
+    P6_NOP1,
+    P6_NOP2,
+    P6_NOP3,
+    P6_NOP4,
+    P6_NOP5,
+    P6_NOP6,
+    P6_NOP7,
+    P6_NOP8
+};
+static const unsigned char * const p6_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
+    NULL,
+    p6nops,
+    p6nops + 1,
+    p6nops + 1 + 2,
+    p6nops + 1 + 2 + 3,
+    p6nops + 1 + 2 + 3 + 4,
+    p6nops + 1 + 2 + 3 + 4 + 5,
+    p6nops + 1 + 2 + 3 + 4 + 5 + 6,
+    p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7
+};
+#endif
+
+static const unsigned char * const *ideal_nops __initdata = k8_nops;
+
+static int __init mask_nmi_callback(struct cpu_user_regs *regs, int cpu)
+{
+    return 1;
+}
+
+static void __init arch_init_ideal_nops(void)
+{
+    /*
+     * Due to a decoder implementation quirk, some
+     * specific Intel CPUs actually perform better with
+     * the "k8_nops" than with the SDM-recommended NOPs.
+     */
+    if ( (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) &&
+         !(boot_cpu_data.x86 == 6 &&
+           boot_cpu_data.x86_model >= 0x0f &&
+           boot_cpu_data.x86_model != 0x1c &&
+           boot_cpu_data.x86_model != 0x26 &&
+           boot_cpu_data.x86_model != 0x27 &&
+           boot_cpu_data.x86_model < 0x30) )
+        ideal_nops = p6_nops;
+}
+
+/* Use this to add nops to a buffer, then text_poke the whole buffer. */
+static void __init add_nops(void *insns, unsigned int len)
+{
+    while ( len > 0 )
+    {
+        unsigned int noplen = len;
+        if ( noplen > ASM_NOP_MAX )
+            noplen = ASM_NOP_MAX;
+        memcpy(insns, ideal_nops[noplen], noplen);
+        insns += noplen;
+        len -= noplen;
+    }
+}
+
+/*
+ * text_poke_early - Update instructions on a live kernel at boot time
+ * @addr: address to modify
+ * @opcode: source of the copy
+ * @len: length to copy
+ *
+ * When you use this code to patch more than one byte of an instruction
+ * you need to make sure that other CPUs cannot execute this code in parallel.
+ * Also no thread must be currently preempted in the middle of these
+ * instructions. And on the local CPU you need to be protected again NMI or MCE
+ * handlers seeing an inconsistent instruction while you patch.
+ *
+ * This routine is called with local interrupt disabled.
+ */
+static void *__init text_poke_early(void *addr, const void *opcode, size_t len)
+{
+    memcpy(addr, opcode, len);
+    sync_core();
+
+    return addr;
+}
+
+/*
+ * Replace instructions with better alternatives for this CPU type.
+ * This runs before SMP is initialized to avoid SMP problems with
+ * self modifying code. This implies that asymmetric systems where
+ * APs have less capabilities than the boot processor are not handled.
+ * Tough. Make sure you disable such features by hand.
+ */
+static void __init apply_alternatives(struct alt_instr *start, struct alt_instr *end)
+{
+    struct alt_instr *a;
+    u8 *instr, *replacement;
+    u8 insnbuf[MAX_PATCH_LEN];
+
+    ASSERT(!local_irq_is_enabled());
+
+    printk(KERN_INFO "alt table %p -> %p\n", start, end);
+
+    /*
+     * The scan order should be from start to end. A later scanned
+     * alternative code can overwrite a previous scanned alternative code.
+     * Some kernel functions (e.g. memcpy, memset, etc) use this order to
+     * patch code.
+     *
+     * So be careful if you want to change the scan order to any other
+     * order.
+     */
+    for ( a = start; a < end; a++ )
+    {
+        instr = (u8 *)&a->instr_offset + a->instr_offset;
+        replacement = (u8 *)&a->repl_offset + a->repl_offset;
+        BUG_ON(a->replacementlen > a->instrlen);
+        BUG_ON(a->instrlen > sizeof(insnbuf));
+        BUG_ON(a->cpuid >= NCAPINTS * 32);
+        if ( !boot_cpu_has(a->cpuid) )
+            continue;
+
+        memcpy(insnbuf, replacement, a->replacementlen);
+
+        /* 0xe8/0xe9 are relative branches; fix the offset. */
+        if ( (*insnbuf & 0xfe) == 0xe8 && a->replacementlen == 5 )
+            *(s32 *)(insnbuf + 1) += replacement - instr;
+
+        add_nops(insnbuf + a->replacementlen,
+                 a->instrlen - a->replacementlen);
+        text_poke_early(instr, insnbuf, a->instrlen);
+    }
+}
+
+void __init alternative_instructions(void)
+{
+    nmi_callback_t saved_nmi_callback;
+
+    arch_init_ideal_nops();
+
+    /*
+     * The patching is not fully atomic, so try to avoid local interruptions
+     * that might execute the to be patched code.
+     * Other CPUs are not running.
+     */
+    saved_nmi_callback = set_nmi_callback(mask_nmi_callback);
+
+    /*
+     * Don't stop machine check exceptions while patching.
+     * MCEs only happen when something got corrupted and in this
+     * case we must do something about the corruption.
+     * Ignoring it is worse than a unlikely patching race.
+     * Also machine checks tend to be broadcast and if one CPU
+     * goes into machine check the others follow quickly, so we don't
+     * expect a machine check to cause undue problems during to code
+     * patching.
+     */
+    apply_alternatives(__alt_instructions, __alt_instructions_end);
+
+    set_nmi_callback(saved_nmi_callback);
+}
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d7df750..599cf04 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -48,6 +48,7 @@
 #include <asm/setup.h>
 #include <xen/cpu.h>
 #include <asm/nmi.h>
+#include <asm/alternative.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
@@ -1292,6 +1293,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( cpu_has_fsgsbase )
         set_in_cr4(X86_CR4_FSGSBASE);
 
+    alternative_instructions();
+
     local_irq_enable();
 
     pt_pci_init();
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 17db361..d4b1f1a 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -105,6 +105,12 @@ SECTIONS
   .init.text : {
        _sinittext = .;
        *(.init.text)
+       /*
+        * Here are the replacement instructions. The linker sticks them
+        * as binary blobs. The .altinstructions has enough data to get
+        * the address and the length of them to patch the kernel safely.
+        */
+       *(.altinstr_replacement)
        _einittext = .;
   } :text
   .init.data : {
@@ -120,6 +126,15 @@ SECTIONS
        __trampoline_seg_start = .;
        *(.trampoline_seg)
        __trampoline_seg_stop = .;
+       /*
+        * struct alt_inst entries. From the header (alternative.h):
+        * "Alternative instructions for different CPU types or capabilities"
+        * Think locking instructions on spinlocks.
+        */
+       . = ALIGN(8);
+        __alt_instructions = .;
+        *(.altinstructions)
+        __alt_instructions_end = .;
 
        . = ALIGN(8);
        __ctors_start = .;
diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/alternative.h
new file mode 100644
index 0000000..c746047
--- /dev/null
+++ b/xen/include/asm-x86/alternative.h
@@ -0,0 +1,78 @@
+#ifndef __X86_ALTERNATIVE_H__
+#define __X86_ALTERNATIVE_H__
+
+#include <asm/nops.h>
+
+#ifdef __ASSEMBLY__
+.macro altinstruction_entry orig alt feature orig_len alt_len
+        .long \orig - .
+        .long \alt - .
+        .word \feature
+        .byte \orig_len
+        .byte \alt_len
+.endm
+#else
+#include <xen/types.h>
+
+struct alt_instr {
+    s32 instr_offset;       /* original instruction */
+    s32 repl_offset;        /* offset to replacement instruction */
+    u16 cpuid;              /* cpuid bit set for replacement */
+    u8  instrlen;           /* length of original instruction */
+    u8  replacementlen;     /* length of new instruction, <= instrlen */
+};
+
+extern void alternative_instructions(void);
+
+#define OLDINSTR(oldinstr)      "661:\n\t" oldinstr "\n662:\n"
+
+#define b_replacement(number)   "663"#number
+#define e_replacement(number)   "664"#number
+
+#define alt_slen "662b-661b"
+#define alt_rlen(number) e_replacement(number)"f-"b_replacement(number)"f"
+
+#define ALTINSTR_ENTRY(feature, number)                                       \
+        " .long 661b - .\n"                             /* label           */ \
+        " .long " b_replacement(number)"f - .\n"        /* new instruction */ \
+        " .word " __stringify(feature) "\n"             /* feature bit     */ \
+        " .byte " alt_slen "\n"                         /* source len      */ \
+        " .byte " alt_rlen(number) "\n"                 /* replacement len */
+
+#define DISCARD_ENTRY(number)                           /* rlen <= slen */    \
+        " .byte 0xff + (" alt_rlen(number) ") - (" alt_slen ")\n"
+
+#define ALTINSTR_REPLACEMENT(newinstr, feature, number) /* replacement */     \
+        b_replacement(number)":\n\t" newinstr "\n" e_replacement(number) ":\n\t"
+
+/* alternative assembly primitive: */
+#define ALTERNATIVE(oldinstr, newinstr, feature)                        \
+        OLDINSTR(oldinstr)                                              \
+        ".pushsection .altinstructions,\"a\"\n"                         \
+        ALTINSTR_ENTRY(feature, 1)                                      \
+        ".popsection\n"                                                 \
+        ".pushsection .discard,\"aw\",@progbits\n"                      \
+        DISCARD_ENTRY(1)                                                \
+        ".popsection\n"                                                 \
+        ".pushsection .altinstr_replacement, \"ax\"\n"                  \
+        ALTINSTR_REPLACEMENT(newinstr, feature, 1)                      \
+        ".popsection"
+
+/*
+ * Alternative instructions for different CPU types or capabilities.
+ *
+ * This allows to use optimized instructions even on generic binary
+ * kernels.
+ *
+ * length of oldinstr must be longer or equal the length of newinstr
+ * It can be padded with nops as needed.
+ *
+ * For non barrier like inlines please define new variants
+ * without volatile and memory clobber.
+ */
+#define alternative(oldinstr, newinstr, feature)                        \
+        asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) : : : "memory")
+
+#endif  /*  __ASSEMBLY__  */
+
+#endif /* __X86_ALTERNATIVE_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7D-00019F-PS; Thu, 19 Jun 2014 04:38:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7B-00018u-Lh
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:22 +0000
Received: from [193.109.254.147:3621] by server-13.bemta-14.messagelabs.com id
	A3/4F-23211-D3962A35; Thu, 19 Jun 2014 04:38:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403152698!12164481!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32471 invoked from network); 19 Jun 2014 04:38:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU78-0002Ua-Dz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU78-0007ct-9k
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:18 +0000
Date: Thu, 19 Jun 2014 04:38:18 +0000
Message-Id: <E1WxU78-0007ct-9k@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: port the basic alternative
	mechanism from Linux to Xen
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5542ac7f908c2819fcedb06ee9dc24af94d89566
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:31:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:54:23 2014 +0200

    x86: port the basic alternative mechanism from Linux to Xen
    
    This patch ports the basic alternative mechanism from Linux to Xen.
    With this mechanism, we can patch code based on the CPU features.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/Makefile             |    1 +
 xen/arch/x86/alternative.c        |  213 +++++++++++++++++++++++++++++++++++++
 xen/arch/x86/setup.c              |    3 +
 xen/arch/x86/xen.lds.S            |   15 +++
 xen/include/asm-x86/alternative.h |   78 ++++++++++++++
 5 files changed, 310 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d502bdf..6c90b1b 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -7,6 +7,7 @@ subdir-y += oprofile
 
 subdir-$(x86_64) += x86_64
 
+obj-y += alternative.o
 obj-y += apic.o
 obj-y += bitops.o
 obj-bin-y += bzimage.init.o
diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
new file mode 100644
index 0000000..4b6c948
--- /dev/null
+++ b/xen/arch/x86/alternative.c
@@ -0,0 +1,213 @@
+/******************************************************************************
+ * alternative.c
+ *
+ * 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, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#include <xen/types.h>
+#include <asm/processor.h>
+#include <asm/alternative.h>
+#include <xen/init.h>
+#include <asm/system.h>
+#include <asm/traps.h>
+#include <asm/nmi.h>
+
+#define MAX_PATCH_LEN (255-1)
+
+extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+
+#ifdef K8_NOP1
+static const unsigned char k8nops[] __initconst = {
+    K8_NOP1,
+    K8_NOP2,
+    K8_NOP3,
+    K8_NOP4,
+    K8_NOP5,
+    K8_NOP6,
+    K8_NOP7,
+    K8_NOP8
+};
+static const unsigned char * const k8_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
+    NULL,
+    k8nops,
+    k8nops + 1,
+    k8nops + 1 + 2,
+    k8nops + 1 + 2 + 3,
+    k8nops + 1 + 2 + 3 + 4,
+    k8nops + 1 + 2 + 3 + 4 + 5,
+    k8nops + 1 + 2 + 3 + 4 + 5 + 6,
+    k8nops + 1 + 2 + 3 + 4 + 5 + 6 + 7
+};
+#endif
+
+#ifdef P6_NOP1
+static const unsigned char p6nops[] __initconst = {
+    P6_NOP1,
+    P6_NOP2,
+    P6_NOP3,
+    P6_NOP4,
+    P6_NOP5,
+    P6_NOP6,
+    P6_NOP7,
+    P6_NOP8
+};
+static const unsigned char * const p6_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
+    NULL,
+    p6nops,
+    p6nops + 1,
+    p6nops + 1 + 2,
+    p6nops + 1 + 2 + 3,
+    p6nops + 1 + 2 + 3 + 4,
+    p6nops + 1 + 2 + 3 + 4 + 5,
+    p6nops + 1 + 2 + 3 + 4 + 5 + 6,
+    p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7
+};
+#endif
+
+static const unsigned char * const *ideal_nops __initdata = k8_nops;
+
+static int __init mask_nmi_callback(struct cpu_user_regs *regs, int cpu)
+{
+    return 1;
+}
+
+static void __init arch_init_ideal_nops(void)
+{
+    /*
+     * Due to a decoder implementation quirk, some
+     * specific Intel CPUs actually perform better with
+     * the "k8_nops" than with the SDM-recommended NOPs.
+     */
+    if ( (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) &&
+         !(boot_cpu_data.x86 == 6 &&
+           boot_cpu_data.x86_model >= 0x0f &&
+           boot_cpu_data.x86_model != 0x1c &&
+           boot_cpu_data.x86_model != 0x26 &&
+           boot_cpu_data.x86_model != 0x27 &&
+           boot_cpu_data.x86_model < 0x30) )
+        ideal_nops = p6_nops;
+}
+
+/* Use this to add nops to a buffer, then text_poke the whole buffer. */
+static void __init add_nops(void *insns, unsigned int len)
+{
+    while ( len > 0 )
+    {
+        unsigned int noplen = len;
+        if ( noplen > ASM_NOP_MAX )
+            noplen = ASM_NOP_MAX;
+        memcpy(insns, ideal_nops[noplen], noplen);
+        insns += noplen;
+        len -= noplen;
+    }
+}
+
+/*
+ * text_poke_early - Update instructions on a live kernel at boot time
+ * @addr: address to modify
+ * @opcode: source of the copy
+ * @len: length to copy
+ *
+ * When you use this code to patch more than one byte of an instruction
+ * you need to make sure that other CPUs cannot execute this code in parallel.
+ * Also no thread must be currently preempted in the middle of these
+ * instructions. And on the local CPU you need to be protected again NMI or MCE
+ * handlers seeing an inconsistent instruction while you patch.
+ *
+ * This routine is called with local interrupt disabled.
+ */
+static void *__init text_poke_early(void *addr, const void *opcode, size_t len)
+{
+    memcpy(addr, opcode, len);
+    sync_core();
+
+    return addr;
+}
+
+/*
+ * Replace instructions with better alternatives for this CPU type.
+ * This runs before SMP is initialized to avoid SMP problems with
+ * self modifying code. This implies that asymmetric systems where
+ * APs have less capabilities than the boot processor are not handled.
+ * Tough. Make sure you disable such features by hand.
+ */
+static void __init apply_alternatives(struct alt_instr *start, struct alt_instr *end)
+{
+    struct alt_instr *a;
+    u8 *instr, *replacement;
+    u8 insnbuf[MAX_PATCH_LEN];
+
+    ASSERT(!local_irq_is_enabled());
+
+    printk(KERN_INFO "alt table %p -> %p\n", start, end);
+
+    /*
+     * The scan order should be from start to end. A later scanned
+     * alternative code can overwrite a previous scanned alternative code.
+     * Some kernel functions (e.g. memcpy, memset, etc) use this order to
+     * patch code.
+     *
+     * So be careful if you want to change the scan order to any other
+     * order.
+     */
+    for ( a = start; a < end; a++ )
+    {
+        instr = (u8 *)&a->instr_offset + a->instr_offset;
+        replacement = (u8 *)&a->repl_offset + a->repl_offset;
+        BUG_ON(a->replacementlen > a->instrlen);
+        BUG_ON(a->instrlen > sizeof(insnbuf));
+        BUG_ON(a->cpuid >= NCAPINTS * 32);
+        if ( !boot_cpu_has(a->cpuid) )
+            continue;
+
+        memcpy(insnbuf, replacement, a->replacementlen);
+
+        /* 0xe8/0xe9 are relative branches; fix the offset. */
+        if ( (*insnbuf & 0xfe) == 0xe8 && a->replacementlen == 5 )
+            *(s32 *)(insnbuf + 1) += replacement - instr;
+
+        add_nops(insnbuf + a->replacementlen,
+                 a->instrlen - a->replacementlen);
+        text_poke_early(instr, insnbuf, a->instrlen);
+    }
+}
+
+void __init alternative_instructions(void)
+{
+    nmi_callback_t saved_nmi_callback;
+
+    arch_init_ideal_nops();
+
+    /*
+     * The patching is not fully atomic, so try to avoid local interruptions
+     * that might execute the to be patched code.
+     * Other CPUs are not running.
+     */
+    saved_nmi_callback = set_nmi_callback(mask_nmi_callback);
+
+    /*
+     * Don't stop machine check exceptions while patching.
+     * MCEs only happen when something got corrupted and in this
+     * case we must do something about the corruption.
+     * Ignoring it is worse than a unlikely patching race.
+     * Also machine checks tend to be broadcast and if one CPU
+     * goes into machine check the others follow quickly, so we don't
+     * expect a machine check to cause undue problems during to code
+     * patching.
+     */
+    apply_alternatives(__alt_instructions, __alt_instructions_end);
+
+    set_nmi_callback(saved_nmi_callback);
+}
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index d7df750..599cf04 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -48,6 +48,7 @@
 #include <asm/setup.h>
 #include <xen/cpu.h>
 #include <asm/nmi.h>
+#include <asm/alternative.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
@@ -1292,6 +1293,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     if ( cpu_has_fsgsbase )
         set_in_cr4(X86_CR4_FSGSBASE);
 
+    alternative_instructions();
+
     local_irq_enable();
 
     pt_pci_init();
diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S
index 17db361..d4b1f1a 100644
--- a/xen/arch/x86/xen.lds.S
+++ b/xen/arch/x86/xen.lds.S
@@ -105,6 +105,12 @@ SECTIONS
   .init.text : {
        _sinittext = .;
        *(.init.text)
+       /*
+        * Here are the replacement instructions. The linker sticks them
+        * as binary blobs. The .altinstructions has enough data to get
+        * the address and the length of them to patch the kernel safely.
+        */
+       *(.altinstr_replacement)
        _einittext = .;
   } :text
   .init.data : {
@@ -120,6 +126,15 @@ SECTIONS
        __trampoline_seg_start = .;
        *(.trampoline_seg)
        __trampoline_seg_stop = .;
+       /*
+        * struct alt_inst entries. From the header (alternative.h):
+        * "Alternative instructions for different CPU types or capabilities"
+        * Think locking instructions on spinlocks.
+        */
+       . = ALIGN(8);
+        __alt_instructions = .;
+        *(.altinstructions)
+        __alt_instructions_end = .;
 
        . = ALIGN(8);
        __ctors_start = .;
diff --git a/xen/include/asm-x86/alternative.h b/xen/include/asm-x86/alternative.h
new file mode 100644
index 0000000..c746047
--- /dev/null
+++ b/xen/include/asm-x86/alternative.h
@@ -0,0 +1,78 @@
+#ifndef __X86_ALTERNATIVE_H__
+#define __X86_ALTERNATIVE_H__
+
+#include <asm/nops.h>
+
+#ifdef __ASSEMBLY__
+.macro altinstruction_entry orig alt feature orig_len alt_len
+        .long \orig - .
+        .long \alt - .
+        .word \feature
+        .byte \orig_len
+        .byte \alt_len
+.endm
+#else
+#include <xen/types.h>
+
+struct alt_instr {
+    s32 instr_offset;       /* original instruction */
+    s32 repl_offset;        /* offset to replacement instruction */
+    u16 cpuid;              /* cpuid bit set for replacement */
+    u8  instrlen;           /* length of original instruction */
+    u8  replacementlen;     /* length of new instruction, <= instrlen */
+};
+
+extern void alternative_instructions(void);
+
+#define OLDINSTR(oldinstr)      "661:\n\t" oldinstr "\n662:\n"
+
+#define b_replacement(number)   "663"#number
+#define e_replacement(number)   "664"#number
+
+#define alt_slen "662b-661b"
+#define alt_rlen(number) e_replacement(number)"f-"b_replacement(number)"f"
+
+#define ALTINSTR_ENTRY(feature, number)                                       \
+        " .long 661b - .\n"                             /* label           */ \
+        " .long " b_replacement(number)"f - .\n"        /* new instruction */ \
+        " .word " __stringify(feature) "\n"             /* feature bit     */ \
+        " .byte " alt_slen "\n"                         /* source len      */ \
+        " .byte " alt_rlen(number) "\n"                 /* replacement len */
+
+#define DISCARD_ENTRY(number)                           /* rlen <= slen */    \
+        " .byte 0xff + (" alt_rlen(number) ") - (" alt_slen ")\n"
+
+#define ALTINSTR_REPLACEMENT(newinstr, feature, number) /* replacement */     \
+        b_replacement(number)":\n\t" newinstr "\n" e_replacement(number) ":\n\t"
+
+/* alternative assembly primitive: */
+#define ALTERNATIVE(oldinstr, newinstr, feature)                        \
+        OLDINSTR(oldinstr)                                              \
+        ".pushsection .altinstructions,\"a\"\n"                         \
+        ALTINSTR_ENTRY(feature, 1)                                      \
+        ".popsection\n"                                                 \
+        ".pushsection .discard,\"aw\",@progbits\n"                      \
+        DISCARD_ENTRY(1)                                                \
+        ".popsection\n"                                                 \
+        ".pushsection .altinstr_replacement, \"ax\"\n"                  \
+        ALTINSTR_REPLACEMENT(newinstr, feature, 1)                      \
+        ".popsection"
+
+/*
+ * Alternative instructions for different CPU types or capabilities.
+ *
+ * This allows to use optimized instructions even on generic binary
+ * kernels.
+ *
+ * length of oldinstr must be longer or equal the length of newinstr
+ * It can be padded with nops as needed.
+ *
+ * For non barrier like inlines please define new variants
+ * without volatile and memory clobber.
+ */
+#define alternative(oldinstr, newinstr, feature)                        \
+        asm volatile (ALTERNATIVE(oldinstr, newinstr, feature) : : : "memory")
+
+#endif  /*  __ASSEMBLY__  */
+
+#endif /* __X86_ALTERNATIVE_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7L-0001Aa-Tp; Thu, 19 Jun 2014 04:38:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7L-0001AQ-DY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:31 +0000
Received: from [85.158.137.68:39702] by server-1.bemta-3.messagelabs.com id
	EB/2C-13056-64962A35; Thu, 19 Jun 2014 04:38:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403152708!11008692!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16944 invoked from network); 19 Jun 2014 04:38:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7I-0002Ug-L4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7I-0007dG-Jf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:28 +0000
Date: Thu, 19 Jun 2014 04:38:28 +0000
Message-Id: <E1WxU7I-0007dG-Jf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: use alternative mechanism to
	define CLAC/STAC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b5b60656bf6f36e2e8e0798085cfe0697eaac926
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:56:24 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:56:24 2014 +0200

    x86: use alternative mechanism to define CLAC/STAC
    
    This patch use alternative mechanism to define CLAC/STAC.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/asm_defns.h |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 87a462f..f8ef1f8 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -10,6 +10,7 @@
 #include <asm/percpu.h>
 #include <xen/stringify.h>
 #include <asm/cpufeature.h>
+#include <asm/alternative.h>
 
 #ifndef __ASSEMBLY__
 void ret_from_intr(void);
@@ -166,26 +167,28 @@ void ret_from_intr(void);
 #define __ASM_STAC      .byte 0x0f,0x01,0xcb
 
 #ifdef __ASSEMBLY__
-#define ASM_AC(op)                                       \
-        btl $X86_FEATURE_SMAP & 31,                      \
-        CPUINFO_FEATURE_OFFSET(X86_FEATURE_SMAP)+boot_cpu_data(%rip); \
-        jnc 881f;                                        \
-        __ASM_##op;                                      \
-881:
+#define ASM_AC(op)                                                     \
+        661: ASM_NOP3;                                                 \
+        .pushsection .altinstr_replacement, "ax";                      \
+        662: __ASM_##op;                                               \
+        .popsection;                                                   \
+        .pushsection .altinstructions, "a";                            \
+        altinstruction_entry 661b, 662b, X86_FEATURE_SMAP, 3, 3;       \
+        .popsection
 
 #define ASM_STAC ASM_AC(STAC)
 #define ASM_CLAC ASM_AC(CLAC)
 #else
 static inline void clac(void)
 {
-    if ( boot_cpu_has(X86_FEATURE_SMAP) )
-        asm volatile (__stringify(__ASM_CLAC) : : : "memory");
+    /* Note: a barrier is implicit in alternative() */
+    alternative(ASM_NOP3, __stringify(__ASM_CLAC), X86_FEATURE_SMAP);
 }
 
 static inline void stac(void)
 {
-    if ( boot_cpu_has(X86_FEATURE_SMAP) )
-        asm volatile (__stringify(__ASM_STAC) : : : "memory");
+    /* Note: a barrier is implicit in alternative() */
+    alternative(ASM_NOP3, __stringify(__ASM_STAC), X86_FEATURE_SMAP);
 }
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7L-0001Aa-Tp; Thu, 19 Jun 2014 04:38:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7L-0001AQ-DY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:31 +0000
Received: from [85.158.137.68:39702] by server-1.bemta-3.messagelabs.com id
	EB/2C-13056-64962A35; Thu, 19 Jun 2014 04:38:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403152708!11008692!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16944 invoked from network); 19 Jun 2014 04:38:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7I-0002Ug-L4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7I-0007dG-Jf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:28 +0000
Date: Thu, 19 Jun 2014 04:38:28 +0000
Message-Id: <E1WxU7I-0007dG-Jf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: use alternative mechanism to
	define CLAC/STAC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b5b60656bf6f36e2e8e0798085cfe0697eaac926
Author:     Feng Wu <feng.wu@intel.com>
AuthorDate: Tue Jun 3 11:56:24 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 11:56:24 2014 +0200

    x86: use alternative mechanism to define CLAC/STAC
    
    This patch use alternative mechanism to define CLAC/STAC.
    
    Signed-off-by: Feng Wu <feng.wu@intel.com>
    Reviewed-by: Andrew Cooper <andrew.cooper@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/include/asm-x86/asm_defns.h |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/xen/include/asm-x86/asm_defns.h b/xen/include/asm-x86/asm_defns.h
index 87a462f..f8ef1f8 100644
--- a/xen/include/asm-x86/asm_defns.h
+++ b/xen/include/asm-x86/asm_defns.h
@@ -10,6 +10,7 @@
 #include <asm/percpu.h>
 #include <xen/stringify.h>
 #include <asm/cpufeature.h>
+#include <asm/alternative.h>
 
 #ifndef __ASSEMBLY__
 void ret_from_intr(void);
@@ -166,26 +167,28 @@ void ret_from_intr(void);
 #define __ASM_STAC      .byte 0x0f,0x01,0xcb
 
 #ifdef __ASSEMBLY__
-#define ASM_AC(op)                                       \
-        btl $X86_FEATURE_SMAP & 31,                      \
-        CPUINFO_FEATURE_OFFSET(X86_FEATURE_SMAP)+boot_cpu_data(%rip); \
-        jnc 881f;                                        \
-        __ASM_##op;                                      \
-881:
+#define ASM_AC(op)                                                     \
+        661: ASM_NOP3;                                                 \
+        .pushsection .altinstr_replacement, "ax";                      \
+        662: __ASM_##op;                                               \
+        .popsection;                                                   \
+        .pushsection .altinstructions, "a";                            \
+        altinstruction_entry 661b, 662b, X86_FEATURE_SMAP, 3, 3;       \
+        .popsection
 
 #define ASM_STAC ASM_AC(STAC)
 #define ASM_CLAC ASM_AC(CLAC)
 #else
 static inline void clac(void)
 {
-    if ( boot_cpu_has(X86_FEATURE_SMAP) )
-        asm volatile (__stringify(__ASM_CLAC) : : : "memory");
+    /* Note: a barrier is implicit in alternative() */
+    alternative(ASM_NOP3, __stringify(__ASM_CLAC), X86_FEATURE_SMAP);
 }
 
 static inline void stac(void)
 {
-    if ( boot_cpu_has(X86_FEATURE_SMAP) )
-        asm volatile (__stringify(__ASM_STAC) : : : "memory");
+    /* Note: a barrier is implicit in alternative() */
+    alternative(ASM_NOP3, __stringify(__ASM_STAC), X86_FEATURE_SMAP);
 }
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7X-0001CF-1C; Thu, 19 Jun 2014 04:38:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7W-0001C5-7W
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:42 +0000
Received: from [193.109.254.147:30015] by server-9.bemta-14.messagelabs.com id
	A3/DE-03644-05962A35; Thu, 19 Jun 2014 04:38:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1403152719!12232883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27936 invoked from network); 19 Jun 2014 04:38:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7S-0002Um-TR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7S-0007dd-Rc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:38 +0000
Date: Thu, 19 Jun 2014 04:38:38 +0000
Message-Id: <E1WxU7S-0007dd-Rc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: remove xfeat_mask checking
	from validate_xstate()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e2e45c562889be2ae5977bf08b065c24591b07fc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 3 12:00:53 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:00:53 2014 +0200

    x86/xsave: remove xfeat_mask checking from validate_xstate()
    
    validate_xsave() is called codepaths which load new vcpu xsave state from
    XEN_DOMCTL_{setvcpuextstate,sethvmcontext}, usually as part of migration.  In
    both cases, this is the xfeature_mask of the saving Xen rather than the
    restoring Xen.
    
    Given that the xsave state itself is checked for consistency and validity on
    the current cpu, checking whether it was valid for the cpu before migration is
    not interesting (or indeed relevant, as the error can't be distinguished from
    the other validity checking).
    
    This change removes the need to pass the saving Xen's xfeature_mask,
    simplifying the toolstack code and migration stream format in this area.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domctl.c                  |    3 +--
 xen/arch/x86/hvm/hvm.c                 |    3 +--
 xen/arch/x86/xstate.c                  |    5 ++---
 xen/include/asm-x86/xstate.h           |    3 +--
 xen/include/public/arch-x86/hvm/save.h |    2 +-
 xen/include/public/domctl.h            |    2 +-
 6 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f8b0a79..1285dd0 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1247,8 +1247,7 @@ long arch_do_domctl(
             {
                 if ( evc->size >= 2 * sizeof(uint64_t) + XSTATE_AREA_MIN_SIZE )
                     ret = validate_xstate(_xcr0, _xcr0_accum,
-                                          _xsave_area->xsave_hdr.xstate_bv,
-                                          evc->xfeature_mask);
+                                          _xsave_area->xsave_hdr.xstate_bv);
             }
             else if ( !_xcr0 )
                 ret = 0;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 59836a1..163e62a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1992,8 +1992,7 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     h->cur += desc->length;
 
     err = validate_xstate(ctxt->xcr0, ctxt->xcr0_accum,
-                          ctxt->save_area.xsave_hdr.xstate_bv,
-                          ctxt->xfeature_mask);
+                          ctxt->save_area.xsave_hdr.xstate_bv);
     if ( err )
     {
         printk(XENLOG_G_WARNING
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 7d9b92b..e202344 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -346,10 +346,9 @@ static bool_t valid_xcr0(u64 xcr0)
     return !(xcr0 & XSTATE_BNDREGS) == !(xcr0 & XSTATE_BNDCSR);
 }
 
-int validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv, u64 xfeat_mask)
+int validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv)
 {
-    if ( (xcr0_accum & ~xfeat_mask) ||
-         (xstate_bv & ~xcr0_accum) ||
+    if ( (xstate_bv & ~xcr0_accum) ||
          (xcr0 & ~xcr0_accum) ||
          !valid_xcr0(xcr0) ||
          !valid_xcr0(xcr0_accum) )
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 1a92ac3..8d21349 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -81,8 +81,7 @@ uint64_t get_xcr0(void);
 void xsave(struct vcpu *v, uint64_t mask);
 void xrstor(struct vcpu *v, uint64_t mask);
 bool_t xsave_enabled(const struct vcpu *v);
-int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv,
-                                 u64 xfeat_mask);
+int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv);
 int __must_check handle_xsetbv(u32 index, u64 new_bv);
 
 /* extended state init and cleanup functions */
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 5a13795..16d85a3 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -544,7 +544,7 @@ DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct hvm_hw_mtrr);
  */
 
 struct hvm_hw_cpu_xsave {
-    uint64_t xfeature_mask;
+    uint64_t xfeature_mask;        /* Ignored */
     uint64_t xcr0;                 /* Updated by XSETBV */
     uint64_t xcr0_accum;           /* Updated by XSETBV */
     struct {
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 565fa4c..385b053 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -839,7 +839,7 @@ struct xen_domctl_vcpuextstate {
     /* IN: VCPU that this call applies to. */
     uint32_t         vcpu;
     /*
-     * SET: xfeature support mask of struct (IN)
+     * SET: Ignored.
      * GET: xfeature support mask of struct (IN/OUT)
      * xfeature mask is served as identifications of the saving format
      * so that compatible CPUs can have a check on format to decide
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7X-0001CF-1C; Thu, 19 Jun 2014 04:38:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7W-0001C5-7W
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:42 +0000
Received: from [193.109.254.147:30015] by server-9.bemta-14.messagelabs.com id
	A3/DE-03644-05962A35; Thu, 19 Jun 2014 04:38:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1403152719!12232883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27936 invoked from network); 19 Jun 2014 04:38:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7S-0002Um-TR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7S-0007dd-Rc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:38 +0000
Date: Thu, 19 Jun 2014 04:38:38 +0000
Message-Id: <E1WxU7S-0007dd-Rc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: remove xfeat_mask checking
	from validate_xstate()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e2e45c562889be2ae5977bf08b065c24591b07fc
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 3 12:00:53 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:00:53 2014 +0200

    x86/xsave: remove xfeat_mask checking from validate_xstate()
    
    validate_xsave() is called codepaths which load new vcpu xsave state from
    XEN_DOMCTL_{setvcpuextstate,sethvmcontext}, usually as part of migration.  In
    both cases, this is the xfeature_mask of the saving Xen rather than the
    restoring Xen.
    
    Given that the xsave state itself is checked for consistency and validity on
    the current cpu, checking whether it was valid for the cpu before migration is
    not interesting (or indeed relevant, as the error can't be distinguished from
    the other validity checking).
    
    This change removes the need to pass the saving Xen's xfeature_mask,
    simplifying the toolstack code and migration stream format in this area.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domctl.c                  |    3 +--
 xen/arch/x86/hvm/hvm.c                 |    3 +--
 xen/arch/x86/xstate.c                  |    5 ++---
 xen/include/asm-x86/xstate.h           |    3 +--
 xen/include/public/arch-x86/hvm/save.h |    2 +-
 xen/include/public/domctl.h            |    2 +-
 6 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index f8b0a79..1285dd0 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1247,8 +1247,7 @@ long arch_do_domctl(
             {
                 if ( evc->size >= 2 * sizeof(uint64_t) + XSTATE_AREA_MIN_SIZE )
                     ret = validate_xstate(_xcr0, _xcr0_accum,
-                                          _xsave_area->xsave_hdr.xstate_bv,
-                                          evc->xfeature_mask);
+                                          _xsave_area->xsave_hdr.xstate_bv);
             }
             else if ( !_xcr0 )
                 ret = 0;
diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 59836a1..163e62a 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1992,8 +1992,7 @@ static int hvm_load_cpu_xsave_states(struct domain *d, hvm_domain_context_t *h)
     h->cur += desc->length;
 
     err = validate_xstate(ctxt->xcr0, ctxt->xcr0_accum,
-                          ctxt->save_area.xsave_hdr.xstate_bv,
-                          ctxt->xfeature_mask);
+                          ctxt->save_area.xsave_hdr.xstate_bv);
     if ( err )
     {
         printk(XENLOG_G_WARNING
diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index 7d9b92b..e202344 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -346,10 +346,9 @@ static bool_t valid_xcr0(u64 xcr0)
     return !(xcr0 & XSTATE_BNDREGS) == !(xcr0 & XSTATE_BNDCSR);
 }
 
-int validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv, u64 xfeat_mask)
+int validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv)
 {
-    if ( (xcr0_accum & ~xfeat_mask) ||
-         (xstate_bv & ~xcr0_accum) ||
+    if ( (xstate_bv & ~xcr0_accum) ||
          (xcr0 & ~xcr0_accum) ||
          !valid_xcr0(xcr0) ||
          !valid_xcr0(xcr0_accum) )
diff --git a/xen/include/asm-x86/xstate.h b/xen/include/asm-x86/xstate.h
index 1a92ac3..8d21349 100644
--- a/xen/include/asm-x86/xstate.h
+++ b/xen/include/asm-x86/xstate.h
@@ -81,8 +81,7 @@ uint64_t get_xcr0(void);
 void xsave(struct vcpu *v, uint64_t mask);
 void xrstor(struct vcpu *v, uint64_t mask);
 bool_t xsave_enabled(const struct vcpu *v);
-int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv,
-                                 u64 xfeat_mask);
+int __must_check validate_xstate(u64 xcr0, u64 xcr0_accum, u64 xstate_bv);
 int __must_check handle_xsetbv(u32 index, u64 new_bv);
 
 /* extended state init and cleanup functions */
diff --git a/xen/include/public/arch-x86/hvm/save.h b/xen/include/public/arch-x86/hvm/save.h
index 5a13795..16d85a3 100644
--- a/xen/include/public/arch-x86/hvm/save.h
+++ b/xen/include/public/arch-x86/hvm/save.h
@@ -544,7 +544,7 @@ DECLARE_HVM_SAVE_TYPE(MTRR, 14, struct hvm_hw_mtrr);
  */
 
 struct hvm_hw_cpu_xsave {
-    uint64_t xfeature_mask;
+    uint64_t xfeature_mask;        /* Ignored */
     uint64_t xcr0;                 /* Updated by XSETBV */
     uint64_t xcr0_accum;           /* Updated by XSETBV */
     struct {
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 565fa4c..385b053 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -839,7 +839,7 @@ struct xen_domctl_vcpuextstate {
     /* IN: VCPU that this call applies to. */
     uint32_t         vcpu;
     /*
-     * SET: xfeature support mask of struct (IN)
+     * SET: Ignored.
      * GET: xfeature support mask of struct (IN/OUT)
      * xfeature mask is served as identifications of the saving format
      * so that compatible CPUs can have a check on format to decide
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7g-0001EN-3y; Thu, 19 Jun 2014 04:38:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7f-0001E4-CO
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:51 +0000
Received: from [85.158.139.211:5875] by server-3.bemta-5.messagelabs.com id
	0B/BC-01676-A5962A35; Thu, 19 Jun 2014 04:38:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1403152729!10744632!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17524 invoked from network); 19 Jun 2014 04:38:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7d-0002Us-31
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7d-0007dz-1J
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:49 +0000
Date: Thu, 19 Jun 2014 04:38:49 +0000
Message-Id: <E1WxU7d-0007dz-1J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] support 'tera' suffixes for size
	parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c80f54169eb7d908798b38831da3bfee6cd01f72
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 3 12:01:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:01:56 2014 +0200

    support 'tera' suffixes for size parameters
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    3 ++-
 xen/common/lib.c                    |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index b45ba7e..514c7b2 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -46,8 +46,9 @@ undefined.
 
 ### Size (`<size>`)
 
-A size parameter may be any integer, with a size suffix
+A size parameter may be any integer, with a single size suffix
 
+* `T` or `t`: TiB (2^40)
 * `G` or `g`: GiB (2^30)
 * `M` or `m`: MiB (2^20)
 * `K` or `k`: KiB (2^10)
diff --git a/xen/common/lib.c b/xen/common/lib.c
index a758025..89c74ad 100644
--- a/xen/common/lib.c
+++ b/xen/common/lib.c
@@ -459,6 +459,8 @@ unsigned long long parse_size_and_unit(const char *s, const char **ps)
 
     switch ( *s1 )
     {
+    case 'T': case 't':
+        ret <<= 10;
     case 'G': case 'g':
         ret <<= 10;
     case 'M': case 'm':
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:38:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:38:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7g-0001EN-3y; Thu, 19 Jun 2014 04:38:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7f-0001E4-CO
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:51 +0000
Received: from [85.158.139.211:5875] by server-3.bemta-5.messagelabs.com id
	0B/BC-01676-A5962A35; Thu, 19 Jun 2014 04:38:50 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1403152729!10744632!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17524 invoked from network); 19 Jun 2014 04:38:50 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:38:50 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7d-0002Us-31
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:49 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7d-0007dz-1J
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:49 +0000
Date: Thu, 19 Jun 2014 04:38:49 +0000
Message-Id: <E1WxU7d-0007dz-1J@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] support 'tera' suffixes for size
	parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c80f54169eb7d908798b38831da3bfee6cd01f72
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 3 12:01:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:01:56 2014 +0200

    support 'tera' suffixes for size parameters
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |    3 ++-
 xen/common/lib.c                    |    2 ++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index b45ba7e..514c7b2 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -46,8 +46,9 @@ undefined.
 
 ### Size (`<size>`)
 
-A size parameter may be any integer, with a size suffix
+A size parameter may be any integer, with a single size suffix
 
+* `T` or `t`: TiB (2^40)
 * `G` or `g`: GiB (2^30)
 * `M` or `m`: MiB (2^20)
 * `K` or `k`: KiB (2^10)
diff --git a/xen/common/lib.c b/xen/common/lib.c
index a758025..89c74ad 100644
--- a/xen/common/lib.c
+++ b/xen/common/lib.c
@@ -459,6 +459,8 @@ unsigned long long parse_size_and_unit(const char *s, const char **ps)
 
     switch ( *s1 )
     {
+    case 'T': case 't':
+        ret <<= 10;
     case 'G': case 'g':
         ret <<= 10;
     case 'M': case 'm':
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7s-0001GQ-6r; Thu, 19 Jun 2014 04:39:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7q-0001G8-6P
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:03 +0000
Received: from [85.158.137.68:40771] by server-6.bemta-3.messagelabs.com id
	68/D6-00470-56962A35; Thu, 19 Jun 2014 04:39:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403152739!10999719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6958 invoked from network); 19 Jun 2014 04:39:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7n-0002Uy-9f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7n-0007eM-8a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:59 +0000
Date: Thu, 19 Jun 2014 04:38:59 +0000
Message-Id: <E1WxU7n-0007eM-8a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86, mce: remove amd_{k8,
	f10}_mcheck_init functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08178cd81243c4b22b19024bed62ec684a7f88ed
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 3 12:02:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:02:11 2014 +0200

    x86, mce: remove amd_{k8,f10}_mcheck_init functions
    
    With all AMD mcheck initialization unified now after
    commit 518576c, these two function definitions can be removed.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 xen/arch/x86/cpu/mcheck/mce_amd.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.h b/xen/arch/x86/cpu/mcheck/mce_amd.h
index 5d047e7..de5fc48 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h
@@ -1,9 +1,6 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
-
 int mc_amd_recoverable_scan(uint64_t status);
 int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU7s-0001GQ-6r; Thu, 19 Jun 2014 04:39:04 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7q-0001G8-6P
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:03 +0000
Received: from [85.158.137.68:40771] by server-6.bemta-3.messagelabs.com id
	68/D6-00470-56962A35; Thu, 19 Jun 2014 04:39:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403152739!10999719!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6958 invoked from network); 19 Jun 2014 04:39:00 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:00 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7n-0002Uy-9f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:59 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7n-0007eM-8a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:38:59 +0000
Date: Thu, 19 Jun 2014 04:38:59 +0000
Message-Id: <E1WxU7n-0007eM-8a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86, mce: remove amd_{k8,
	f10}_mcheck_init functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 08178cd81243c4b22b19024bed62ec684a7f88ed
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 3 12:02:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 12:02:11 2014 +0200

    x86, mce: remove amd_{k8,f10}_mcheck_init functions
    
    With all AMD mcheck initialization unified now after
    commit 518576c, these two function definitions can be removed.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 xen/arch/x86/cpu/mcheck/mce_amd.h |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.h b/xen/arch/x86/cpu/mcheck/mce_amd.h
index 5d047e7..de5fc48 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.h
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.h
@@ -1,9 +1,6 @@
 #ifndef _MCHECK_AMD_H
 #define _MCHECK_AMD_H
 
-enum mcheck_type amd_k8_mcheck_init(struct cpuinfo_x86 *c);
-enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c);
-
 int mc_amd_recoverable_scan(uint64_t status);
 int mc_amd_addrcheck(uint64_t status, uint64_t misc, int addrtype);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU81-0001Hx-9T; Thu, 19 Jun 2014 04:39:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7z-0001Hi-SE
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:11 +0000
Received: from [85.158.143.35:6986] by server-2.bemta-4.messagelabs.com id
	1B/1F-06539-F6962A35; Thu, 19 Jun 2014 04:39:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403152749!12382707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23001 invoked from network); 19 Jun 2014 04:39:10 -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;
	19 Jun 2014 04:39:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7x-0002Va-Fi
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7x-0007ew-DX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:09 +0000
Date: Thu, 19 Jun 2014 04:39:09 +0000
Message-Id: <E1WxU7x-0007ew-DX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update mail address
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc421a32559da877253f1bfa2d0776bf5b737c70
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 3 14:03:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 14:03:03 2014 +0200

    Update mail address
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 66ffcf3..1865a84 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -139,7 +139,7 @@ F:	xen/drivers/char/pl011.c
 F:	xen/drivers/passthrough/arm/
 
 CPU POOLS
-M:	Juergen Gross <juergen.gross@ts.fujitsu.com>
+M:	Juergen Gross <jgross@suse.com>
 S:	Supported
 F:	xen/common/cpupool.c
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU81-0001Hx-9T; Thu, 19 Jun 2014 04:39:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7z-0001Hi-SE
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:11 +0000
Received: from [85.158.143.35:6986] by server-2.bemta-4.messagelabs.com id
	1B/1F-06539-F6962A35; Thu, 19 Jun 2014 04:39:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403152749!12382707!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23001 invoked from network); 19 Jun 2014 04:39:10 -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;
	19 Jun 2014 04:39:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7x-0002Va-Fi
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU7x-0007ew-DX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:09 +0000
Date: Thu, 19 Jun 2014 04:39:09 +0000
Message-Id: <E1WxU7x-0007ew-DX@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Update mail address
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bc421a32559da877253f1bfa2d0776bf5b737c70
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 3 14:03:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 14:03:03 2014 +0200

    Update mail address
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 MAINTAINERS |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 66ffcf3..1865a84 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -139,7 +139,7 @@ F:	xen/drivers/char/pl011.c
 F:	xen/drivers/passthrough/arm/
 
 CPU POOLS
-M:	Juergen Gross <juergen.gross@ts.fujitsu.com>
+M:	Juergen Gross <jgross@suse.com>
 S:	Supported
 F:	xen/common/cpupool.c
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8B-0001JT-CX; Thu, 19 Jun 2014 04:39:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8A-0001JA-Br
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:22 +0000
Received: from [193.109.254.147:16195] by server-2.bemta-14.messagelabs.com id
	4E/8C-21684-97962A35; Thu, 19 Jun 2014 04:39:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403152759!12245417!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3838 invoked from network); 19 Jun 2014 04:39:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU87-0002Vg-NX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU87-0007g2-Jz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:19 +0000
Date: Thu, 19 Jun 2014 04:39:19 +0000
Message-Id: <E1WxU87-0007g2-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 15:17:14 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 15:17:14 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index cb34b21..ab7d67e 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -290,20 +290,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8B-0001JT-CX; Thu, 19 Jun 2014 04:39:23 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8A-0001JA-Br
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:22 +0000
Received: from [193.109.254.147:16195] by server-2.bemta-14.messagelabs.com id
	4E/8C-21684-97962A35; Thu, 19 Jun 2014 04:39:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403152759!12245417!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3838 invoked from network); 19 Jun 2014 04:39:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU87-0002Vg-NX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU87-0007g2-Jz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:19 +0000
Date: Thu, 19 Jun 2014 04:39:19 +0000
Message-Id: <E1WxU87-0007g2-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: eliminate vulnerabilities
	from hvm_inject_msi()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f4cc0ac41625a054861b417ea1fc3ab88e2e40a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 3 15:17:14 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 3 15:17:14 2014 +0200

    x86/HVM: eliminate vulnerabilities from hvm_inject_msi()
    
    - pirq_info() returns NULL for a non-allocated pIRQ, and hence we
      mustn't unconditionally de-reference it, and we need to invoke it
      another time after having called map_domain_emuirq_pirq()
    - don't use printk(), namely without XENLOG_GUEST, for error reporting
    
    This is XSA-96.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index cb34b21..ab7d67e 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -290,20 +290,18 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             struct pirq *info = pirq_info(d, pirq);
 
             /* if it is the first time, allocate the pirq */
-            if (info->arch.hvm.emuirq == IRQ_UNBOUND)
+            if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
                 spin_lock(&d->event_lock);
                 map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                info = pirq_info(d, pirq);
+                if ( !info )
+                    return;
             } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-            {
-                printk("%s: pirq %d does not correspond to an emulated MSI\n", __func__, pirq);
                 return;
-            }
             send_guest_pirq(d, info);
             return;
-        } else {
-            printk("%s: error getting pirq from MSI: pirq = %d\n", __func__, pirq);
         }
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:33 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8L-0001ND-GL; Thu, 19 Jun 2014 04:39:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8K-0001Mq-IG
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:32 +0000
Received: from [85.158.139.211:16658] by server-14.bemta-5.messagelabs.com id
	6E/FE-27057-38962A35; Thu, 19 Jun 2014 04:39:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403152770!10785482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5066 invoked from network); 19 Jun 2014 04:39:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8H-0002Vm-TJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8H-0007gO-RP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:29 +0000
Date: Thu, 19 Jun 2014 04:39:29 +0000
Message-Id: <E1WxU8H-0007gO-RP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: replace another fixmap use with
	ioremap()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e47f7056ba9f4a3ecf67e41ce79443100036a20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 4 11:24:33 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 11:24:33 2014 +0200

    VT-d: replace another fixmap use with ioremap()
    
    ... making the code more generic and limiting address space consumption
    (however small it might be) to just those machines that need this
    mapping (this is an erratum workaround after all).
    
    At the same time properly map the full needed range from the base
    address instead of just the third page and fix some formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/quirks.c |   36 +++++++++++++--------------------
 xen/include/asm-x86/fixmap.h         |    1 -
 2 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 33f3942..fef12fb 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -117,7 +117,7 @@ static void __init snb_errata_init(void)
  */
 static void __init map_igd_reg(void)
 {
-    u64 igd_mmio, igd_reg;
+    u64 igd_mmio;
 
     if ( !is_cantiga_b3 && !is_snb_gfx )
         return;
@@ -125,16 +125,10 @@ static void __init map_igd_reg(void)
     if ( igd_reg_va )
         return;
 
-    /* get IGD mmio address in PCI BAR */
-    igd_mmio = ((u64)pci_conf_read32(0, 0, IGD_DEV, 0, 0x14) << 32) +
-                     pci_conf_read32(0, 0, IGD_DEV, 0, 0x10);
-
-    /* offset of IGD regster we want to access is in 0x2000 range */
-    igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000;
-
-    /* ioremap this physical page */
-    set_fixmap_nocache(FIX_IGD_MMIO, igd_reg);
-    igd_reg_va = (u8 *)fix_to_virt(FIX_IGD_MMIO);
+    igd_mmio   = pci_conf_read32(0, 0, IGD_DEV, 0, PCI_BASE_ADDRESS_1);
+    igd_mmio <<= 32;
+    igd_mmio  += pci_conf_read32(0, 0, IGD_DEV, 0, PCI_BASE_ADDRESS_0);
+    igd_reg_va = ioremap(igd_mmio & IGD_BAR_MASK, 0x3000);
 }
 
 /*
@@ -152,12 +146,10 @@ static int cantiga_vtd_ops_preamble(struct iommu* iommu)
         return 0;
 
     /*
-     * read IGD register at IGD MMIO + 0x20A4 to force IGD
-     * to exit low power state.  Since map_igd_reg()
-     * already mapped page starting 0x2000, we just need to
-     * add page offset 0x0A4 to virtual address base.
+     * Read IGD register at IGD MMIO + 0x20A4 to force IGD
+     * to exit low power state.
      */
-    return ( *((volatile int *)(igd_reg_va + 0x0A4)) );
+    return *(volatile int *)(igd_reg_va + 0x20A4);
 }
 
 /*
@@ -179,11 +171,11 @@ static void snb_vtd_ops_preamble(struct iommu* iommu)
     if ( !igd_reg_va )
         return;
 
-    *((volatile u32 *)(igd_reg_va + 0x54)) = 0x000FFFFF;
-    *((volatile u32 *)(igd_reg_va + 0x700)) = 0;
+    *(volatile u32 *)(igd_reg_va + 0x2054) = 0x000FFFFF;
+    *(volatile u32 *)(igd_reg_va + 0x2700) = 0;
 
     start_time = NOW();
-    while ( (*((volatile u32 *)(igd_reg_va + 0x2AC)) & 0xF) != 0 )
+    while ( (*(volatile u32 *)(igd_reg_va + 0x22AC) & 0xF) != 0 )
     {
         if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT )
         {
@@ -194,7 +186,7 @@ static void snb_vtd_ops_preamble(struct iommu* iommu)
         cpu_relax();
     }
 
-    *((volatile u32*)(igd_reg_va + 0x50)) = 0x10001;
+    *(volatile u32 *)(igd_reg_va + 0x2050) = 0x10001;
 }
 
 static void snb_vtd_ops_postamble(struct iommu* iommu)
@@ -208,8 +200,8 @@ static void snb_vtd_ops_postamble(struct iommu* iommu)
     if ( !igd_reg_va )
         return;
 
-    *((volatile u32 *)(igd_reg_va + 0x54)) = 0xA;
-    *((volatile u32 *)(igd_reg_va + 0x50)) = 0x10000;
+    *(volatile u32 *)(igd_reg_va + 0x2054) = 0xA;
+    *(volatile u32 *)(igd_reg_va + 0x2050) = 0x10000;
 }
 
 /*
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 48c5676..ebb3207 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -62,7 +62,6 @@ enum fixed_addresses {
     FIX_TBOOT_MAP_ADDRESS,
     FIX_APEI_RANGE_BASE,
     FIX_APEI_RANGE_END = FIX_APEI_RANGE_BASE + FIX_APEI_RANGE_MAX -1,
-    FIX_IGD_MMIO,
     FIX_EFI_MPF,
     __end_of_fixed_addresses
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:33 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8L-0001ND-GL; Thu, 19 Jun 2014 04:39:33 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8K-0001Mq-IG
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:32 +0000
Received: from [85.158.139.211:16658] by server-14.bemta-5.messagelabs.com id
	6E/FE-27057-38962A35; Thu, 19 Jun 2014 04:39:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403152770!10785482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5066 invoked from network); 19 Jun 2014 04:39:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8H-0002Vm-TJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8H-0007gO-RP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:29 +0000
Date: Thu, 19 Jun 2014 04:39:29 +0000
Message-Id: <E1WxU8H-0007gO-RP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: replace another fixmap use with
	ioremap()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9e47f7056ba9f4a3ecf67e41ce79443100036a20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 4 11:24:33 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 11:24:33 2014 +0200

    VT-d: replace another fixmap use with ioremap()
    
    ... making the code more generic and limiting address space consumption
    (however small it might be) to just those machines that need this
    mapping (this is an erratum workaround after all).
    
    At the same time properly map the full needed range from the base
    address instead of just the third page and fix some formatting.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
---
 xen/drivers/passthrough/vtd/quirks.c |   36 +++++++++++++--------------------
 xen/include/asm-x86/fixmap.h         |    1 -
 2 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 33f3942..fef12fb 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -117,7 +117,7 @@ static void __init snb_errata_init(void)
  */
 static void __init map_igd_reg(void)
 {
-    u64 igd_mmio, igd_reg;
+    u64 igd_mmio;
 
     if ( !is_cantiga_b3 && !is_snb_gfx )
         return;
@@ -125,16 +125,10 @@ static void __init map_igd_reg(void)
     if ( igd_reg_va )
         return;
 
-    /* get IGD mmio address in PCI BAR */
-    igd_mmio = ((u64)pci_conf_read32(0, 0, IGD_DEV, 0, 0x14) << 32) +
-                     pci_conf_read32(0, 0, IGD_DEV, 0, 0x10);
-
-    /* offset of IGD regster we want to access is in 0x2000 range */
-    igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000;
-
-    /* ioremap this physical page */
-    set_fixmap_nocache(FIX_IGD_MMIO, igd_reg);
-    igd_reg_va = (u8 *)fix_to_virt(FIX_IGD_MMIO);
+    igd_mmio   = pci_conf_read32(0, 0, IGD_DEV, 0, PCI_BASE_ADDRESS_1);
+    igd_mmio <<= 32;
+    igd_mmio  += pci_conf_read32(0, 0, IGD_DEV, 0, PCI_BASE_ADDRESS_0);
+    igd_reg_va = ioremap(igd_mmio & IGD_BAR_MASK, 0x3000);
 }
 
 /*
@@ -152,12 +146,10 @@ static int cantiga_vtd_ops_preamble(struct iommu* iommu)
         return 0;
 
     /*
-     * read IGD register at IGD MMIO + 0x20A4 to force IGD
-     * to exit low power state.  Since map_igd_reg()
-     * already mapped page starting 0x2000, we just need to
-     * add page offset 0x0A4 to virtual address base.
+     * Read IGD register at IGD MMIO + 0x20A4 to force IGD
+     * to exit low power state.
      */
-    return ( *((volatile int *)(igd_reg_va + 0x0A4)) );
+    return *(volatile int *)(igd_reg_va + 0x20A4);
 }
 
 /*
@@ -179,11 +171,11 @@ static void snb_vtd_ops_preamble(struct iommu* iommu)
     if ( !igd_reg_va )
         return;
 
-    *((volatile u32 *)(igd_reg_va + 0x54)) = 0x000FFFFF;
-    *((volatile u32 *)(igd_reg_va + 0x700)) = 0;
+    *(volatile u32 *)(igd_reg_va + 0x2054) = 0x000FFFFF;
+    *(volatile u32 *)(igd_reg_va + 0x2700) = 0;
 
     start_time = NOW();
-    while ( (*((volatile u32 *)(igd_reg_va + 0x2AC)) & 0xF) != 0 )
+    while ( (*(volatile u32 *)(igd_reg_va + 0x22AC) & 0xF) != 0 )
     {
         if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT )
         {
@@ -194,7 +186,7 @@ static void snb_vtd_ops_preamble(struct iommu* iommu)
         cpu_relax();
     }
 
-    *((volatile u32*)(igd_reg_va + 0x50)) = 0x10001;
+    *(volatile u32 *)(igd_reg_va + 0x2050) = 0x10001;
 }
 
 static void snb_vtd_ops_postamble(struct iommu* iommu)
@@ -208,8 +200,8 @@ static void snb_vtd_ops_postamble(struct iommu* iommu)
     if ( !igd_reg_va )
         return;
 
-    *((volatile u32 *)(igd_reg_va + 0x54)) = 0xA;
-    *((volatile u32 *)(igd_reg_va + 0x50)) = 0x10000;
+    *(volatile u32 *)(igd_reg_va + 0x2054) = 0xA;
+    *(volatile u32 *)(igd_reg_va + 0x2050) = 0x10000;
 }
 
 /*
diff --git a/xen/include/asm-x86/fixmap.h b/xen/include/asm-x86/fixmap.h
index 48c5676..ebb3207 100644
--- a/xen/include/asm-x86/fixmap.h
+++ b/xen/include/asm-x86/fixmap.h
@@ -62,7 +62,6 @@ enum fixed_addresses {
     FIX_TBOOT_MAP_ADDRESS,
     FIX_APEI_RANGE_BASE,
     FIX_APEI_RANGE_END = FIX_APEI_RANGE_BASE + FIX_APEI_RANGE_MAX -1,
-    FIX_IGD_MMIO,
     FIX_EFI_MPF,
     __end_of_fixed_addresses
 };
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8V-0001PN-LE; Thu, 19 Jun 2014 04:39:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8U-0001P6-KT
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:42 +0000
Received: from [85.158.143.35:10182] by server-2.bemta-4.messagelabs.com id
	2A/5F-06539-E8962A35; Thu, 19 Jun 2014 04:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1403152780!4326716!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24504 invoked from network); 19 Jun 2014 04:39:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8S-0002Vs-62
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8S-0007gn-48
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:40 +0000
Date: Thu, 19 Jun 2014 04:39:40 +0000
Message-Id: <E1WxU8S-0007gn-48@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI: Prevent acpi_table_entries from
	falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Wed Jun 4 11:26:15 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 11:26:15 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 08e8f3b..1beca79 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -233,6 +233,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8V-0001PN-LE; Thu, 19 Jun 2014 04:39:43 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8U-0001P6-KT
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:42 +0000
Received: from [85.158.143.35:10182] by server-2.bemta-4.messagelabs.com id
	2A/5F-06539-E8962A35; Thu, 19 Jun 2014 04:39:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1403152780!4326716!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24504 invoked from network); 19 Jun 2014 04:39:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8S-0002Vs-62
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8S-0007gn-48
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:40 +0000
Date: Thu, 19 Jun 2014 04:39:40 +0000
Message-Id: <E1WxU8S-0007gn-48@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] ACPI: Prevent acpi_table_entries from
	falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Wed Jun 4 11:26:15 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 11:26:15 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 08e8f3b..1beca79 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -233,6 +233,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8g-0001R6-O2; Thu, 19 Jun 2014 04:39:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8e-0001Qg-Se
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:53 +0000
Received: from [85.158.137.68:46499] by server-13.bemta-3.messagelabs.com id
	CE/2C-18692-89962A35; Thu, 19 Jun 2014 04:39:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403152790!10883981!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10714 invoked from network); 19 Jun 2014 04:39:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8c-0002Vy-Bu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8c-0007h9-AJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:50 +0000
Date: Thu, 19 Jun 2014 04:39:50 +0000
Message-Id: <E1WxU8c-0007h9-AJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PVH: avoid call to handle_mmio
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7c4870915c2d50acbc66347a532e33b452f64f17
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Wed Jun 4 11:27:50 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 11:27:50 2014 +0200

    x86/PVH: avoid call to handle_mmio
    
    handle_mmio() is currently unsafe for pvh guests. A call to it would
    result in call to vioapic_range that will crash xen since the vioapic
    ptr in struct hvm_domain is not initialized for pvh guests.
    
    However, one path exists for such a call. If a pvh guest, dom0 or domU,
    unintentionally touches non-existing memory, an EPT violation would occur.
    This would result in unconditional call to hvm_hap_nested_page_fault. In
    that function, because get_gfn_type_access returns p2m_mmio_dm for non
    existing mfns by default, handle_mmio() will get called. This would result
    in xen crash instead of the guest crash. This patch addresses that.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/x86/hvm/hvm.c |    5 +++++
 xen/arch/x86/hvm/io.c  |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 163e62a..4f993f4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2743,6 +2743,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          (access_w && (p2mt == p2m_ram_ro)) )
     {
         put_gfn(p2m->domain, gfn);
+
+        rc = 0;
+        if ( unlikely(is_pvh_vcpu(v)) )
+            goto out;
+
         if ( !handle_mmio() )
             hvm_inject_hw_exception(TRAP_gp_fault, 0);
         rc = 1;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index a8fe0aa..b2b7b27 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -84,6 +84,8 @@ int handle_mmio(void)
     struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io;
     int rc;
 
+    ASSERT(!is_pvh_vcpu(curr));
+
     hvm_emulate_prepare(&ctxt, guest_cpu_user_regs());
 
     rc = hvm_emulate_one(&ctxt);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:39:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:39:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8g-0001R6-O2; Thu, 19 Jun 2014 04:39:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8e-0001Qg-Se
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:53 +0000
Received: from [85.158.137.68:46499] by server-13.bemta-3.messagelabs.com id
	CE/2C-18692-89962A35; Thu, 19 Jun 2014 04:39:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403152790!10883981!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10714 invoked from network); 19 Jun 2014 04:39:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:39:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8c-0002Vy-Bu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8c-0007h9-AJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:39:50 +0000
Date: Thu, 19 Jun 2014 04:39:50 +0000
Message-Id: <E1WxU8c-0007h9-AJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PVH: avoid call to handle_mmio
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7c4870915c2d50acbc66347a532e33b452f64f17
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Wed Jun 4 11:27:50 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 4 11:27:50 2014 +0200

    x86/PVH: avoid call to handle_mmio
    
    handle_mmio() is currently unsafe for pvh guests. A call to it would
    result in call to vioapic_range that will crash xen since the vioapic
    ptr in struct hvm_domain is not initialized for pvh guests.
    
    However, one path exists for such a call. If a pvh guest, dom0 or domU,
    unintentionally touches non-existing memory, an EPT violation would occur.
    This would result in unconditional call to hvm_hap_nested_page_fault. In
    that function, because get_gfn_type_access returns p2m_mmio_dm for non
    existing mfns by default, handle_mmio() will get called. This would result
    in xen crash instead of the guest crash. This patch addresses that.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
---
 xen/arch/x86/hvm/hvm.c |    5 +++++
 xen/arch/x86/hvm/io.c  |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 163e62a..4f993f4 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -2743,6 +2743,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          (access_w && (p2mt == p2m_ram_ro)) )
     {
         put_gfn(p2m->domain, gfn);
+
+        rc = 0;
+        if ( unlikely(is_pvh_vcpu(v)) )
+            goto out;
+
         if ( !handle_mmio() )
             hvm_inject_hw_exception(TRAP_gp_fault, 0);
         rc = 1;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index a8fe0aa..b2b7b27 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -84,6 +84,8 @@ int handle_mmio(void)
     struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io;
     int rc;
 
+    ASSERT(!is_pvh_vcpu(curr));
+
     hvm_emulate_prepare(&ctxt, guest_cpu_user_regs());
 
     rc = hvm_emulate_one(&ctxt);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:07 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8t-0001ST-Ql; Thu, 19 Jun 2014 04:40:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8q-0001S5-8f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:06 +0000
Received: from [85.158.137.68:46802] by server-13.bemta-3.messagelabs.com id
	DE/4C-18692-3A962A35; Thu, 19 Jun 2014 04:40:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403152800!10999784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9626 invoked from network); 19 Jun 2014 04:40:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8m-0002W4-JB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8m-0007hW-Gk
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:00 +0000
Date: Thu, 19 Jun 2014 04:40:00 +0000
Message-Id: <E1WxU8m-0007hW-Gk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: check permissions when
	copying to/from guest virtual addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fbaa84f60af1c27dcc78a6154d64227381e72e9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:36 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:36 2014 +0100

    xen: arm: check permissions when copying to/from guest virtual addresses
    
    In particular we need to make sure the guest has write permissions to buffers
    which it passes as output buffers for hypercalls, otherwise the guest can
    overwrite memory which it shouldn't be able to write (like r/o grant table
    mappings).
    
    This is XSA-98.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c      |    2 +-
 xen/arch/arm/guestcopy.c         |    6 +++---
 xen/arch/arm/kernel.c            |    2 +-
 xen/arch/arm/traps.c             |    2 +-
 xen/include/asm-arm/arm32/page.h |    7 +++++--
 xen/include/asm-arm/arm64/page.h |    7 +++++--
 xen/include/asm-arm/mm.h         |    4 ++--
 xen/include/asm-arm/page.h       |    4 ++++
 8 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index ddbb88d..0e630d5 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1007,7 +1007,7 @@ static void initrd_load(struct kernel_info *kinfo)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to translate guest address");
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index cea5f97..d1fddec 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -17,7 +17,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -62,7 +62,7 @@ unsigned long raw_clear_guest(void *to, unsigned len)
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -92,7 +92,7 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g) )
+        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index c82906f..69182ec 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -172,7 +172,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to map translate guest address");
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 03a3da6..df86ffe 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -837,7 +837,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys) )
+    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
     {
         printk("Failed to convert stack to physical address\n");
         return;
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 4abb281..9740672 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -87,11 +87,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp;
     tmp = READ_CP64(PAR);
-    WRITE_CP32(va, ATS12NSOPR);
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        WRITE_CP32(va, ATS12NSOPW);
+    else
+        WRITE_CP32(va, ATS12NSOPR);
     isb(); /* Ensure result is available. */
     par = READ_CP64(PAR);
     WRITE_CP64(tmp, PAR);
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 713baf6..bb10164 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -81,11 +81,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp = READ_SYSREG64(PAR_EL1);
 
-    asm volatile ("at s12e1r, %0;" : : "r" (va));
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        asm volatile ("at s12e1r, %0;" : : "r" (va));
+    else
+        asm volatile ("at s12e1w, %0;" : : "r" (va));
     isb();
     par = READ_SYSREG64(PAR_EL1);
     WRITE_SYSREG64(tmp, PAR_EL1);
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 3bef93f..9f98455 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -234,9 +234,9 @@ static inline void *maddr_to_virt(paddr_t ma)
 }
 #endif
 
-static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa)
+static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa, unsigned int flags)
 {
-    uint64_t par = gva_to_ma_par(va);
+    uint64_t par = gva_to_ma_par(va, flags);
     if ( par & PAR_F )
         return -EFAULT;
     *pa = (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index c38e9c9..e723e5a 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,6 +73,10 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
+/* Flags for gvirt_to_maddr */
+#define GV2M_READ  (0u<<0)
+#define GV2M_WRITE (1u<<0)
+
 #ifndef __ASSEMBLY__
 
 #include <xen/types.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:07 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU8t-0001ST-Ql; Thu, 19 Jun 2014 04:40:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8q-0001S5-8f
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:06 +0000
Received: from [85.158.137.68:46802] by server-13.bemta-3.messagelabs.com id
	DE/4C-18692-3A962A35; Thu, 19 Jun 2014 04:40:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403152800!10999784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9626 invoked from network); 19 Jun 2014 04:40:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8m-0002W4-JB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8m-0007hW-Gk
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:00 +0000
Date: Thu, 19 Jun 2014 04:40:00 +0000
Message-Id: <E1WxU8m-0007hW-Gk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: check permissions when
	copying to/from guest virtual addresses
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0fbaa84f60af1c27dcc78a6154d64227381e72e9
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:36 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:36 2014 +0100

    xen: arm: check permissions when copying to/from guest virtual addresses
    
    In particular we need to make sure the guest has write permissions to buffers
    which it passes as output buffers for hypercalls, otherwise the guest can
    overwrite memory which it shouldn't be able to write (like r/o grant table
    mappings).
    
    This is XSA-98.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c      |    2 +-
 xen/arch/arm/guestcopy.c         |    6 +++---
 xen/arch/arm/kernel.c            |    2 +-
 xen/arch/arm/traps.c             |    2 +-
 xen/include/asm-arm/arm32/page.h |    7 +++++--
 xen/include/asm-arm/arm64/page.h |    7 +++++--
 xen/include/asm-arm/mm.h         |    4 ++--
 xen/include/asm-arm/page.h       |    4 ++++
 8 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index ddbb88d..0e630d5 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1007,7 +1007,7 @@ static void initrd_load(struct kernel_info *kinfo)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to translate guest address");
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index cea5f97..d1fddec 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -17,7 +17,7 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -62,7 +62,7 @@ unsigned long raw_clear_guest(void *to, unsigned len)
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g) )
+        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
@@ -92,7 +92,7 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g) )
+        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
             return len;
 
         p = map_domain_page(g>>PAGE_SHIFT);
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index c82906f..69182ec 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -172,7 +172,7 @@ static void kernel_zimage_load(struct kernel_info *info)
         s = offs & ~PAGE_MASK;
         l = min(PAGE_SIZE - s, len);
 
-        rc = gvirt_to_maddr(load_addr + offs, &ma);
+        rc = gvirt_to_maddr(load_addr + offs, &ma, GV2M_WRITE);
         if ( rc )
         {
             panic("Unable to map translate guest address");
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 03a3da6..df86ffe 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -837,7 +837,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys) )
+    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
     {
         printk("Failed to convert stack to physical address\n");
         return;
diff --git a/xen/include/asm-arm/arm32/page.h b/xen/include/asm-arm/arm32/page.h
index 4abb281..9740672 100644
--- a/xen/include/asm-arm/arm32/page.h
+++ b/xen/include/asm-arm/arm32/page.h
@@ -87,11 +87,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp;
     tmp = READ_CP64(PAR);
-    WRITE_CP32(va, ATS12NSOPR);
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        WRITE_CP32(va, ATS12NSOPW);
+    else
+        WRITE_CP32(va, ATS12NSOPR);
     isb(); /* Ensure result is available. */
     par = READ_CP64(PAR);
     WRITE_CP64(tmp, PAR);
diff --git a/xen/include/asm-arm/arm64/page.h b/xen/include/asm-arm/arm64/page.h
index 713baf6..bb10164 100644
--- a/xen/include/asm-arm/arm64/page.h
+++ b/xen/include/asm-arm/arm64/page.h
@@ -81,11 +81,14 @@ static inline uint64_t __va_to_par(vaddr_t va)
 }
 
 /* Ask the MMU to translate a Guest VA for us */
-static inline uint64_t gva_to_ma_par(vaddr_t va)
+static inline uint64_t gva_to_ma_par(vaddr_t va, unsigned int flags)
 {
     uint64_t par, tmp = READ_SYSREG64(PAR_EL1);
 
-    asm volatile ("at s12e1r, %0;" : : "r" (va));
+    if ( (flags & GV2M_WRITE) == GV2M_WRITE )
+        asm volatile ("at s12e1r, %0;" : : "r" (va));
+    else
+        asm volatile ("at s12e1w, %0;" : : "r" (va));
     isb();
     par = READ_SYSREG64(PAR_EL1);
     WRITE_SYSREG64(tmp, PAR_EL1);
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 3bef93f..9f98455 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -234,9 +234,9 @@ static inline void *maddr_to_virt(paddr_t ma)
 }
 #endif
 
-static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa)
+static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa, unsigned int flags)
 {
-    uint64_t par = gva_to_ma_par(va);
+    uint64_t par = gva_to_ma_par(va, flags);
     if ( par & PAR_F )
         return -EFAULT;
     *pa = (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK);
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index c38e9c9..e723e5a 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,6 +73,10 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
+/* Flags for gvirt_to_maddr */
+#define GV2M_READ  (0u<<0)
+#define GV2M_WRITE (1u<<0)
+
 #ifndef __ASSEMBLY__
 
 #include <xen/types.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU90-0001Tb-TY; Thu, 19 Jun 2014 04:40:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8z-0001TO-Or
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:13 +0000
Received: from [85.158.139.211:12644] by server-14.bemta-5.messagelabs.com id
	B0/6F-27057-DA962A35; Thu, 19 Jun 2014 04:40:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403152811!7884349!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28014 invoked from network); 19 Jun 2014 04:40:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8w-0002Wa-Qd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8w-0007i8-OK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:10 +0000
Date: Thu, 19 Jun 2014 04:40:10 +0000
Message-Id: <E1WxU8w-0007i8-OK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: ensure we hold a reference
	to guest pages while we copy to/from them
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 278283cd0b81fe5e026a95c71ea769797411076b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:38 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:38 2014 +0100

    xen: arm: ensure we hold a reference to guest pages while we copy to/from them
    
    This at once:
     - prevents the page from being reassigned under our feet
     - ensures that the domain owns the page, which stops a domain from giving a
       grant mapping, MMIO region, other non-RAM as a hypercall input/output.
    
    We need to hold the p2m lock while doing the lookup until we have the
    reference.
    
    This also requires that during domain 0 building current is set to an actual
    dom0 vcpu, so take care of this at the same time as the p2m is temporarily
    loaded.
    
    Lastly when dumping the guest stack we need to make sure that the guest hasn't
    pointed its sp off into the weeds and/or misaligned it, which could lead to
    hypervisor traps. Solve this by using the new function and checking alignment
    first.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c |   12 +++++++++++-
 xen/arch/arm/guestcopy.c    |   26 +++++++++++++++++---------
 xen/arch/arm/p2m.c          |   28 ++++++++++++++++++++++++++++
 xen/arch/arm/traps.c        |   15 +++++++++++----
 xen/include/asm-arm/mm.h    |    3 +++
 xen/include/asm-arm/page.h  |    2 +-
 6 files changed, 71 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0e630d5..46a3619 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1026,6 +1026,7 @@ static void initrd_load(struct kernel_info *kinfo)
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
+    struct vcpu *saved_current;
     int rc, i, cpu;
 
     struct vcpu *v = d->vcpu[0];
@@ -1062,8 +1063,13 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    /* The following loads use the domain's p2m */
+    /*
+     * The following loads use the domain's p2m and require current to
+     * be a vcpu of the domain, temporarily switch
+     */
+    saved_current = current;
     p2m_restore_state(v);
+    set_current(v);
 
     /*
      * kernel_load will determine the placement of the kernel as well
@@ -1074,6 +1080,10 @@ int construct_dom0(struct domain *d)
     initrd_load(&kinfo);
     dtb_load(&kinfo);
 
+    /* Now that we are done restore the original p2m and current. */
+    set_current(saved_current);
+    p2m_restore_state(saved_current);
+
     discard_initial_modules();
 
     v->is_initialised = 1;
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d1fddec..0173597 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -1,6 +1,8 @@
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/domain_page.h>
+#include <xen/sched.h>
+#include <asm/current.h>
 
 #include <asm/mm.h>
 #include <asm/guest_access.h>
@@ -13,20 +15,22 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memcpy(p, from, size);
         if ( flush_dcache )
             clean_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
@@ -58,18 +62,20 @@ unsigned long raw_clear_guest(void *to, unsigned len)
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memset(p, 0x00, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         to += size;
         /*
@@ -88,19 +94,21 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
+        page = get_page_from_gva(current->domain, (vaddr_t) from, GV2M_READ);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += ((vaddr_t)from & (~PAGE_MASK));
 
         memcpy(to, p, size);
 
         unmap_domain_page(p);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 810459a..9960e17 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -717,6 +717,34 @@ unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
     return p >> PAGE_SHIFT;
 }
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+    struct page_info *page = NULL;
+    paddr_t maddr;
+
+    ASSERT(d == current->domain);
+
+    spin_lock(&p2m->lock);
+
+    if ( gvirt_to_maddr(va, &maddr, flags) )
+        goto err;
+
+    if ( !mfn_valid(maddr >> PAGE_SHIFT) )
+        goto err;
+
+    page = mfn_to_page(maddr >> PAGE_SHIFT);
+    ASSERT(page);
+
+    if ( unlikely(!get_page(page, d)) )
+        page = NULL;
+
+err:
+    spin_unlock(&p2m->lock);
+    return page;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index df86ffe..d89b75f 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -777,7 +777,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 {
     int i;
     vaddr_t sp;
-    paddr_t stack_phys;
+    struct page_info *page;
     void *mapped;
     unsigned long *stack, addr;
 
@@ -837,13 +837,20 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
+    if ( sp & ( sizeof(long) - 1 ) )
+    {
+        printk("Stack is misaligned\n");
+        return;
+    }
+
+    page = get_page_from_gva(current->domain, sp, GV2M_READ);
+    if ( page == NULL )
     {
         printk("Failed to convert stack to physical address\n");
         return;
     }
 
-    mapped = map_domain_page(stack_phys >> PAGE_SHIFT);
+    mapped = __map_domain_page(page);
 
     stack = mapped + (sp & ~PAGE_MASK);
 
@@ -861,7 +868,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
         printk("Stack empty.");
     printk("\n");
     unmap_domain_page(mapped);
-
+    put_page(page);
 }
 
 #define STACK_BEFORE_EXCEPTION(regs) ((register_t*)(regs)->sp)
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 9f98455..2552d34 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -274,6 +274,9 @@ struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags);
+
 /*
  * The MPT (machine->physical mapping table) is an array of word-sized
  * values, indexed on machine frame number. It is expected that guest OSes
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index e723e5a..113be5a 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,7 +73,7 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
-/* Flags for gvirt_to_maddr */
+/* Flags for get_page_from_gva, gvirt_to_maddr etc */
 #define GV2M_READ  (0u<<0)
 #define GV2M_WRITE (1u<<0)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU90-0001Tb-TY; Thu, 19 Jun 2014 04:40:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8z-0001TO-Or
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:13 +0000
Received: from [85.158.139.211:12644] by server-14.bemta-5.messagelabs.com id
	B0/6F-27057-DA962A35; Thu, 19 Jun 2014 04:40:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403152811!7884349!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28014 invoked from network); 19 Jun 2014 04:40:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8w-0002Wa-Qd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU8w-0007i8-OK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:10 +0000
Date: Thu, 19 Jun 2014 04:40:10 +0000
Message-Id: <E1WxU8w-0007i8-OK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: ensure we hold a reference
	to guest pages while we copy to/from them
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 278283cd0b81fe5e026a95c71ea769797411076b
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 4 14:58:38 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 4 14:58:38 2014 +0100

    xen: arm: ensure we hold a reference to guest pages while we copy to/from them
    
    This at once:
     - prevents the page from being reassigned under our feet
     - ensures that the domain owns the page, which stops a domain from giving a
       grant mapping, MMIO region, other non-RAM as a hypercall input/output.
    
    We need to hold the p2m lock while doing the lookup until we have the
    reference.
    
    This also requires that during domain 0 building current is set to an actual
    dom0 vcpu, so take care of this at the same time as the p2m is temporarily
    loaded.
    
    Lastly when dumping the guest stack we need to make sure that the guest hasn't
    pointed its sp off into the weeds and/or misaligned it, which could lead to
    hypervisor traps. Solve this by using the new function and checking alignment
    first.
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Reviewed-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/domain_build.c |   12 +++++++++++-
 xen/arch/arm/guestcopy.c    |   26 +++++++++++++++++---------
 xen/arch/arm/p2m.c          |   28 ++++++++++++++++++++++++++++
 xen/arch/arm/traps.c        |   15 +++++++++++----
 xen/include/asm-arm/mm.h    |    3 +++
 xen/include/asm-arm/page.h  |    2 +-
 6 files changed, 71 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 0e630d5..46a3619 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1026,6 +1026,7 @@ static void initrd_load(struct kernel_info *kinfo)
 int construct_dom0(struct domain *d)
 {
     struct kernel_info kinfo = {};
+    struct vcpu *saved_current;
     int rc, i, cpu;
 
     struct vcpu *v = d->vcpu[0];
@@ -1062,8 +1063,13 @@ int construct_dom0(struct domain *d)
     if ( rc < 0 )
         return rc;
 
-    /* The following loads use the domain's p2m */
+    /*
+     * The following loads use the domain's p2m and require current to
+     * be a vcpu of the domain, temporarily switch
+     */
+    saved_current = current;
     p2m_restore_state(v);
+    set_current(v);
 
     /*
      * kernel_load will determine the placement of the kernel as well
@@ -1074,6 +1080,10 @@ int construct_dom0(struct domain *d)
     initrd_load(&kinfo);
     dtb_load(&kinfo);
 
+    /* Now that we are done restore the original p2m and current. */
+    set_current(saved_current);
+    p2m_restore_state(saved_current);
+
     discard_initial_modules();
 
     v->is_initialised = 1;
diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c
index d1fddec..0173597 100644
--- a/xen/arch/arm/guestcopy.c
+++ b/xen/arch/arm/guestcopy.c
@@ -1,6 +1,8 @@
 #include <xen/config.h>
 #include <xen/lib.h>
 #include <xen/domain_page.h>
+#include <xen/sched.h>
+#include <asm/current.h>
 
 #include <asm/mm.h>
 #include <asm/guest_access.h>
@@ -13,20 +15,22 @@ static unsigned long raw_copy_to_guest_helper(void *to, const void *from,
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memcpy(p, from, size);
         if ( flush_dcache )
             clean_xen_dcache_va_range(p, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
@@ -58,18 +62,20 @@ unsigned long raw_clear_guest(void *to, unsigned len)
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)PAGE_SIZE - offset);
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) to, &g, GV2M_WRITE) )
+        page = get_page_from_gva(current->domain, (vaddr_t) to, GV2M_WRITE);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += offset;
         memset(p, 0x00, size);
 
         unmap_domain_page(p - offset);
+        put_page(page);
         len -= size;
         to += size;
         /*
@@ -88,19 +94,21 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned le
 
     while ( len )
     {
-        paddr_t g;
         void *p;
         unsigned size = min(len, (unsigned)(PAGE_SIZE - offset));
+        struct page_info *page;
 
-        if ( gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g, GV2M_READ) )
+        page = get_page_from_gva(current->domain, (vaddr_t) from, GV2M_READ);
+        if ( page == NULL )
             return len;
 
-        p = map_domain_page(g>>PAGE_SHIFT);
+        p = __map_domain_page(page);
         p += ((vaddr_t)from & (~PAGE_MASK));
 
         memcpy(to, p, size);
 
         unmap_domain_page(p);
+        put_page(page);
         len -= size;
         from += size;
         to += size;
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 810459a..9960e17 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -717,6 +717,34 @@ unsigned long gmfn_to_mfn(struct domain *d, unsigned long gpfn)
     return p >> PAGE_SHIFT;
 }
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags)
+{
+    struct p2m_domain *p2m = &d->arch.p2m;
+    struct page_info *page = NULL;
+    paddr_t maddr;
+
+    ASSERT(d == current->domain);
+
+    spin_lock(&p2m->lock);
+
+    if ( gvirt_to_maddr(va, &maddr, flags) )
+        goto err;
+
+    if ( !mfn_valid(maddr >> PAGE_SHIFT) )
+        goto err;
+
+    page = mfn_to_page(maddr >> PAGE_SHIFT);
+    ASSERT(page);
+
+    if ( unlikely(!get_page(page, d)) )
+        page = NULL;
+
+err:
+    spin_unlock(&p2m->lock);
+    return page;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index df86ffe..d89b75f 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -777,7 +777,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 {
     int i;
     vaddr_t sp;
-    paddr_t stack_phys;
+    struct page_info *page;
     void *mapped;
     unsigned long *stack, addr;
 
@@ -837,13 +837,20 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
 
     printk("Guest stack trace from sp=%"PRIvaddr":\n  ", sp);
 
-    if ( gvirt_to_maddr(sp, &stack_phys, GV2M_READ) )
+    if ( sp & ( sizeof(long) - 1 ) )
+    {
+        printk("Stack is misaligned\n");
+        return;
+    }
+
+    page = get_page_from_gva(current->domain, sp, GV2M_READ);
+    if ( page == NULL )
     {
         printk("Failed to convert stack to physical address\n");
         return;
     }
 
-    mapped = map_domain_page(stack_phys >> PAGE_SHIFT);
+    mapped = __map_domain_page(page);
 
     stack = mapped + (sp & ~PAGE_MASK);
 
@@ -861,7 +868,7 @@ static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
         printk("Stack empty.");
     printk("\n");
     unmap_domain_page(mapped);
-
+    put_page(page);
 }
 
 #define STACK_BEFORE_EXCEPTION(regs) ((register_t*)(regs)->sp)
diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index 9f98455..2552d34 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -274,6 +274,9 @@ struct domain *page_get_owner_and_reference(struct page_info *page);
 void put_page(struct page_info *page);
 int  get_page(struct page_info *page, struct domain *domain);
 
+struct page_info *get_page_from_gva(struct domain *d, vaddr_t va,
+                                    unsigned long flags);
+
 /*
  * The MPT (machine->physical mapping table) is an array of word-sized
  * values, indexed on machine frame number. It is expected that guest OSes
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index e723e5a..113be5a 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -73,7 +73,7 @@
 #define MATTR_DEV     0x1
 #define MATTR_MEM     0xf
 
-/* Flags for gvirt_to_maddr */
+/* Flags for get_page_from_gva, gvirt_to_maddr etc */
 #define GV2M_READ  (0u<<0)
 #define GV2M_WRITE (1u<<0)
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9A-0001V9-Bx; Thu, 19 Jun 2014 04:40:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU99-0001Uz-O3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:23 +0000
Received: from [193.109.254.147:19669] by server-1.bemta-14.messagelabs.com id
	3E/D5-00839-7B962A35; Thu, 19 Jun 2014 04:40:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403152821!12164740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7997 invoked from network); 19 Jun 2014 04:40:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU97-0002Wl-3u
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU96-0007j1-VV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:21 +0000
Date: Thu, 19 Jun 2014 04:40:20 +0000
Message-Id: <E1WxU96-0007j1-VV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] added xentop option -f ,
	--full-name to xentop manpage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f5ccb8fd9f35ae0ec564f26ca529e55436ddd62
Author:     Christian Wolter <wolter@b1-systems.de>
AuthorDate: Thu Jun 5 11:24:54 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:36:44 2014 +0100

    added xentop option -f , --full-name to xentop manpage
    
    Signed-off-by: Christian Wolter <wolter@b1-systems.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstat/xentop/xentop.1 |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/xenstat/xentop/xentop.1 b/tools/xenstat/xentop/xentop.1
index 0a78e4c..8f6ab01 100644
--- a/tools/xenstat/xentop/xentop.1
+++ b/tools/xenstat/xentop/xentop.1
@@ -25,6 +25,7 @@
 [\fB\-n\fR]
 [\fB\-r\fR]
 [\fB\-v\fR]
+[\fB\-f\fR]
 [\fB\-b\fR]
 [\fB\-i\fRITERATIONS]
 
@@ -56,6 +57,9 @@ repeat table header before each domain
 \fB\-v\fR, \fB\-\-vcpus\fR
 output VCPU data
 .TP
+\fB\-f\fR, \fB\-\-full\-name\fR
+output the full domain name (not truncated)
+.TP
 \fB\-b\fR, \fB\-\-batch\fR
 output data in batch mode (to stdout)
 .TP
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9A-0001V9-Bx; Thu, 19 Jun 2014 04:40:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU99-0001Uz-O3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:23 +0000
Received: from [193.109.254.147:19669] by server-1.bemta-14.messagelabs.com id
	3E/D5-00839-7B962A35; Thu, 19 Jun 2014 04:40:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403152821!12164740!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7997 invoked from network); 19 Jun 2014 04:40:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU97-0002Wl-3u
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU96-0007j1-VV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:21 +0000
Date: Thu, 19 Jun 2014 04:40:20 +0000
Message-Id: <E1WxU96-0007j1-VV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] added xentop option -f ,
	--full-name to xentop manpage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f5ccb8fd9f35ae0ec564f26ca529e55436ddd62
Author:     Christian Wolter <wolter@b1-systems.de>
AuthorDate: Thu Jun 5 11:24:54 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:36:44 2014 +0100

    added xentop option -f , --full-name to xentop manpage
    
    Signed-off-by: Christian Wolter <wolter@b1-systems.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstat/xentop/xentop.1 |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/xenstat/xentop/xentop.1 b/tools/xenstat/xentop/xentop.1
index 0a78e4c..8f6ab01 100644
--- a/tools/xenstat/xentop/xentop.1
+++ b/tools/xenstat/xentop/xentop.1
@@ -25,6 +25,7 @@
 [\fB\-n\fR]
 [\fB\-r\fR]
 [\fB\-v\fR]
+[\fB\-f\fR]
 [\fB\-b\fR]
 [\fB\-i\fRITERATIONS]
 
@@ -56,6 +57,9 @@ repeat table header before each domain
 \fB\-v\fR, \fB\-\-vcpus\fR
 output VCPU data
 .TP
+\fB\-f\fR, \fB\-\-full\-name\fR
+output the full domain name (not truncated)
+.TP
 \fB\-b\fR, \fB\-\-batch\fR
 output data in batch mode (to stdout)
 .TP
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9K-0001XF-Gd; Thu, 19 Jun 2014 04:40:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9K-0001X4-1w
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:34 +0000
Received: from [85.158.137.68:6131] by server-9.bemta-3.messagelabs.com id
	23/03-09496-1C962A35; Thu, 19 Jun 2014 04:40:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403152831!8568039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22169 invoked from network); 19 Jun 2014 04:40:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9H-0002Ws-AB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9H-0007jO-8T
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:31 +0000
Date: Thu, 19 Jun 2014 04:40:31 +0000
Message-Id: <E1WxU9H-0007jO-8T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: xentrace manpage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b473ae8854c5dbeb044f62144fcde790dab91bb
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Jun 4 09:44:27 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:53:35 2014 +0100

    docs: xentrace manpage
    
    Update the -c and -e parameters wording.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xentrace/xentrace.8 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/xentrace/xentrace.8 b/tools/xentrace/xentrace.8
index c84e2e9..ac18e9f 100644
--- a/tools/xentrace/xentrace.8
+++ b/tools/xentrace/xentrace.8
@@ -37,10 +37,10 @@ set the time, p, (in milliseconds) to sleep between polling the buffers
 for new data.
 .TP
 .B -c, --cpu-mask=c
-set cpu-mask
+set bitmask of CPUs to trace. It is limited to 32-bits.
 .TP
 .B -e, --evt-mask=e
-set evt-mask
+set event capture mask. If not specified the TRC_ALL will be used.
 .TP
 .B -?, --help
 Give this help list
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9K-0001XF-Gd; Thu, 19 Jun 2014 04:40:34 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9K-0001X4-1w
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:34 +0000
Received: from [85.158.137.68:6131] by server-9.bemta-3.messagelabs.com id
	23/03-09496-1C962A35; Thu, 19 Jun 2014 04:40:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403152831!8568039!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22169 invoked from network); 19 Jun 2014 04:40:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9H-0002Ws-AB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9H-0007jO-8T
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:31 +0000
Date: Thu, 19 Jun 2014 04:40:31 +0000
Message-Id: <E1WxU9H-0007jO-8T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: xentrace manpage
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0b473ae8854c5dbeb044f62144fcde790dab91bb
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Jun 4 09:44:27 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:53:35 2014 +0100

    docs: xentrace manpage
    
    Update the -c and -e parameters wording.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xentrace/xentrace.8 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/xentrace/xentrace.8 b/tools/xentrace/xentrace.8
index c84e2e9..ac18e9f 100644
--- a/tools/xentrace/xentrace.8
+++ b/tools/xentrace/xentrace.8
@@ -37,10 +37,10 @@ set the time, p, (in milliseconds) to sleep between polling the buffers
 for new data.
 .TP
 .B -c, --cpu-mask=c
-set cpu-mask
+set bitmask of CPUs to trace. It is limited to 32-bits.
 .TP
 .B -e, --evt-mask=e
-set evt-mask
+set event capture mask. If not specified the TRC_ALL will be used.
 .TP
 .B -?, --help
 Give this help list
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9V-0001Yu-JQ; Thu, 19 Jun 2014 04:40:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9U-0001Yb-2r
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:44 +0000
Received: from [193.109.254.147:44032] by server-15.bemta-14.messagelabs.com
	id 92/A1-15813-BC962A35; Thu, 19 Jun 2014 04:40:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403152841!12248340!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4506 invoked from network); 19 Jun 2014 04:40:42 -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;
	19 Jun 2014 04:40:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9R-0002Wy-G4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9R-0007jk-F0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:41 +0000
Date: Thu, 19 Jun 2014 04:40:41 +0000
Message-Id: <E1WxU9R-0007jk-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc/trace: Fix style
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d0eba7eaee139525bf9cd8c187923927f218de6
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Jun 4 09:44:29 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:53:59 2014 +0100

    libxc/trace: Fix style
    
    Most of the functions follow the proper style, but these
    two are the odd ones out.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_tbuf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index 4fb7bb1..8777492 100644
--- a/tools/libxc/xc_tbuf.c
+++ b/tools/libxc/xc_tbuf.c
@@ -32,7 +32,7 @@ static int tbuf_enable(xc_interface *xch, int enable)
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
-    if (enable)
+    if ( enable )
         sysctl.u.tbuf_op.cmd  = XEN_SYSCTL_TBUFOP_enable;
     else
         sysctl.u.tbuf_op.cmd  = XEN_SYSCTL_TBUFOP_disable;
@@ -121,7 +121,7 @@ int xc_tbuf_set_cpu_mask(xc_interface *xch, uint32_t mask)
     uint64_t mask64 = mask;
 
     bytemap = xc_hypercall_buffer_alloc(xch, bytemap, sizeof(mask64));
-    if (bytemap == NULL)
+    if ( bytemap == NULL )
     {
         PERROR("Could not allocate memory for xc_tbuf_set_cpu_mask hypercall");
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9V-0001Yu-JQ; Thu, 19 Jun 2014 04:40:45 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9U-0001Yb-2r
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:44 +0000
Received: from [193.109.254.147:44032] by server-15.bemta-14.messagelabs.com
	id 92/A1-15813-BC962A35; Thu, 19 Jun 2014 04:40:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403152841!12248340!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4506 invoked from network); 19 Jun 2014 04:40:42 -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;
	19 Jun 2014 04:40:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9R-0002Wy-G4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9R-0007jk-F0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:41 +0000
Date: Thu, 19 Jun 2014 04:40:41 +0000
Message-Id: <E1WxU9R-0007jk-F0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc/trace: Fix style
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d0eba7eaee139525bf9cd8c187923927f218de6
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Wed Jun 4 09:44:29 2014 -0400
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 13:53:59 2014 +0100

    libxc/trace: Fix style
    
    Most of the functions follow the proper style, but these
    two are the odd ones out.
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_tbuf.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c
index 4fb7bb1..8777492 100644
--- a/tools/libxc/xc_tbuf.c
+++ b/tools/libxc/xc_tbuf.c
@@ -32,7 +32,7 @@ static int tbuf_enable(xc_interface *xch, int enable)
 
     sysctl.cmd = XEN_SYSCTL_tbuf_op;
     sysctl.interface_version = XEN_SYSCTL_INTERFACE_VERSION;
-    if (enable)
+    if ( enable )
         sysctl.u.tbuf_op.cmd  = XEN_SYSCTL_TBUFOP_enable;
     else
         sysctl.u.tbuf_op.cmd  = XEN_SYSCTL_TBUFOP_disable;
@@ -121,7 +121,7 @@ int xc_tbuf_set_cpu_mask(xc_interface *xch, uint32_t mask)
     uint64_t mask64 = mask;
 
     bytemap = xc_hypercall_buffer_alloc(xch, bytemap, sizeof(mask64));
-    if (bytemap == NULL)
+    if ( bytemap == NULL )
     {
         PERROR("Could not allocate memory for xc_tbuf_set_cpu_mask hypercall");
         goto out;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:55 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40: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.xen.org>)
	id 1WxU9f-0001aN-M7; Thu, 19 Jun 2014 04:40:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9e-0001aB-Ji
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:54 +0000
Received: from [193.109.254.147:26477] by server-6.bemta-14.messagelabs.com id
	D5/8D-13066-5D962A35; Thu, 19 Jun 2014 04:40:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1403152851!6836989!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10340 invoked from network); 19 Jun 2014 04:40:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9b-0002X4-N9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9b-0007k6-Km
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:51 +0000
Date: Thu, 19 Jun 2014 04:40:51 +0000
Message-Id: <E1WxU9b-0007k6-Km@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Support building pdfs from
	markdown using pandoc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 869d9ca2d3c345bfe2926d655f881b645e86ff08
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 3 14:13:48 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 14:14:36 2014 +0100

    docs: Support building pdfs from markdown using pandoc
    
    The Xen command line parameters document is far more useful as an indexed pdf
    than it is as unindexed html webpage.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran autogen.sh ]
---
 config/Docs.mk.in |    1 +
 docs/Makefile     |   17 +++++++++++++++--
 docs/configure    |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 docs/configure.ac |    1 +
 4 files changed, 69 insertions(+), 2 deletions(-)

diff --git a/config/Docs.mk.in b/config/Docs.mk.in
index a2a72fd..497650f 100644
--- a/config/Docs.mk.in
+++ b/config/Docs.mk.in
@@ -11,4 +11,5 @@ POD2MAN             := @POD2MAN@
 POD2HTML            := @POD2HTML@
 POD2TEXT            := @POD2TEXT@
 MARKDOWN            := @MARKDOWN@
+PANDOC              := @PANDOC@
 PERL                := @PERL@
diff --git a/docs/Makefile b/docs/Makefile
index 5153bcb..46e8f22 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -28,12 +28,13 @@ DOC_TXT  := $(patsubst %.txt,txt/%.txt,$(TXTSRC-y)) \
             $(patsubst %.markdown,txt/%.txt,$(MARKDOWNSRC-y)) \
             $(patsubst man/%.pod.1,txt/man/%.1.txt,$(MAN1SRC-y)) \
             $(patsubst man/%.pod.5,txt/man/%.5.txt,$(MAN5SRC-y))
+DOC_PDF  := $(patsubst %.markdown,pdf/%.pdf,$(MARKDOWNSRC-y))
 
 .PHONY: all
 all: build
 
 .PHONY: build
-build: html txt man-pages figs
+build: html txt pdf man-pages figs
 
 .PHONY: html
 html: $(DOC_HTML) html/index.html
@@ -62,6 +63,14 @@ else
 	@echo "pod2man not installed; skipping man-pages."
 endif
 
+.PHONY: pdf
+pdf:
+ifdef PANDOC
+	$(MAKE) $(DOC_PDF)
+else
+	@echo "pandoc not installed; skipping pdfs."
+endif
+
 man1/%.1: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
 	$(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man1.//'| \
@@ -77,7 +86,7 @@ clean:
 	$(MAKE) -C figs clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak *.tmp core
-	rm -rf html txt
+	rm -rf html txt pdf
 	rm -rf man5
 	rm -rf man1
 
@@ -178,6 +187,10 @@ else
 	@echo "pod2text not installed; skipping $<."
 endif
 
+pdf/%.pdf: %.markdown
+	$(INSTALL_DIR) $(@D)
+	pandoc -N --toc --standalone $< --output $@
+
 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Docs.mk:
 	$(error You have to run ./configure before building docs)
diff --git a/docs/configure b/docs/configure
index d76e4d4..c36e249 100755
--- a/docs/configure
+++ b/docs/configure
@@ -589,6 +589,7 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 PERL
 MARKDOWN
+PANDOC
 POD2TEXT
 POD2HTML
 POD2MAN
@@ -642,6 +643,7 @@ FIG2DEV
 POD2MAN
 POD2HTML
 POD2TEXT
+PANDOC
 MARKDOWN
 PERL'
 
@@ -1254,6 +1256,7 @@ Some influential environment variables:
   POD2MAN     Path to pod2man tool
   POD2HTML    Path to pod2html tool
   POD2TEXT    Path to pod2text tool
+  PANDOC      Path to pandoc tool
   MARKDOWN    Path to markdown tool
   PERL        Path to Perl parser
 
@@ -1934,6 +1937,55 @@ fi
 
 
 
+    # Extract the first word of "pandoc", so it can be a program name with args.
+set dummy pandoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PANDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PANDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PANDOC=$ac_cv_path_PANDOC
+if test -n "$PANDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5
+$as_echo "$PANDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if ! test -x "$ac_cv_path_PANDOC"; then :
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pandoc is not available so some documentation won't be built" >&5
+$as_echo "$as_me: WARNING: pandoc is not available so some documentation won't be built" >&2;}
+
+fi
+
+
+
     for ac_prog in markdown markdown_py
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
diff --git a/docs/configure.ac b/docs/configure.ac
index e545b00..bc77f49 100644
--- a/docs/configure.ac
+++ b/docs/configure.ac
@@ -17,6 +17,7 @@ AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev])
 AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
 AX_DOCS_TOOL_PROG([POD2HTML], [pod2html])
 AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text])
+AX_DOCS_TOOL_PROG([PANDOC], [pandoc])
 AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py])
 
 AC_ARG_VAR([PERL], [Path to Perl parser])
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:40:55 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:40: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.xen.org>)
	id 1WxU9f-0001aN-M7; Thu, 19 Jun 2014 04:40:55 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9e-0001aB-Ji
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:54 +0000
Received: from [193.109.254.147:26477] by server-6.bemta-14.messagelabs.com id
	D5/8D-13066-5D962A35; Thu, 19 Jun 2014 04:40:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1403152851!6836989!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10340 invoked from network); 19 Jun 2014 04:40:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:40:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9b-0002X4-N9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9b-0007k6-Km
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:40:51 +0000
Date: Thu, 19 Jun 2014 04:40:51 +0000
Message-Id: <E1WxU9b-0007k6-Km@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] docs: Support building pdfs from
	markdown using pandoc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 869d9ca2d3c345bfe2926d655f881b645e86ff08
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 3 14:13:48 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 5 14:14:36 2014 +0100

    docs: Support building pdfs from markdown using pandoc
    
    The Xen command line parameters document is far more useful as an indexed pdf
    than it is as unindexed html webpage.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran autogen.sh ]
---
 config/Docs.mk.in |    1 +
 docs/Makefile     |   17 +++++++++++++++--
 docs/configure    |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 docs/configure.ac |    1 +
 4 files changed, 69 insertions(+), 2 deletions(-)

diff --git a/config/Docs.mk.in b/config/Docs.mk.in
index a2a72fd..497650f 100644
--- a/config/Docs.mk.in
+++ b/config/Docs.mk.in
@@ -11,4 +11,5 @@ POD2MAN             := @POD2MAN@
 POD2HTML            := @POD2HTML@
 POD2TEXT            := @POD2TEXT@
 MARKDOWN            := @MARKDOWN@
+PANDOC              := @PANDOC@
 PERL                := @PERL@
diff --git a/docs/Makefile b/docs/Makefile
index 5153bcb..46e8f22 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -28,12 +28,13 @@ DOC_TXT  := $(patsubst %.txt,txt/%.txt,$(TXTSRC-y)) \
             $(patsubst %.markdown,txt/%.txt,$(MARKDOWNSRC-y)) \
             $(patsubst man/%.pod.1,txt/man/%.1.txt,$(MAN1SRC-y)) \
             $(patsubst man/%.pod.5,txt/man/%.5.txt,$(MAN5SRC-y))
+DOC_PDF  := $(patsubst %.markdown,pdf/%.pdf,$(MARKDOWNSRC-y))
 
 .PHONY: all
 all: build
 
 .PHONY: build
-build: html txt man-pages figs
+build: html txt pdf man-pages figs
 
 .PHONY: html
 html: $(DOC_HTML) html/index.html
@@ -62,6 +63,14 @@ else
 	@echo "pod2man not installed; skipping man-pages."
 endif
 
+.PHONY: pdf
+pdf:
+ifdef PANDOC
+	$(MAKE) $(DOC_PDF)
+else
+	@echo "pandoc not installed; skipping pdfs."
+endif
+
 man1/%.1: man/%.pod.1 Makefile
 	$(INSTALL_DIR) $(@D)
 	$(POD2MAN) --release=$(VERSION) --name=`echo $@ | sed 's/^man1.//'| \
@@ -77,7 +86,7 @@ clean:
 	$(MAKE) -C figs clean
 	rm -rf .word_count *.aux *.dvi *.bbl *.blg *.glo *.idx *~ 
 	rm -rf *.ilg *.log *.ind *.toc *.bak *.tmp core
-	rm -rf html txt
+	rm -rf html txt pdf
 	rm -rf man5
 	rm -rf man1
 
@@ -178,6 +187,10 @@ else
 	@echo "pod2text not installed; skipping $<."
 endif
 
+pdf/%.pdf: %.markdown
+	$(INSTALL_DIR) $(@D)
+	pandoc -N --toc --standalone $< --output $@
+
 ifeq (,$(findstring clean,$(MAKECMDGOALS)))
 $(XEN_ROOT)/config/Docs.mk:
 	$(error You have to run ./configure before building docs)
diff --git a/docs/configure b/docs/configure
index d76e4d4..c36e249 100755
--- a/docs/configure
+++ b/docs/configure
@@ -589,6 +589,7 @@ ac_subst_vars='LTLIBOBJS
 LIBOBJS
 PERL
 MARKDOWN
+PANDOC
 POD2TEXT
 POD2HTML
 POD2MAN
@@ -642,6 +643,7 @@ FIG2DEV
 POD2MAN
 POD2HTML
 POD2TEXT
+PANDOC
 MARKDOWN
 PERL'
 
@@ -1254,6 +1256,7 @@ Some influential environment variables:
   POD2MAN     Path to pod2man tool
   POD2HTML    Path to pod2html tool
   POD2TEXT    Path to pod2text tool
+  PANDOC      Path to pandoc tool
   MARKDOWN    Path to markdown tool
   PERL        Path to Perl parser
 
@@ -1934,6 +1937,55 @@ fi
 
 
 
+    # Extract the first word of "pandoc", so it can be a program name with args.
+set dummy pandoc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PANDOC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PANDOC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+PANDOC=$ac_cv_path_PANDOC
+if test -n "$PANDOC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5
+$as_echo "$PANDOC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    if ! test -x "$ac_cv_path_PANDOC"; then :
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: pandoc is not available so some documentation won't be built" >&5
+$as_echo "$as_me: WARNING: pandoc is not available so some documentation won't be built" >&2;}
+
+fi
+
+
+
     for ac_prog in markdown markdown_py
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
diff --git a/docs/configure.ac b/docs/configure.ac
index e545b00..bc77f49 100644
--- a/docs/configure.ac
+++ b/docs/configure.ac
@@ -17,6 +17,7 @@ AX_DOCS_TOOL_PROG([FIG2DEV], [fig2dev])
 AX_DOCS_TOOL_PROG([POD2MAN], [pod2man])
 AX_DOCS_TOOL_PROG([POD2HTML], [pod2html])
 AX_DOCS_TOOL_PROG([POD2TEXT], [pod2text])
+AX_DOCS_TOOL_PROG([PANDOC], [pandoc])
 AX_DOCS_TOOL_PROGS([MARKDOWN], [markdown], [markdown markdown_py])
 
 AC_ARG_VAR([PERL], [Path to Perl parser])
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9q-0001bf-Ou; Thu, 19 Jun 2014 04:41:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9p-0001bT-Sf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:06 +0000
Received: from [85.158.143.35:13258] by server-2.bemta-4.messagelabs.com id
	08/00-06539-1E962A35; Thu, 19 Jun 2014 04:41:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403152862!12382908!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30071 invoked from network); 19 Jun 2014 04:41:02 -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;
	19 Jun 2014 04:41:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9l-0002Xd-Tr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9l-0007kc-Rt
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:01 +0000
Date: Thu, 19 Jun 2014 04:41:01 +0000
Message-Id: <E1WxU9l-0007kc-Rt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] make logdirty and iommu mutually
	exclusive
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5876278000587109718=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 37201c620379d3afdaafd85009312b17ab9842c3
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Jun 5 17:41:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:41:46 2014 +0200

    make logdirty and iommu mutually exclusive
    
    Prevent the usage of global logdirty if the domain is using the IOMMU,
    and also prevent passthrough of devices if logdirty is enabled.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/paging.c      |    9 +++++++++
 xen/drivers/passthrough/pci.c |    3 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 9e9a11b..32764ba 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -168,6 +168,15 @@ int paging_log_dirty_enable(struct domain *d, bool_t log_global)
 {
     int ret;
 
+    if ( need_iommu(d) && log_global )
+    {
+        /*
+         * Refuse to turn on global log-dirty mode
+         * if the domain is using the IOMMU.
+         */
+        return -EINVAL;
+    }
+
     if ( paging_mode_log_dirty(d) )
         return -EINVAL;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index b7f6e8a..43c1a81 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1233,7 +1233,8 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
      * enabled for this domain */
     if ( unlikely(!need_iommu(d) &&
             (d->arch.hvm_domain.mem_sharing_enabled ||
-             d->mem_event->paging.ring_page)) )
+             d->mem_event->paging.ring_page ||
+             p2m_get_hostp2m(d)->global_logdirty)) )
         return -EXDEV;
 
     if ( !spin_trylock(&pcidevs_lock) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9q-0001bf-Ou; Thu, 19 Jun 2014 04:41:06 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9p-0001bT-Sf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:06 +0000
Received: from [85.158.143.35:13258] by server-2.bemta-4.messagelabs.com id
	08/00-06539-1E962A35; Thu, 19 Jun 2014 04:41:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403152862!12382908!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30071 invoked from network); 19 Jun 2014 04:41:02 -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;
	19 Jun 2014 04:41:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9l-0002Xd-Tr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9l-0007kc-Rt
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:01 +0000
Date: Thu, 19 Jun 2014 04:41:01 +0000
Message-Id: <E1WxU9l-0007kc-Rt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] make logdirty and iommu mutually
	exclusive
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============5876278000587109718=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 37201c620379d3afdaafd85009312b17ab9842c3
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Jun 5 17:41:46 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:41:46 2014 +0200

    make logdirty and iommu mutually exclusive
    
    Prevent the usage of global logdirty if the domain is using the IOMMU,
    and also prevent passthrough of devices if logdirty is enabled.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/arch/x86/mm/paging.c      |    9 +++++++++
 xen/drivers/passthrough/pci.c |    3 ++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c
index 9e9a11b..32764ba 100644
--- a/xen/arch/x86/mm/paging.c
+++ b/xen/arch/x86/mm/paging.c
@@ -168,6 +168,15 @@ int paging_log_dirty_enable(struct domain *d, bool_t log_global)
 {
     int ret;
 
+    if ( need_iommu(d) && log_global )
+    {
+        /*
+         * Refuse to turn on global log-dirty mode
+         * if the domain is using the IOMMU.
+         */
+        return -EINVAL;
+    }
+
     if ( paging_mode_log_dirty(d) )
         return -EINVAL;
 
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index b7f6e8a..43c1a81 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1233,7 +1233,8 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
      * enabled for this domain */
     if ( unlikely(!need_iommu(d) &&
             (d->arch.hvm_domain.mem_sharing_enabled ||
-             d->mem_event->paging.ring_page)) )
+             d->mem_event->paging.ring_page ||
+             p2m_get_hostp2m(d)->global_logdirty)) )
         return -EXDEV;
 
     if ( !spin_trylock(&pcidevs_lock) )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9z-0001dA-Rd; Thu, 19 Jun 2014 04:41:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9y-0001cr-Mx
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:14 +0000
Received: from [193.109.254.147:27089] by server-2.bemta-14.messagelabs.com id
	02/6D-21684-AE962A35; Thu, 19 Jun 2014 04:41:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403152872!12221921!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19534 invoked from network); 19 Jun 2014 04:41:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9w-0002Xm-4C
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9w-0007ky-2Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:12 +0000
Date: Thu, 19 Jun 2014 04:41:12 +0000
Message-Id: <E1WxU9w-0007ky-2Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] iommu: set correct IOMMU entries when
	!iommu_hap_pt_share
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6526593290687862324=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 203746bc36b41443d0eec78819f153fb59bc68d1
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Jun 5 17:42:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:42:49 2014 +0200

    iommu: set correct IOMMU entries when !iommu_hap_pt_share
    
    If the memory map is not shared between HAP and IOMMU we fail to set
    correct IOMMU mappings for memory types other than p2m_ram_rw.
    
    This patchs adds IOMMU support for the following memory types:
    p2m_grant_map_rw, p2m_map_foreign, p2m_ram_ro, p2m_grant_map_ro and
    p2m_ram_logdirty.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Tested-by: David Zhuang <david.zhuang@oracle.com>
---
 xen/arch/x86/mm/p2m-ept.c |    7 ++++---
 xen/arch/x86/mm/p2m-pt.c  |   11 +++++------
 xen/include/asm-x86/p2m.h |   27 +++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 9fda28d..15c6e83 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -776,10 +776,11 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            if ( p2mt == p2m_ram_rw )
+            unsigned int flags = p2m_get_iommu_flags(p2mt);
+
+            if ( flags != 0 )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i,
-                                   IOMMUF_readable | IOMMUF_writable);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + i);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index a1794d0..085ab6f 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -491,9 +491,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
-    unsigned int iommu_pte_flags = (p2mt == p2m_ram_rw) ?
-                                   IOMMUF_readable|IOMMUF_writable:
-                                   0; 
+    unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
     unsigned long old_mfn = 0;
 
     if ( tb_init_done )
@@ -662,10 +660,11 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
         else
         {
-            if ( p2mt == p2m_ram_rw )
+            unsigned int flags = p2m_get_iommu_flags(p2mt);
+
+            if ( flags != 0 )
                 for ( i = 0; i < (1UL << page_order); i++ )
-                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i,
-                                   IOMMUF_readable|IOMMUF_writable);
+                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
             else
                 for ( int i = 0; i < (1UL << page_order); i++ )
                     iommu_unmap_page(p2m->domain, gfn+i);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index d0cfdac..0ddbadb 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -691,6 +691,33 @@ void p2m_flush_nestedp2m(struct domain *d);
 void nestedp2m_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
     l1_pgentry_t *p, l1_pgentry_t new, unsigned int level);
 
+/*
+ * p2m type to IOMMU flags
+ */
+static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
+{
+    unsigned int flags;
+
+    switch( p2mt )
+    {
+    case p2m_ram_rw:
+    case p2m_grant_map_rw:
+    case p2m_ram_logdirty:
+    case p2m_map_foreign:
+        flags =  IOMMUF_readable | IOMMUF_writable;
+        break;
+    case p2m_ram_ro:
+    case p2m_grant_map_ro:
+        flags = IOMMUF_readable;
+        break;
+    default:
+        flags = 0;
+        break;
+    }
+
+    return flags;
+}
+
 #endif /* _XEN_P2M_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxU9z-0001dA-Rd; Thu, 19 Jun 2014 04:41:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9y-0001cr-Mx
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:14 +0000
Received: from [193.109.254.147:27089] by server-2.bemta-14.messagelabs.com id
	02/6D-21684-AE962A35; Thu, 19 Jun 2014 04:41:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403152872!12221921!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19534 invoked from network); 19 Jun 2014 04:41:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9w-0002Xm-4C
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU9w-0007ky-2Q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:12 +0000
Date: Thu, 19 Jun 2014 04:41:12 +0000
Message-Id: <E1WxU9w-0007ky-2Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] iommu: set correct IOMMU entries when
	!iommu_hap_pt_share
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6526593290687862324=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 203746bc36b41443d0eec78819f153fb59bc68d1
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Jun 5 17:42:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:42:49 2014 +0200

    iommu: set correct IOMMU entries when !iommu_hap_pt_share
    
    If the memory map is not shared between HAP and IOMMU we fail to set
    correct IOMMU mappings for memory types other than p2m_ram_rw.
    
    This patchs adds IOMMU support for the following memory types:
    p2m_grant_map_rw, p2m_map_foreign, p2m_ram_ro, p2m_grant_map_ro and
    p2m_ram_logdirty.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Tested-by: David Zhuang <david.zhuang@oracle.com>
---
 xen/arch/x86/mm/p2m-ept.c |    7 ++++---
 xen/arch/x86/mm/p2m-pt.c  |   11 +++++------
 xen/include/asm-x86/p2m.h |   27 +++++++++++++++++++++++++++
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c
index 9fda28d..15c6e83 100644
--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -776,10 +776,11 @@ out:
             iommu_pte_flush(d, gfn, &ept_entry->epte, order, vtd_pte_present);
         else
         {
-            if ( p2mt == p2m_ram_rw )
+            unsigned int flags = p2m_get_iommu_flags(p2mt);
+
+            if ( flags != 0 )
                 for ( i = 0; i < (1 << order); i++ )
-                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i,
-                                   IOMMUF_readable | IOMMUF_writable);
+                    iommu_map_page(d, gfn + i, mfn_x(mfn) + i, flags);
             else
                 for ( i = 0; i < (1 << order); i++ )
                     iommu_unmap_page(d, gfn + i);
diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c
index a1794d0..085ab6f 100644
--- a/xen/arch/x86/mm/p2m-pt.c
+++ b/xen/arch/x86/mm/p2m-pt.c
@@ -491,9 +491,7 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
     l2_pgentry_t l2e_content;
     l3_pgentry_t l3e_content;
     int rc;
-    unsigned int iommu_pte_flags = (p2mt == p2m_ram_rw) ?
-                                   IOMMUF_readable|IOMMUF_writable:
-                                   0; 
+    unsigned int iommu_pte_flags = p2m_get_iommu_flags(p2mt);
     unsigned long old_mfn = 0;
 
     if ( tb_init_done )
@@ -662,10 +660,11 @@ p2m_pt_set_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn,
         }
         else
         {
-            if ( p2mt == p2m_ram_rw )
+            unsigned int flags = p2m_get_iommu_flags(p2mt);
+
+            if ( flags != 0 )
                 for ( i = 0; i < (1UL << page_order); i++ )
-                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i,
-                                   IOMMUF_readable|IOMMUF_writable);
+                    iommu_map_page(p2m->domain, gfn+i, mfn_x(mfn)+i, flags);
             else
                 for ( int i = 0; i < (1UL << page_order); i++ )
                     iommu_unmap_page(p2m->domain, gfn+i);
diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h
index d0cfdac..0ddbadb 100644
--- a/xen/include/asm-x86/p2m.h
+++ b/xen/include/asm-x86/p2m.h
@@ -691,6 +691,33 @@ void p2m_flush_nestedp2m(struct domain *d);
 void nestedp2m_write_p2m_entry(struct p2m_domain *p2m, unsigned long gfn,
     l1_pgentry_t *p, l1_pgentry_t new, unsigned int level);
 
+/*
+ * p2m type to IOMMU flags
+ */
+static inline unsigned int p2m_get_iommu_flags(p2m_type_t p2mt)
+{
+    unsigned int flags;
+
+    switch( p2mt )
+    {
+    case p2m_ram_rw:
+    case p2m_grant_map_rw:
+    case p2m_ram_logdirty:
+    case p2m_map_foreign:
+        flags =  IOMMUF_readable | IOMMUF_writable;
+        break;
+    case p2m_ram_ro:
+    case p2m_grant_map_ro:
+        flags = IOMMUF_readable;
+        break;
+    default:
+        flags = 0;
+        break;
+    }
+
+    return flags;
+}
+
 #endif /* _XEN_P2M_H */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:26 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUA9-0001eo-VH; Thu, 19 Jun 2014 04:41:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUA8-0001eU-M5
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:24 +0000
Received: from [85.158.143.35:13859] by server-3.bemta-4.messagelabs.com id
	04/DD-16194-4F962A35; Thu, 19 Jun 2014 04:41:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1403152882!12319062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4531 invoked from network); 19 Jun 2014 04:41:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUA6-0002Xs-Bb
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUA6-0007m6-AN
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:22 +0000
Date: Thu, 19 Jun 2014 04:41:22 +0000
Message-Id: <E1WxUA6-0007m6-AN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: correct
	hvm_ioreq_server_alloc_rangesets() failure path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a310f00882dfd4b07baedbab1e102cd4d0a4e867
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:43:26 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:43:26 2014 +0200

    x86/hvm: correct hvm_ioreq_server_alloc_rangesets() failure path
    
    Coverity-ID: 1220092 "Unsigned compare against 0"
    Coverity-ID: 1220093 "Out-of-bounds read"
    
    Both of these are cased by the the while() loop in the fail path, which
    results in an infinite loop and memory corruption from rangeset_destroy().
    
    Move hvm_ioreq_server_free_rangesets() up and use it for cleanup on the
    failure path.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4f993f4..1f13329 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -824,6 +824,18 @@ static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s,
     }
 }
 
+static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s,
+                                            bool_t is_default)
+{
+    unsigned int i;
+
+    if ( is_default )
+        return;
+
+    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
+        rangeset_destroy(s->range[i]);
+}
+
 static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s, 
                                             bool_t is_default)
 {
@@ -861,24 +873,11 @@ static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s,
     return 0;
 
  fail:
-    while ( --i >= 0 )
-        rangeset_destroy(s->range[i]);
+    hvm_ioreq_server_free_rangesets(s, 0);
 
     return rc;
 }
 
-static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s, 
-                                            bool_t is_default)
-{
-    unsigned int i;
-
-    if ( is_default )
-        return;
-
-    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
-        rangeset_destroy(s->range[i]);
-}
-
 static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
                                     bool_t is_default)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:26 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUA9-0001eo-VH; Thu, 19 Jun 2014 04:41:25 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUA8-0001eU-M5
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:24 +0000
Received: from [85.158.143.35:13859] by server-3.bemta-4.messagelabs.com id
	04/DD-16194-4F962A35; Thu, 19 Jun 2014 04:41:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1403152882!12319062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4531 invoked from network); 19 Jun 2014 04:41:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUA6-0002Xs-Bb
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUA6-0007m6-AN
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:22 +0000
Date: Thu, 19 Jun 2014 04:41:22 +0000
Message-Id: <E1WxUA6-0007m6-AN@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/hvm: correct
	hvm_ioreq_server_alloc_rangesets() failure path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a310f00882dfd4b07baedbab1e102cd4d0a4e867
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:43:26 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:43:26 2014 +0200

    x86/hvm: correct hvm_ioreq_server_alloc_rangesets() failure path
    
    Coverity-ID: 1220092 "Unsigned compare against 0"
    Coverity-ID: 1220093 "Out-of-bounds read"
    
    Both of these are cased by the the while() loop in the fail path, which
    results in an infinite loop and memory corruption from rangeset_destroy().
    
    Move hvm_ioreq_server_free_rangesets() up and use it for cleanup on the
    failure path.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/hvm/hvm.c |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 4f993f4..1f13329 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -824,6 +824,18 @@ static void hvm_ioreq_server_unmap_pages(struct hvm_ioreq_server *s,
     }
 }
 
+static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s,
+                                            bool_t is_default)
+{
+    unsigned int i;
+
+    if ( is_default )
+        return;
+
+    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
+        rangeset_destroy(s->range[i]);
+}
+
 static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s, 
                                             bool_t is_default)
 {
@@ -861,24 +873,11 @@ static int hvm_ioreq_server_alloc_rangesets(struct hvm_ioreq_server *s,
     return 0;
 
  fail:
-    while ( --i >= 0 )
-        rangeset_destroy(s->range[i]);
+    hvm_ioreq_server_free_rangesets(s, 0);
 
     return rc;
 }
 
-static void hvm_ioreq_server_free_rangesets(struct hvm_ioreq_server *s, 
-                                            bool_t is_default)
-{
-    unsigned int i;
-
-    if ( is_default )
-        return;
-
-    for ( i = 0; i < NR_IO_RANGE_TYPES; i++ )
-        rangeset_destroy(s->range[i]);
-}
-
 static void hvm_ioreq_server_enable(struct hvm_ioreq_server *s,
                                     bool_t is_default)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAL-0001gK-1n; Thu, 19 Jun 2014 04:41:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAJ-0001g7-Md
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:35 +0000
Received: from [85.158.139.211:27333] by server-16.bemta-5.messagelabs.com id
	9E/30-18862-EF962A35; Thu, 19 Jun 2014 04:41:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403152892!10756059!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8590 invoked from network); 19 Jun 2014 04:41:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAG-0002Xy-HX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAG-0007mU-GQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:32 +0000
Date: Thu, 19 Jun 2014 04:41:32 +0000
Message-Id: <E1WxUAG-0007mU-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly propagate errors
	from HVMOP_inject_msi
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a34dfb4ec1ac5c398b1160ad4a5ee290b717dd6d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jun 5 17:45:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:45:27 2014 +0200

    x86/HVM: properly propagate errors from HVMOP_inject_msi
    
    There are a number of ways this operation can go wrong, all of which
    got ignored so far.
    
    In the context of this I wonder whether map_domain_emuirq_pirq()
    returning 0 in the "already mapped" case is really intended to be that
    way (this is why the subsequent NULL check here can't be an ASSERT()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c    |    2 +-
 xen/arch/x86/hvm/irq.c    |   20 ++++++++++++++------
 xen/include/xen/hvm/irq.h |    2 +-
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 1f13329..230ee9f 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5100,7 +5100,7 @@ static int hvmop_inject_msi(
     if ( rc )
         goto out;
 
-    hvm_inject_msi(d, op.addr, op.data);
+    rc = hvm_inject_msi(d, op.addr, op.data);
 
  out:
     rcu_unlock_domain(d);
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index ab7d67e..cbbc9bd 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -270,7 +270,7 @@ void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq)
             d->domain_id, link, old_isa_irq, isa_irq);
 }
 
-void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
+int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
 {
     uint32_t tmp = (uint32_t) addr;
     uint8_t  dest = (tmp & MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SHIFT;
@@ -292,20 +292,28 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             /* if it is the first time, allocate the pirq */
             if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
+                int rc;
+
                 spin_lock(&d->event_lock);
-                map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
+                rc = map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                if ( rc )
+                    return rc;
                 info = pirq_info(d, pirq);
                 if ( !info )
-                    return;
-            } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-                return;
+                    return -EBUSY;
+            }
+            else if ( info->arch.hvm.emuirq != IRQ_MSI_EMU )
+                return -EINVAL;
             send_guest_pirq(d, info);
-            return;
+            return 0;
         }
+        return -ERANGE;
     }
 
     vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
+
+    return 0;
 }
 
 void hvm_set_callback_via(struct domain *d, uint64_t via)
diff --git a/xen/include/xen/hvm/irq.h b/xen/include/xen/hvm/irq.h
index 973368c..a8710df 100644
--- a/xen/include/xen/hvm/irq.h
+++ b/xen/include/xen/hvm/irq.h
@@ -123,7 +123,7 @@ void hvm_isa_irq_deassert(
 
 void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq);
 
-void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data);
+int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data);
 
 void hvm_maybe_deassert_evtchn_irq(void);
 void hvm_assert_evtchn_irq(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAL-0001gK-1n; Thu, 19 Jun 2014 04:41:37 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAJ-0001g7-Md
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:35 +0000
Received: from [85.158.139.211:27333] by server-16.bemta-5.messagelabs.com id
	9E/30-18862-EF962A35; Thu, 19 Jun 2014 04:41:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403152892!10756059!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8590 invoked from network); 19 Jun 2014 04:41:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAG-0002Xy-HX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAG-0007mU-GQ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:32 +0000
Date: Thu, 19 Jun 2014 04:41:32 +0000
Message-Id: <E1WxUAG-0007mU-GQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: properly propagate errors
	from HVMOP_inject_msi
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a34dfb4ec1ac5c398b1160ad4a5ee290b717dd6d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jun 5 17:45:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:45:27 2014 +0200

    x86/HVM: properly propagate errors from HVMOP_inject_msi
    
    There are a number of ways this operation can go wrong, all of which
    got ignored so far.
    
    In the context of this I wonder whether map_domain_emuirq_pirq()
    returning 0 in the "already mapped" case is really intended to be that
    way (this is why the subsequent NULL check here can't be an ASSERT()).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/hvm.c    |    2 +-
 xen/arch/x86/hvm/irq.c    |   20 ++++++++++++++------
 xen/include/xen/hvm/irq.h |    2 +-
 3 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 1f13329..230ee9f 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -5100,7 +5100,7 @@ static int hvmop_inject_msi(
     if ( rc )
         goto out;
 
-    hvm_inject_msi(d, op.addr, op.data);
+    rc = hvm_inject_msi(d, op.addr, op.data);
 
  out:
     rcu_unlock_domain(d);
diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index ab7d67e..cbbc9bd 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -270,7 +270,7 @@ void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq)
             d->domain_id, link, old_isa_irq, isa_irq);
 }
 
-void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
+int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
 {
     uint32_t tmp = (uint32_t) addr;
     uint8_t  dest = (tmp & MSI_ADDR_DEST_ID_MASK) >> MSI_ADDR_DEST_ID_SHIFT;
@@ -292,20 +292,28 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
             /* if it is the first time, allocate the pirq */
             if ( !info || info->arch.hvm.emuirq == IRQ_UNBOUND )
             {
+                int rc;
+
                 spin_lock(&d->event_lock);
-                map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
+                rc = map_domain_emuirq_pirq(d, pirq, IRQ_MSI_EMU);
                 spin_unlock(&d->event_lock);
+                if ( rc )
+                    return rc;
                 info = pirq_info(d, pirq);
                 if ( !info )
-                    return;
-            } else if (info->arch.hvm.emuirq != IRQ_MSI_EMU)
-                return;
+                    return -EBUSY;
+            }
+            else if ( info->arch.hvm.emuirq != IRQ_MSI_EMU )
+                return -EINVAL;
             send_guest_pirq(d, info);
-            return;
+            return 0;
         }
+        return -ERANGE;
     }
 
     vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
+
+    return 0;
 }
 
 void hvm_set_callback_via(struct domain *d, uint64_t via)
diff --git a/xen/include/xen/hvm/irq.h b/xen/include/xen/hvm/irq.h
index 973368c..a8710df 100644
--- a/xen/include/xen/hvm/irq.h
+++ b/xen/include/xen/hvm/irq.h
@@ -123,7 +123,7 @@ void hvm_isa_irq_deassert(
 
 void hvm_set_pci_link_route(struct domain *d, u8 link, u8 isa_irq);
 
-void hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data);
+int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data);
 
 void hvm_maybe_deassert_evtchn_irq(void);
 void hvm_assert_evtchn_irq(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAV-0001i7-6V; Thu, 19 Jun 2014 04:41:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAT-0001hn-EX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:45 +0000
Received: from [85.158.137.68:12479] by server-6.bemta-3.messagelabs.com id
	43/B8-00470-80A62A35; Thu, 19 Jun 2014 04:41:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403152902!8568148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26550 invoked from network); 19 Jun 2014 04:41:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAQ-0002Y4-MY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAQ-0007mq-LS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:42 +0000
Date: Thu, 19 Jun 2014 04:41:42 +0000
Message-Id: <E1WxUAQ-0007mq-LS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: make vmsi_deliver() return
	proper error values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a296e5383b9291db566df105a8efbdc68c517f39
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jun 5 17:46:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:46:13 2014 +0200

    x86/HVM: make vmsi_deliver() return proper error values
    
    ... and propagate this from hvm_inject_msi(). In the course of this I
    spotted further room for cleanup:
    - vmsi_inj_irq()'s struct domain * parameter was unused
    - vmsi_deliver() pointlessly passed on dest_ExtINT to vmsi_inj_irq()
      (which that one validly refused to handle)
    - vmsi_inj_irq()'s sole caller guarantees a proper delivery mode (i.e.
      rather than printing an obscure message we can just BUG())
    - some formatting and log message quirks
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/irq.c  |    4 +---
 xen/arch/x86/hvm/vmsi.c |   43 +++++++++++++++++--------------------------
 2 files changed, 18 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index cbbc9bd..3b29678 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -311,9 +311,7 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
         return -ERANGE;
     }
 
-    vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
-
-    return 0;
+    return vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
 }
 
 void hvm_set_callback_via(struct domain *d, uint64_t via)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 10e5f34..f48b123 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -43,14 +43,12 @@
 #include <asm/io_apic.h>
 
 static void vmsi_inj_irq(
-    struct domain *d,
     struct vlapic *target,
     uint8_t vector,
     uint8_t trig_mode,
     uint8_t delivery_mode)
 {
-    HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "vmsi_inj_irq "
-                "irq %d trig %d delive mode %d\n",
+    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "vmsi_inj_irq: vec %02x trig %d dm %d\n",
                 vector, trig_mode, delivery_mode);
 
     switch ( delivery_mode )
@@ -60,8 +58,7 @@ static void vmsi_inj_irq(
         vlapic_set_irq(target, vector, trig_mode);
         break;
     default:
-        gdprintk(XENLOG_WARNING, "error delivery mode %d\n", delivery_mode);
-        break;
+        BUG();
     }
 }
 
@@ -76,38 +73,32 @@ int vmsi_deliver(
     switch ( delivery_mode )
     {
     case dest_LowestPrio:
-    {
         target = vlapic_lowest_prio(d, NULL, 0, dest, dest_mode);
         if ( target != NULL )
-            vmsi_inj_irq(d, target, vector, trig_mode, delivery_mode);
-        else
-            HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "null round robin: "
-                        "vector=%x delivery_mode=%x\n",
-                        vector, dest_LowestPrio);
-        break;
-    }
+        {
+            vmsi_inj_irq(target, vector, trig_mode, delivery_mode);
+            break;
+        }
+        HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "null MSI round robin: vector=%02x\n",
+                    vector);
+        return -ESRCH;
 
     case dest_Fixed:
-    case dest_ExtINT:
-    {
         for_each_vcpu ( d, v )
             if ( vlapic_match_dest(vcpu_vlapic(v), NULL,
                                    0, dest, dest_mode) )
-                vmsi_inj_irq(d, vcpu_vlapic(v),
-                             vector, trig_mode, delivery_mode);
+                vmsi_inj_irq(vcpu_vlapic(v), vector,
+                             trig_mode, delivery_mode);
         break;
-    }
 
-    case dest_SMI:
-    case dest_NMI:
-    case dest_INIT:
-    case dest__reserved_2:
     default:
-        gdprintk(XENLOG_WARNING, "Unsupported delivery mode %d\n",
-                 delivery_mode);
-        break;
+        printk(XENLOG_G_WARNING
+               "%pv: Unsupported MSI delivery mode %d for Dom%d\n",
+               current, delivery_mode, d->domain_id);
+        return -EINVAL;
     }
-    return 1;
+
+    return 0;
 }
 
 void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAV-0001i7-6V; Thu, 19 Jun 2014 04:41:47 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAT-0001hn-EX
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:45 +0000
Received: from [85.158.137.68:12479] by server-6.bemta-3.messagelabs.com id
	43/B8-00470-80A62A35; Thu, 19 Jun 2014 04:41:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403152902!8568148!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26550 invoked from network); 19 Jun 2014 04:41:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAQ-0002Y4-MY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAQ-0007mq-LS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:42 +0000
Date: Thu, 19 Jun 2014 04:41:42 +0000
Message-Id: <E1WxUAQ-0007mq-LS@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: make vmsi_deliver() return
	proper error values
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a296e5383b9291db566df105a8efbdc68c517f39
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jun 5 17:46:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:46:13 2014 +0200

    x86/HVM: make vmsi_deliver() return proper error values
    
    ... and propagate this from hvm_inject_msi(). In the course of this I
    spotted further room for cleanup:
    - vmsi_inj_irq()'s struct domain * parameter was unused
    - vmsi_deliver() pointlessly passed on dest_ExtINT to vmsi_inj_irq()
      (which that one validly refused to handle)
    - vmsi_inj_irq()'s sole caller guarantees a proper delivery mode (i.e.
      rather than printing an obscure message we can just BUG())
    - some formatting and log message quirks
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/irq.c  |    4 +---
 xen/arch/x86/hvm/vmsi.c |   43 +++++++++++++++++--------------------------
 2 files changed, 18 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index cbbc9bd..3b29678 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -311,9 +311,7 @@ int hvm_inject_msi(struct domain *d, uint64_t addr, uint32_t data)
         return -ERANGE;
     }
 
-    vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
-
-    return 0;
+    return vmsi_deliver(d, vector, dest, dest_mode, delivery_mode, trig_mode);
 }
 
 void hvm_set_callback_via(struct domain *d, uint64_t via)
diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index 10e5f34..f48b123 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -43,14 +43,12 @@
 #include <asm/io_apic.h>
 
 static void vmsi_inj_irq(
-    struct domain *d,
     struct vlapic *target,
     uint8_t vector,
     uint8_t trig_mode,
     uint8_t delivery_mode)
 {
-    HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "vmsi_inj_irq "
-                "irq %d trig %d delive mode %d\n",
+    HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "vmsi_inj_irq: vec %02x trig %d dm %d\n",
                 vector, trig_mode, delivery_mode);
 
     switch ( delivery_mode )
@@ -60,8 +58,7 @@ static void vmsi_inj_irq(
         vlapic_set_irq(target, vector, trig_mode);
         break;
     default:
-        gdprintk(XENLOG_WARNING, "error delivery mode %d\n", delivery_mode);
-        break;
+        BUG();
     }
 }
 
@@ -76,38 +73,32 @@ int vmsi_deliver(
     switch ( delivery_mode )
     {
     case dest_LowestPrio:
-    {
         target = vlapic_lowest_prio(d, NULL, 0, dest, dest_mode);
         if ( target != NULL )
-            vmsi_inj_irq(d, target, vector, trig_mode, delivery_mode);
-        else
-            HVM_DBG_LOG(DBG_LEVEL_IOAPIC, "null round robin: "
-                        "vector=%x delivery_mode=%x\n",
-                        vector, dest_LowestPrio);
-        break;
-    }
+        {
+            vmsi_inj_irq(target, vector, trig_mode, delivery_mode);
+            break;
+        }
+        HVM_DBG_LOG(DBG_LEVEL_VLAPIC, "null MSI round robin: vector=%02x\n",
+                    vector);
+        return -ESRCH;
 
     case dest_Fixed:
-    case dest_ExtINT:
-    {
         for_each_vcpu ( d, v )
             if ( vlapic_match_dest(vcpu_vlapic(v), NULL,
                                    0, dest, dest_mode) )
-                vmsi_inj_irq(d, vcpu_vlapic(v),
-                             vector, trig_mode, delivery_mode);
+                vmsi_inj_irq(vcpu_vlapic(v), vector,
+                             trig_mode, delivery_mode);
         break;
-    }
 
-    case dest_SMI:
-    case dest_NMI:
-    case dest_INIT:
-    case dest__reserved_2:
     default:
-        gdprintk(XENLOG_WARNING, "Unsupported delivery mode %d\n",
-                 delivery_mode);
-        break;
+        printk(XENLOG_G_WARNING
+               "%pv: Unsupported MSI delivery mode %d for Dom%d\n",
+               current, delivery_mode, d->domain_id);
+        return -EINVAL;
     }
-    return 1;
+
+    return 0;
 }
 
 void vmsi_deliver_pirq(struct domain *d, const struct hvm_pirq_dpci *pirq_dpci)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:57 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAf-0001jZ-98; Thu, 19 Jun 2014 04:41:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAd-0001jK-Uc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:56 +0000
Received: from [85.158.139.211:15903] by server-8.bemta-5.messagelabs.com id
	3A/D6-01846-31A62A35; Thu, 19 Jun 2014 04:41:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403152913!10785709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9898 invoked from network); 19 Jun 2014 04:41:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAa-0002YB-Sr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAa-0007nO-R2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:52 +0000
Date: Thu, 19 Jun 2014 04:41:52 +0000
Message-Id: <E1WxUAa-0007nO-R2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: honor APEI firmware-first mode
	in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jun 5 17:49:14 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:49:14 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    1 +
 xen/include/xen/pci.h                |    2 +
 9 files changed, 338 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 63ae05a..903830b 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -754,6 +754,8 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
 
 	return 0;
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..6ad7c64 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-y += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 43c1a81..1eba833 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1069,6 +1069,106 @@ void __hwdom_init setup_hwdom_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index fef12fb..c23c89e 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -378,9 +378,11 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     int dev = PCI_SLOT(pdev->devfn);
     int func = PCI_FUNC(pdev->devfn);
     int pos;
-    u32 val;
+    bool_t ff;
+    u32 val, val2;
     u64 bar;
     paddr_t pa;
+    const char *action;
 
     if ( pci_conf_read16(seg, bus, dev, func, PCI_VENDOR_ID) !=
          PCI_VENDOR_ID_INTEL )
@@ -430,7 +432,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -439,18 +444,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 
     case 0x100: case 0x104: case 0x108: /* Sandybridge */
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index d228595..eab16e2 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 ssize_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index aedec65..3aeba4a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,7 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 39c9273..91520bc 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -144,6 +144,8 @@ int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 const char *parse_pci(const char *, unsigned int *seg, unsigned int *bus,
                       unsigned int *dev, unsigned int *func);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:41:57 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:41:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAf-0001jZ-98; Thu, 19 Jun 2014 04:41:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAd-0001jK-Uc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:56 +0000
Received: from [85.158.139.211:15903] by server-8.bemta-5.messagelabs.com id
	3A/D6-01846-31A62A35; Thu, 19 Jun 2014 04:41:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403152913!10785709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9898 invoked from network); 19 Jun 2014 04:41:54 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:41:54 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAa-0002YB-Sr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAa-0007nO-R2
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:41:52 +0000
Date: Thu, 19 Jun 2014 04:41:52 +0000
Message-Id: <E1WxUAa-0007nO-R2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: honor APEI firmware-first mode
	in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Thu Jun 5 17:49:14 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:49:14 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    1 +
 xen/include/xen/pci.h                |    2 +
 9 files changed, 338 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 63ae05a..903830b 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -754,6 +754,8 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
 
 	return 0;
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..6ad7c64 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-y += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 43c1a81..1eba833 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1069,6 +1069,106 @@ void __hwdom_init setup_hwdom_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index fef12fb..c23c89e 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -378,9 +378,11 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     int dev = PCI_SLOT(pdev->devfn);
     int func = PCI_FUNC(pdev->devfn);
     int pos;
-    u32 val;
+    bool_t ff;
+    u32 val, val2;
     u64 bar;
     paddr_t pa;
+    const char *action;
 
     if ( pci_conf_read16(seg, bus, dev, func, PCI_VENDOR_ID) !=
          PCI_VENDOR_ID_INTEL )
@@ -430,7 +432,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -439,18 +444,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 
     case 0x100: case 0x104: case 0x108: /* Sandybridge */
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index d228595..eab16e2 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 ssize_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index aedec65..3aeba4a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,7 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 39c9273..91520bc 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -144,6 +144,8 @@ int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 const char *parse_pci(const char *, unsigned int *seg, unsigned int *bus,
                       unsigned int *dev, unsigned int *func);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAr-0001kg-CC; Thu, 19 Jun 2014 04:42:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAo-0001kQ-T1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:08 +0000
Received: from [85.158.139.211:33447] by server-4.bemta-5.messagelabs.com id
	F9/B2-07250-E1A62A35; Thu, 19 Jun 2014 04:42:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403152924!7412422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10202 invoked from network); 19 Jun 2014 04:42:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAl-0002Ym-2q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAl-0007nx-0d
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:03 +0000
Date: Thu, 19 Jun 2014 04:42:03 +0000
Message-Id: <E1WxUAl-0007nx-0d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: add fastpath for common
	xstate_ctxt_size() requests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae3e6f8e2d98f4cc6b64dacfd6081cf831d75fa2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:52:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:52:11 2014 +0200

    x86/xsave: add fastpath for common xstate_ctxt_size() requests
    
    xstate_ctxt_size(xfeature_mask) is runtime constant after boot, and for bounds
    checking when handling xsave state.  Avoid reloading xcr0 twice to obtain a
    number which has already been calculated.
    
    Also annotate xfeature_mask as __read_mostly as it is only ever written once.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/xstate.c |   53 +++++++++++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index e202344..5f3b161 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -24,7 +24,7 @@ bool_t __read_mostly cpu_has_xsaveopt;
 static u32 __read_mostly xsave_cntxt_size;
 
 /* A 64-bit bitmask of the XSAVE/XRSTOR features supported by processor. */
-u64 xfeature_mask;
+u64 __read_mostly xfeature_mask;
 
 /* Cached xcr0 for fast read */
 static DEFINE_PER_CPU(uint64_t, xcr0);
@@ -250,6 +250,33 @@ void xstate_free_save_area(struct vcpu *v)
     v->arch.xsave_area = NULL;
 }
 
+static unsigned int _xstate_ctxt_size(u64 xcr0)
+{
+    u64 act_xcr0 = get_xcr0();
+    u32 eax, ebx = 0, ecx, edx;
+    bool_t ok = set_xcr0(xcr0);
+
+    ASSERT(ok);
+    cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
+    ASSERT(ebx <= ecx);
+    ok = set_xcr0(act_xcr0);
+    ASSERT(ok);
+
+    return ebx;
+}
+
+/* Fastpath for common xstate size requests, avoiding reloads of xcr0. */
+unsigned int xstate_ctxt_size(u64 xcr0)
+{
+    if ( xcr0 == xfeature_mask )
+        return xsave_cntxt_size;
+
+    if ( xcr0 == 0 )
+        return 0;
+
+    return _xstate_ctxt_size(xcr0);
+}
+
 /* Collect the information of processor's extended state */
 void xstate_init(bool_t bsp)
 {
@@ -283,14 +310,14 @@ void xstate_init(bool_t bsp)
          * xsave_cntxt_size is the max size required by enabled features.
          * We know FP/SSE and YMM about eax, and nothing about edx at present.
          */
-        xsave_cntxt_size = xstate_ctxt_size(feature_mask);
+        xsave_cntxt_size = _xstate_ctxt_size(feature_mask);
         printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n",
             __func__, xsave_cntxt_size, xfeature_mask);
     }
     else
     {
         BUG_ON(xfeature_mask != feature_mask);
-        BUG_ON(xsave_cntxt_size != xstate_ctxt_size(feature_mask));
+        BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
     /* Check XSAVEOPT feature. */
@@ -301,26 +328,6 @@ void xstate_init(bool_t bsp)
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
 }
 
-unsigned int xstate_ctxt_size(u64 xcr0)
-{
-    u32 ebx = 0;
-
-    if ( xcr0 )
-    {
-        u64 act_xcr0 = get_xcr0();
-        u32 eax, ecx, edx;
-        bool_t ok = set_xcr0(xcr0);
-
-        ASSERT(ok);
-        cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
-        ASSERT(ebx <= ecx);
-        ok = set_xcr0(act_xcr0);
-        ASSERT(ok);
-    }
-
-    return ebx;
-}
-
 static bool_t valid_xcr0(u64 xcr0)
 {
     /* FP must be unconditionally set. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUAr-0001kg-CC; Thu, 19 Jun 2014 04:42:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAo-0001kQ-T1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:08 +0000
Received: from [85.158.139.211:33447] by server-4.bemta-5.messagelabs.com id
	F9/B2-07250-E1A62A35; Thu, 19 Jun 2014 04:42:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403152924!7412422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10202 invoked from network); 19 Jun 2014 04:42:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAl-0002Ym-2q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAl-0007nx-0d
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:03 +0000
Date: Thu, 19 Jun 2014 04:42:03 +0000
Message-Id: <E1WxUAl-0007nx-0d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/xsave: add fastpath for common
	xstate_ctxt_size() requests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ae3e6f8e2d98f4cc6b64dacfd6081cf831d75fa2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:52:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:52:11 2014 +0200

    x86/xsave: add fastpath for common xstate_ctxt_size() requests
    
    xstate_ctxt_size(xfeature_mask) is runtime constant after boot, and for bounds
    checking when handling xsave state.  Avoid reloading xcr0 twice to obtain a
    number which has already been calculated.
    
    Also annotate xfeature_mask as __read_mostly as it is only ever written once.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/xstate.c |   53 +++++++++++++++++++++++++++---------------------
 1 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/xen/arch/x86/xstate.c b/xen/arch/x86/xstate.c
index e202344..5f3b161 100644
--- a/xen/arch/x86/xstate.c
+++ b/xen/arch/x86/xstate.c
@@ -24,7 +24,7 @@ bool_t __read_mostly cpu_has_xsaveopt;
 static u32 __read_mostly xsave_cntxt_size;
 
 /* A 64-bit bitmask of the XSAVE/XRSTOR features supported by processor. */
-u64 xfeature_mask;
+u64 __read_mostly xfeature_mask;
 
 /* Cached xcr0 for fast read */
 static DEFINE_PER_CPU(uint64_t, xcr0);
@@ -250,6 +250,33 @@ void xstate_free_save_area(struct vcpu *v)
     v->arch.xsave_area = NULL;
 }
 
+static unsigned int _xstate_ctxt_size(u64 xcr0)
+{
+    u64 act_xcr0 = get_xcr0();
+    u32 eax, ebx = 0, ecx, edx;
+    bool_t ok = set_xcr0(xcr0);
+
+    ASSERT(ok);
+    cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
+    ASSERT(ebx <= ecx);
+    ok = set_xcr0(act_xcr0);
+    ASSERT(ok);
+
+    return ebx;
+}
+
+/* Fastpath for common xstate size requests, avoiding reloads of xcr0. */
+unsigned int xstate_ctxt_size(u64 xcr0)
+{
+    if ( xcr0 == xfeature_mask )
+        return xsave_cntxt_size;
+
+    if ( xcr0 == 0 )
+        return 0;
+
+    return _xstate_ctxt_size(xcr0);
+}
+
 /* Collect the information of processor's extended state */
 void xstate_init(bool_t bsp)
 {
@@ -283,14 +310,14 @@ void xstate_init(bool_t bsp)
          * xsave_cntxt_size is the max size required by enabled features.
          * We know FP/SSE and YMM about eax, and nothing about edx at present.
          */
-        xsave_cntxt_size = xstate_ctxt_size(feature_mask);
+        xsave_cntxt_size = _xstate_ctxt_size(feature_mask);
         printk("%s: using cntxt_size: %#x and states: %#"PRIx64"\n",
             __func__, xsave_cntxt_size, xfeature_mask);
     }
     else
     {
         BUG_ON(xfeature_mask != feature_mask);
-        BUG_ON(xsave_cntxt_size != xstate_ctxt_size(feature_mask));
+        BUG_ON(xsave_cntxt_size != _xstate_ctxt_size(feature_mask));
     }
 
     /* Check XSAVEOPT feature. */
@@ -301,26 +328,6 @@ void xstate_init(bool_t bsp)
         BUG_ON(!cpu_has_xsaveopt != !(eax & XSTATE_FEATURE_XSAVEOPT));
 }
 
-unsigned int xstate_ctxt_size(u64 xcr0)
-{
-    u32 ebx = 0;
-
-    if ( xcr0 )
-    {
-        u64 act_xcr0 = get_xcr0();
-        u32 eax, ecx, edx;
-        bool_t ok = set_xcr0(xcr0);
-
-        ASSERT(ok);
-        cpuid_count(XSTATE_CPUID, 0, &eax, &ebx, &ecx, &edx);
-        ASSERT(ebx <= ecx);
-        ok = set_xcr0(act_xcr0);
-        ASSERT(ok);
-    }
-
-    return ebx;
-}
-
 static bool_t valid_xcr0(u64 xcr0)
 {
     /* FP must be unconditionally set. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUB0-0001mX-Gl; Thu, 19 Jun 2014 04:42:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAz-0001mG-Ae
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:17 +0000
Received: from [85.158.139.211:34601] by server-12.bemta-5.messagelabs.com id
	42/66-27841-82A62A35; Thu, 19 Jun 2014 04:42:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403152934!10756117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10636 invoked from network); 19 Jun 2014 04:42:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAw-0002Ys-Nf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAw-0007oL-Lr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:14 +0000
Date: Thu, 19 Jun 2014 04:42:14 +0000
Message-Id: <E1WxUAw-0007oL-Lr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: two functional fixes to
	XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 090ca8c155b7321404ea7713a28aaedb7ac4fffd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:52:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:52:57 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c |   53 ++++++++++++++++++++++++++----------------------
 1 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1285dd0..87af350 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1173,45 +1173,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1259,12 +1262,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUB0-0001mX-Gl; Thu, 19 Jun 2014 04:42:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAz-0001mG-Ae
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:17 +0000
Received: from [85.158.139.211:34601] by server-12.bemta-5.messagelabs.com id
	42/66-27841-82A62A35; Thu, 19 Jun 2014 04:42:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403152934!10756117!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10636 invoked from network); 19 Jun 2014 04:42:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAw-0002Ys-Nf
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUAw-0007oL-Lr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:14 +0000
Date: Thu, 19 Jun 2014 04:42:14 +0000
Message-Id: <E1WxUAw-0007oL-Lr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: two functional fixes to
	XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 090ca8c155b7321404ea7713a28aaedb7ac4fffd
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:52:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:52:57 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c |   53 ++++++++++++++++++++++++++----------------------
 1 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 1285dd0..87af350 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1173,45 +1173,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1259,12 +1262,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBB-0001oK-Jt; Thu, 19 Jun 2014 04:42:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUB9-0001o0-If
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:27 +0000
Received: from [193.109.254.147:53331] by server-13.bemta-14.messagelabs.com
	id E3/E0-23211-23A62A35; Thu, 19 Jun 2014 04:42:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403152945!12222057!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23360 invoked from network); 19 Jun 2014 04:42:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUB6-0002Yy-Sp
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUB6-0007pL-Rd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:24 +0000
Date: Thu, 19 Jun 2014 04:42:24 +0000
Message-Id: <E1WxUB6-0007pL-Rd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix reboot/shutdown with running
	HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2479794489099601840=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 39ede234d1fd683430ffb1784d6d35b096f16457
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Jun 5 17:53:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:53:35 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 870e4ee..76616ac 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -966,6 +966,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu = smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) == 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7564895..8ffc562 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -74,7 +74,7 @@ u64 vmx_ept_vpid_cap __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d45fb7f..2caa04a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -671,6 +671,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 445b39f..215d93c 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -490,6 +490,8 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBB-0001oK-Jt; Thu, 19 Jun 2014 04:42:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUB9-0001o0-If
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:27 +0000
Received: from [193.109.254.147:53331] by server-13.bemta-14.messagelabs.com
	id E3/E0-23211-23A62A35; Thu, 19 Jun 2014 04:42:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403152945!12222057!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23360 invoked from network); 19 Jun 2014 04:42:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUB6-0002Yy-Sp
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUB6-0007pL-Rd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:24 +0000
Date: Thu, 19 Jun 2014 04:42:24 +0000
Message-Id: <E1WxUB6-0007pL-Rd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: fix reboot/shutdown with running
	HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2479794489099601840=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 39ede234d1fd683430ffb1784d6d35b096f16457
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Thu Jun 5 17:53:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:53:35 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 870e4ee..76616ac 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -966,6 +966,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu = smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) == 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7564895..8ffc562 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -74,7 +74,7 @@ u64 vmx_ept_vpid_cap __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index d45fb7f..2caa04a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -671,6 +671,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 445b39f..215d93c 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -490,6 +490,8 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBL-0001pY-NP; Thu, 19 Jun 2014 04:42:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBJ-0001pN-KR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:37 +0000
Received: from [85.158.139.211:21012] by server-16.bemta-5.messagelabs.com id
	9B/C0-18862-C3A62A35; Thu, 19 Jun 2014 04:42:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403152955!10785805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13009 invoked from network); 19 Jun 2014 04:42:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBH-0002Z4-1y
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBH-0007pi-0e
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:35 +0000
Date: Thu, 19 Jun 2014 04:42:35 +0000
Message-Id: <E1WxUBH-0007pi-0e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/amd: protect set_cpuidmask()
	against #GP faults
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 07884c98671a734f20f2ac8302032657d262f3c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:57:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:57:07 2014 +0200

    x86/amd: protect set_cpuidmask() against #GP faults
    
    Virtual environments such as Xen HVM containers and VirtualBox do not
    necessarily provide support for feature masking MSRs.
    
    As their presence is detected by model numbers alone, and their use predicated
    on command line parameters, use the safe() variants of {wr,rd}msr() to avoid
    dying with an early #GP fault.
    
    In fact, use the password variants in all cases because:
        a) they are safe to use even if not strictly required
        b) have a more useful function prototype for this purposes
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/cpu/amd.c |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ea158cb..ba6b63e 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -151,6 +151,7 @@ static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
 	static unsigned int extfeat_ecx, extfeat_edx;
 	static unsigned int l7s0_eax, l7s0_ebx;
 	static unsigned int thermal_ecx;
+	static bool_t skip_feat, skip_extfeat;
 	static bool_t skip_l7s0_eax_ebx, skip_thermal_ecx;
 	static enum { not_parsed, no_mask, set_mask } status;
 	unsigned int eax, ebx, ecx, edx;
@@ -233,18 +234,29 @@ static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
 
  setmask:
 	/* AMD processors prior to family 10h required a 32-bit password */
-	if (c->x86 >= 0x10) {
-		wrmsr(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
-		wrmsr(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
-		if (!skip_l7s0_eax_ebx)
-			wrmsr(MSR_AMD_L7S0_FEATURE_MASK, l7s0_ebx, l7s0_eax);
-		if (!skip_thermal_ecx) {
-			rdmsr(MSR_AMD_THRM_FEATURE_MASK, eax, edx);
-			wrmsr(MSR_AMD_THRM_FEATURE_MASK, thermal_ecx, edx);
-		}
-	} else {
-		wrmsr_amd(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
-		wrmsr_amd(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
+	if (!skip_feat &&
+	    wrmsr_amd_safe(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx)) {
+		skip_feat = 1;
+		printk("Failed to set CPUID feature mask\n");
+	}
+
+	if (!skip_extfeat &&
+	    wrmsr_amd_safe(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx)) {
+		skip_extfeat = 1;
+		printk("Failed to set CPUID extended feature mask\n");
+	}
+
+	if (!skip_l7s0_eax_ebx &&
+	    wrmsr_amd_safe(MSR_AMD_L7S0_FEATURE_MASK, l7s0_ebx, l7s0_eax)) {
+		skip_l7s0_eax_ebx = 1;
+		printk("Failed to set CPUID leaf 7 subleaf 0 feature mask\n");
+	}
+
+	if (!skip_thermal_ecx &&
+	    (rdmsr_amd_safe(MSR_AMD_THRM_FEATURE_MASK, &eax, &edx) ||
+	     wrmsr_amd_safe(MSR_AMD_THRM_FEATURE_MASK, thermal_ecx, edx))){
+		skip_thermal_ecx = 1;
+		printk("Failed to set CPUID thermal/power feature mask\n");
 	}
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBL-0001pY-NP; Thu, 19 Jun 2014 04:42:39 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBJ-0001pN-KR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:37 +0000
Received: from [85.158.139.211:21012] by server-16.bemta-5.messagelabs.com id
	9B/C0-18862-C3A62A35; Thu, 19 Jun 2014 04:42:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403152955!10785805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13009 invoked from network); 19 Jun 2014 04:42:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBH-0002Z4-1y
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBH-0007pi-0e
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:35 +0000
Date: Thu, 19 Jun 2014 04:42:35 +0000
Message-Id: <E1WxUBH-0007pi-0e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/amd: protect set_cpuidmask()
	against #GP faults
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 07884c98671a734f20f2ac8302032657d262f3c9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Thu Jun 5 17:57:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Thu Jun 5 17:57:07 2014 +0200

    x86/amd: protect set_cpuidmask() against #GP faults
    
    Virtual environments such as Xen HVM containers and VirtualBox do not
    necessarily provide support for feature masking MSRs.
    
    As their presence is detected by model numbers alone, and their use predicated
    on command line parameters, use the safe() variants of {wr,rd}msr() to avoid
    dying with an early #GP fault.
    
    In fact, use the password variants in all cases because:
        a) they are safe to use even if not strictly required
        b) have a more useful function prototype for this purposes
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 xen/arch/x86/cpu/amd.c |   36 ++++++++++++++++++++++++------------
 1 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ea158cb..ba6b63e 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -151,6 +151,7 @@ static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
 	static unsigned int extfeat_ecx, extfeat_edx;
 	static unsigned int l7s0_eax, l7s0_ebx;
 	static unsigned int thermal_ecx;
+	static bool_t skip_feat, skip_extfeat;
 	static bool_t skip_l7s0_eax_ebx, skip_thermal_ecx;
 	static enum { not_parsed, no_mask, set_mask } status;
 	unsigned int eax, ebx, ecx, edx;
@@ -233,18 +234,29 @@ static void __devinit set_cpuidmask(const struct cpuinfo_x86 *c)
 
  setmask:
 	/* AMD processors prior to family 10h required a 32-bit password */
-	if (c->x86 >= 0x10) {
-		wrmsr(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
-		wrmsr(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
-		if (!skip_l7s0_eax_ebx)
-			wrmsr(MSR_AMD_L7S0_FEATURE_MASK, l7s0_ebx, l7s0_eax);
-		if (!skip_thermal_ecx) {
-			rdmsr(MSR_AMD_THRM_FEATURE_MASK, eax, edx);
-			wrmsr(MSR_AMD_THRM_FEATURE_MASK, thermal_ecx, edx);
-		}
-	} else {
-		wrmsr_amd(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx);
-		wrmsr_amd(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx);
+	if (!skip_feat &&
+	    wrmsr_amd_safe(MSR_K8_FEATURE_MASK, feat_edx, feat_ecx)) {
+		skip_feat = 1;
+		printk("Failed to set CPUID feature mask\n");
+	}
+
+	if (!skip_extfeat &&
+	    wrmsr_amd_safe(MSR_K8_EXT_FEATURE_MASK, extfeat_edx, extfeat_ecx)) {
+		skip_extfeat = 1;
+		printk("Failed to set CPUID extended feature mask\n");
+	}
+
+	if (!skip_l7s0_eax_ebx &&
+	    wrmsr_amd_safe(MSR_AMD_L7S0_FEATURE_MASK, l7s0_ebx, l7s0_eax)) {
+		skip_l7s0_eax_ebx = 1;
+		printk("Failed to set CPUID leaf 7 subleaf 0 feature mask\n");
+	}
+
+	if (!skip_thermal_ecx &&
+	    (rdmsr_amd_safe(MSR_AMD_THRM_FEATURE_MASK, &eax, &edx) ||
+	     wrmsr_amd_safe(MSR_AMD_THRM_FEATURE_MASK, thermal_ecx, edx))){
+		skip_thermal_ecx = 1;
+		printk("Failed to set CPUID thermal/power feature mask\n");
 	}
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBU-0001qv-Py; Thu, 19 Jun 2014 04:42:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBT-0001qd-MA
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:47 +0000
Received: from [85.158.139.211:38582] by server-10.bemta-5.messagelabs.com id
	8C/D8-01434-74A62A35; Thu, 19 Jun 2014 04:42:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403152965!7412485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12469 invoked from network); 19 Jun 2014 04:42:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBR-0002ZA-89
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBR-0007q4-6E
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:45 +0000
Date: Thu, 19 Jun 2014 04:42:45 +0000
Message-Id: <E1WxUBR-0007q4-6E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: further fix to
	XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 895661ae98f0249f50280b4acfb9dda70b76d7e9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 12:03:16 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:03:16 2014 +0200

    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 87af350..d927b59 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1277,8 +1277,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBU-0001qv-Py; Thu, 19 Jun 2014 04:42:48 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBT-0001qd-MA
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:47 +0000
Received: from [85.158.139.211:38582] by server-10.bemta-5.messagelabs.com id
	8C/D8-01434-74A62A35; Thu, 19 Jun 2014 04:42:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403152965!7412485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12469 invoked from network); 19 Jun 2014 04:42:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:42:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBR-0002ZA-89
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBR-0007q4-6E
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:45 +0000
Date: Thu, 19 Jun 2014 04:42:45 +0000
Message-Id: <E1WxUBR-0007q4-6E@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: further fix to
	XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 895661ae98f0249f50280b4acfb9dda70b76d7e9
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 12:03:16 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:03:16 2014 +0200

    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 87af350..d927b59 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1277,8 +1277,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBe-0001sM-SZ; Thu, 19 Jun 2014 04:42:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBd-0001s9-LL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:57 +0000
Received: from [85.158.143.35:19171] by server-2.bemta-4.messagelabs.com id
	95/E0-06539-15A62A35; Thu, 19 Jun 2014 04:42:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1403152975!12328861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9351 invoked from network); 19 Jun 2014 04:42: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;
	19 Jun 2014 04:42:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBb-0002ZG-EH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBb-0007qT-CK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:55 +0000
Date: Thu, 19 Jun 2014 04:42:55 +0000
Message-Id: <E1WxUBb-0007qT-CK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] avoid crash on HVM domain destroy with
	PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b9ae60907e6dbc686403e52a7e61a6f856401a1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 10 12:04:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:04:08 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c174c41..3ea9fc8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -297,7 +297,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:42:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:42:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBe-0001sM-SZ; Thu, 19 Jun 2014 04:42:58 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBd-0001s9-LL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:57 +0000
Received: from [85.158.143.35:19171] by server-2.bemta-4.messagelabs.com id
	95/E0-06539-15A62A35; Thu, 19 Jun 2014 04:42:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1403152975!12328861!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9351 invoked from network); 19 Jun 2014 04:42: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;
	19 Jun 2014 04:42:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBb-0002ZG-EH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBb-0007qT-CK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:42:55 +0000
Date: Thu, 19 Jun 2014 04:42:55 +0000
Message-Id: <E1WxUBb-0007qT-CK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] avoid crash on HVM domain destroy with
	PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b9ae60907e6dbc686403e52a7e61a6f856401a1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 10 12:04:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:04:08 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index c174c41..3ea9fc8 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -297,7 +297,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBo-0001te-VS; Thu, 19 Jun 2014 04:43:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBn-0001tU-T1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:07 +0000
Received: from [193.109.254.147:39334] by server-15.bemta-14.messagelabs.com
	id AA/92-15813-B5A62A35; Thu, 19 Jun 2014 04:43:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403152985!12222140!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26340 invoked from network); 19 Jun 2014 04:43:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBl-0002Zp-KE
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBl-0007qz-IY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:05 +0000
Date: Thu, 19 Jun 2014 04:43:05 +0000
Message-Id: <E1WxUBl-0007qz-IY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86,amd: remove unused wrmsr_amd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6686badb4a81f8b1f2eaaa198df06569a07f7ee
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 10 12:04:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:04:35 2014 +0200

    x86,amd: remove unused wrmsr_amd
    
    After Andrew's commit 07884c9, all writes to password-protected
    MSR's are performed using wrmsr_amd_safe.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 xen/arch/x86/cpu/amd.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ba6b63e..5e78f87 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -45,17 +45,6 @@ integer_param("cpuid_mask_thermal_ecx", opt_cpuid_mask_thermal_ecx);
 s8 __read_mostly opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
 
-static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
-		unsigned int hi)
-{
-	asm volatile (
-		"wrmsr"
-		: /* No outputs */
-		: "c" (index), "a" (lo), 
-		"d" (hi), "D" (0x9c5a203a)
-	);
-}
-
 static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 				 unsigned int *hi)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBo-0001te-VS; Thu, 19 Jun 2014 04:43:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBn-0001tU-T1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:07 +0000
Received: from [193.109.254.147:39334] by server-15.bemta-14.messagelabs.com
	id AA/92-15813-B5A62A35; Thu, 19 Jun 2014 04:43:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403152985!12222140!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26340 invoked from network); 19 Jun 2014 04:43:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBl-0002Zp-KE
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBl-0007qz-IY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:05 +0000
Date: Thu, 19 Jun 2014 04:43:05 +0000
Message-Id: <E1WxUBl-0007qz-IY@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86,amd: remove unused wrmsr_amd
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c6686badb4a81f8b1f2eaaa198df06569a07f7ee
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 10 12:04:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:04:35 2014 +0200

    x86,amd: remove unused wrmsr_amd
    
    After Andrew's commit 07884c9, all writes to password-protected
    MSR's are performed using wrmsr_amd_safe.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 xen/arch/x86/cpu/amd.c |   11 -----------
 1 files changed, 0 insertions(+), 11 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index ba6b63e..5e78f87 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -45,17 +45,6 @@ integer_param("cpuid_mask_thermal_ecx", opt_cpuid_mask_thermal_ecx);
 s8 __read_mostly opt_allow_unsafe;
 boolean_param("allow_unsafe", opt_allow_unsafe);
 
-static inline void wrmsr_amd(unsigned int index, unsigned int lo, 
-		unsigned int hi)
-{
-	asm volatile (
-		"wrmsr"
-		: /* No outputs */
-		: "c" (index), "a" (lo), 
-		"d" (hi), "D" (0x9c5a203a)
-	);
-}
-
 static inline int rdmsr_amd_safe(unsigned int msr, unsigned int *lo,
 				 unsigned int *hi)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBz-0001vK-2q; Thu, 19 Jun 2014 04:43:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBx-0001v7-Tj
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:18 +0000
Received: from [85.158.139.211:39486] by server-10.bemta-5.messagelabs.com id
	D8/29-01434-56A62A35; Thu, 19 Jun 2014 04:43:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403152995!5472535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6343 invoked from network); 19 Jun 2014 04:43:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBv-0002Zv-Pr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBv-0007rL-Nh
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:15 +0000
Date: Thu, 19 Jun 2014 04:43:15 +0000
Message-Id: <E1WxUBv-0007rL-Nh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/grant: add a newline into error
	message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea7a1bf21a428d447e2fe479f1146beeac45c18b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 12:04:59 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:04:59 2014 +0200

    common/grant: add a newline into error message
    
    Avoid corrupting the next line on the console.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index c08e957..464007e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -580,7 +580,7 @@ __gnttab_map_grant_ref(
 
     if ( rgt->gt_version == 0 )
         PIN_FAIL(unlock_out, GNTST_general_error,
-                 "remote grant table not yet set up");
+                 "remote grant table not yet set up\n");
 
     /* Bounds check on the grant ref */
     if ( unlikely(op->ref >= nr_grant_entries(rgt)))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUBz-0001vK-2q; Thu, 19 Jun 2014 04:43:19 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBx-0001v7-Tj
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:18 +0000
Received: from [85.158.139.211:39486] by server-10.bemta-5.messagelabs.com id
	D8/29-01434-56A62A35; Thu, 19 Jun 2014 04:43:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403152995!5472535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6343 invoked from network); 19 Jun 2014 04:43:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBv-0002Zv-Pr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUBv-0007rL-Nh
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:15 +0000
Date: Thu, 19 Jun 2014 04:43:15 +0000
Message-Id: <E1WxUBv-0007rL-Nh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] common/grant: add a newline into error
	message
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ea7a1bf21a428d447e2fe479f1146beeac45c18b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 12:04:59 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:04:59 2014 +0200

    common/grant: add a newline into error message
    
    Avoid corrupting the next line on the console.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/common/grant_table.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index c08e957..464007e 100644
--- a/xen/common/grant_table.c
+++ b/xen/common/grant_table.c
@@ -580,7 +580,7 @@ __gnttab_map_grant_ref(
 
     if ( rgt->gt_version == 0 )
         PIN_FAIL(unlock_out, GNTST_general_error,
-                 "remote grant table not yet set up");
+                 "remote grant table not yet set up\n");
 
     /* Bounds check on the grant ref */
     if ( unlikely(op->ref >= nr_grant_entries(rgt)))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUC9-0001xY-8E; Thu, 19 Jun 2014 04:43:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUC8-0001xH-Be
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:28 +0000
Received: from [85.158.139.211:22436] by server-17.bemta-5.messagelabs.com id
	4E/D2-08711-F6A62A35; Thu, 19 Jun 2014 04:43:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1403153006!10744420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2609 invoked from network); 19 Jun 2014 04:43:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUC5-0002a1-W7
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUC5-0007sQ-UB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:25 +0000
Date: Thu, 19 Jun 2014 04:43:25 +0000
Message-Id: <E1WxUC5-0007sQ-UB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpufreq: extend documentation for
	cpufreq parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f08cb2b2eaa0e53880b26728523b0c5198c5b695
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 10 12:05:37 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:05:37 2014 +0200

    cpufreq: extend documentation for cpufreq parameter
    
    cpufreq parameter can take more options than currently
    documented. Include these with some comments regarding
    their intention.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 docs/misc/xen-command-line.markdown |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 514c7b2..25829fe 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -323,12 +323,17 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= dom0-kernel | none | xen`
+> `= dom0-kernel | none | xen[,[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]`
 
 > Default: `xen`
 
 Indicate where the responsibility for driving power states lies.
 
+* Default governor policy is ondemand.
+* `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
+  respectively.
+* `verbose` option can be included as a string or also as `verbose=<integer>`
+
 ### cpuid\_mask\_cpu (AMD only)
 > `= fam_0f_rev_c | fam_0f_rev_d | fam_0f_rev_e | fam_0f_rev_f | fam_0f_rev_g | fam_10_rev_b | fam_10_rev_c | fam_11_rev_b`
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUC9-0001xY-8E; Thu, 19 Jun 2014 04:43:29 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUC8-0001xH-Be
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:28 +0000
Received: from [85.158.139.211:22436] by server-17.bemta-5.messagelabs.com id
	4E/D2-08711-F6A62A35; Thu, 19 Jun 2014 04:43:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-206.messagelabs.com!1403153006!10744420!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2609 invoked from network); 19 Jun 2014 04:43:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUC5-0002a1-W7
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUC5-0007sQ-UB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:25 +0000
Date: Thu, 19 Jun 2014 04:43:25 +0000
Message-Id: <E1WxUC5-0007sQ-UB@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpufreq: extend documentation for
	cpufreq parameter
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f08cb2b2eaa0e53880b26728523b0c5198c5b695
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 10 12:05:37 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 12:05:37 2014 +0200

    cpufreq: extend documentation for cpufreq parameter
    
    cpufreq parameter can take more options than currently
    documented. Include these with some comments regarding
    their intention.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
---
 docs/misc/xen-command-line.markdown |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 514c7b2..25829fe 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -323,12 +323,17 @@ If set, force use of the performance counters for oprofile, rather than detectin
 available support.
 
 ### cpufreq
-> `= dom0-kernel | none | xen`
+> `= dom0-kernel | none | xen[,[powersave|performance|ondemand|userspace][,<maxfreq>][,[<minfreq>][,[verbose]]]]`
 
 > Default: `xen`
 
 Indicate where the responsibility for driving power states lies.
 
+* Default governor policy is ondemand.
+* `<maxfreq>` and `<minfreq>` are integers which represent max and min processor frequencies
+  respectively.
+* `verbose` option can be included as a string or also as `verbose=<integer>`
+
 ### cpuid\_mask\_cpu (AMD only)
 > `= fam_0f_rev_c | fam_0f_rev_d | fam_0f_rev_e | fam_0f_rev_f | fam_0f_rev_g | fam_10_rev_b | fam_10_rev_c | fam_11_rev_b`
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCJ-0001zF-BB; Thu, 19 Jun 2014 04:43:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCI-0001z2-F1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:38 +0000
Received: from [85.158.143.35:22575] by server-2.bemta-4.messagelabs.com id
	02/41-06539-97A62A35; Thu, 19 Jun 2014 04:43:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1403153016!5056804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13165 invoked from network); 19 Jun 2014 04:43:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCG-0002a7-7W
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCG-0007sn-4x
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:36 +0000
Date: Thu, 19 Jun 2014 04:43:36 +0000
Message-Id: <E1WxUCG-0007sn-4x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: include .text.cold and
	.text.unlikely in text area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0add92bb6553bfa481e84203bbb93b946d61824
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 9 15:28:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 11:16:29 2014 +0100

    xen: arm: include .text.cold and .text.unlikely in text area
    
    Otherwise functions in these sections can end up between .text and .rodata
    which is after _etext and therefore gets made non-executable.
    
    This matches x86 (although it was done there for different reasons).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/arm/xen.lds.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index e8b4f47..be55dad 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -30,6 +30,8 @@ SECTIONS
   .text : /* XXX should be AT ( XEN_PHYS_START ) */ {
         _stext = .;            /* Text section */
        *(.text)
+       *(.text.cold)
+       *(.text.unlikely)
        *(.fixup)
        *(.gnu.warning)
        _etext = .;             /* End of text section */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCJ-0001zF-BB; Thu, 19 Jun 2014 04:43:39 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCI-0001z2-F1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:38 +0000
Received: from [85.158.143.35:22575] by server-2.bemta-4.messagelabs.com id
	02/41-06539-97A62A35; Thu, 19 Jun 2014 04:43:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-21.messagelabs.com!1403153016!5056804!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13165 invoked from network); 19 Jun 2014 04:43:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCG-0002a7-7W
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCG-0007sn-4x
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:36 +0000
Date: Thu, 19 Jun 2014 04:43:36 +0000
Message-Id: <E1WxUCG-0007sn-4x@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen: arm: include .text.cold and
	.text.unlikely in text area
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b0add92bb6553bfa481e84203bbb93b946d61824
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Mon Jun 9 15:28:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 11:16:29 2014 +0100

    xen: arm: include .text.cold and .text.unlikely in text area
    
    Otherwise functions in these sections can end up between .text and .rodata
    which is after _etext and therefore gets made non-executable.
    
    This matches x86 (although it was done there for different reasons).
    
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Cc: Jan Beulich <JBeulich@suse.com>
---
 xen/arch/arm/xen.lds.S |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index e8b4f47..be55dad 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -30,6 +30,8 @@ SECTIONS
   .text : /* XXX should be AT ( XEN_PHYS_START ) */ {
         _stext = .;            /* Text section */
        *(.text)
+       *(.text.cold)
+       *(.text.unlikely)
        *(.fixup)
        *(.gnu.warning)
        _etext = .;             /* End of text section */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCU-00020p-Dn; Thu, 19 Jun 2014 04:43:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCS-00020W-QZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:49 +0000
Received: from [85.158.143.35:5963] by server-2.bemta-4.messagelabs.com id
	F9/51-06539-48A62A35; Thu, 19 Jun 2014 04:43:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1403153026!12319314!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13306 invoked from network); 19 Jun 2014 04:43:47 -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;
	19 Jun 2014 04:43:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCQ-0002aD-Cp
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCQ-0007t9-Bd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:46 +0000
Date: Thu, 19 Jun 2014 04:43:46 +0000
Message-Id: <E1WxUCQ-0007t9-Bd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Annotate xc_report_error
	with __attribute__((format))
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1f009af79b05ad99561bca4521499f2c7cbd00c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 9 16:41:06 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:46:45 2014 +0100

    tools/libxc: Annotate xc_report_error with __attribute__((format))
    
    This helps the compiler spot printf formatting errors.
    
    Fix up all errors discovered.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_core.c           |    2 +-
 tools/libxc/xc_domain_restore.c |    6 +++---
 tools/libxc/xc_gnttab.c         |    2 +-
 tools/libxc/xc_private.h        |    3 ++-
 tools/xenpaging/xenpaging.c     |    2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index 4bc1abb..dfa424b 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -497,7 +497,7 @@ xc_domain_dumpcore_via_callback(xc_interface *xch,
     ctxt = calloc(sizeof(*ctxt), info.max_vcpu_id + 1);
     if ( !ctxt )
     {
-        PERROR("Could not allocate vcpu context array", domid);
+        PERROR("Could not allocate vcpu context array");
         goto out;
     }
 
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index 89af1ad..b80f867 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -102,7 +102,7 @@ static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx,
             errno = 0;
         }
         if ( len <= 0 ) {
-            ERROR("%s failed (read rc: %d, errno: %d)", __func__, len, errno);
+            ERROR("%s failed (read rc: %zd, errno: %d)", __func__, len, errno);
             return -1;
         }
         offset += len;
@@ -443,7 +443,7 @@ static int compat_buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
     }
 
     if ( memcmp(qbuf, "QEVM", 4) ) {
-        ERROR("Invalid QEMU magic: 0x%08x", *(unsigned long*)qbuf);
+        ERROR("Invalid QEMU magic: 0x%08"PRIx32, *(uint32_t*)qbuf);
         free(qbuf);
         return -1;
     }
@@ -1802,7 +1802,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     } else if (pagebuf.acpi_ioport_location == 0) {
         DBGPRINTF("Use old firmware ioport from the checkpoint\n");
     } else {
-        ERROR("Error, unknow acpi ioport location (%i)", pagebuf.acpi_ioport_location);
+        ERROR("Error, unknow acpi ioport location (%"PRId64")", pagebuf.acpi_ioport_location);
     }
 
     tdatatmp = tdata;
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 3b6058c..4076e47 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -75,7 +75,7 @@ static void *_gnttab_map_table(xc_interface *xch, int domid, int *gnt_num)
 
     if ( rc || (query.status != GNTST_okay) )
     {
-        ERROR("Could not query dom's grant size\n", domid);
+        ERROR("Could not query dom%d's grant size\n", domid);
         return NULL;
     }
 
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 670a82d..29e926c 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -93,7 +93,8 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
-void xc_report_error(xc_interface *xch, int code, const char *fmt, ...);
+void xc_report_error(xc_interface *xch, int code, const char *fmt, ...)
+    __attribute__((format(printf,3,4)));
 void xc_reportv(xc_interface *xch, xentoollog_logger *lg, xentoollog_level,
                 int code, const char *fmt, va_list args)
      __attribute__((format(printf,5,0)));
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index 5ef2f09..82c1ee4 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -912,7 +912,7 @@ int main(int argc, char *argv[])
 
             if ( req.gfn > paging->max_pages )
             {
-                ERROR("Requested gfn %"PRIx64" higher than max_pages %lx\n", req.gfn, paging->max_pages);
+                ERROR("Requested gfn %"PRIx64" higher than max_pages %x\n", req.gfn, paging->max_pages);
                 goto out;
             }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:43:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:43:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCU-00020p-Dn; Thu, 19 Jun 2014 04:43:50 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCS-00020W-QZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:49 +0000
Received: from [85.158.143.35:5963] by server-2.bemta-4.messagelabs.com id
	F9/51-06539-48A62A35; Thu, 19 Jun 2014 04:43:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1403153026!12319314!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13306 invoked from network); 19 Jun 2014 04:43:47 -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;
	19 Jun 2014 04:43:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCQ-0002aD-Cp
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCQ-0007t9-Bd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:46 +0000
Date: Thu, 19 Jun 2014 04:43:46 +0000
Message-Id: <E1WxUCQ-0007t9-Bd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Annotate xc_report_error
	with __attribute__((format))
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f1f009af79b05ad99561bca4521499f2c7cbd00c
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 9 16:41:06 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:46:45 2014 +0100

    tools/libxc: Annotate xc_report_error with __attribute__((format))
    
    This helps the compiler spot printf formatting errors.
    
    Fix up all errors discovered.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_core.c           |    2 +-
 tools/libxc/xc_domain_restore.c |    6 +++---
 tools/libxc/xc_gnttab.c         |    2 +-
 tools/libxc/xc_private.h        |    3 ++-
 tools/xenpaging/xenpaging.c     |    2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/tools/libxc/xc_core.c b/tools/libxc/xc_core.c
index 4bc1abb..dfa424b 100644
--- a/tools/libxc/xc_core.c
+++ b/tools/libxc/xc_core.c
@@ -497,7 +497,7 @@ xc_domain_dumpcore_via_callback(xc_interface *xch,
     ctxt = calloc(sizeof(*ctxt), info.max_vcpu_id + 1);
     if ( !ctxt )
     {
-        PERROR("Could not allocate vcpu context array", domid);
+        PERROR("Could not allocate vcpu context array");
         goto out;
     }
 
diff --git a/tools/libxc/xc_domain_restore.c b/tools/libxc/xc_domain_restore.c
index 89af1ad..b80f867 100644
--- a/tools/libxc/xc_domain_restore.c
+++ b/tools/libxc/xc_domain_restore.c
@@ -102,7 +102,7 @@ static ssize_t rdexact(xc_interface *xch, struct restore_ctx *ctx,
             errno = 0;
         }
         if ( len <= 0 ) {
-            ERROR("%s failed (read rc: %d, errno: %d)", __func__, len, errno);
+            ERROR("%s failed (read rc: %zd, errno: %d)", __func__, len, errno);
             return -1;
         }
         offset += len;
@@ -443,7 +443,7 @@ static int compat_buffer_qemu(xc_interface *xch, struct restore_ctx *ctx,
     }
 
     if ( memcmp(qbuf, "QEVM", 4) ) {
-        ERROR("Invalid QEMU magic: 0x%08x", *(unsigned long*)qbuf);
+        ERROR("Invalid QEMU magic: 0x%08"PRIx32, *(uint32_t*)qbuf);
         free(qbuf);
         return -1;
     }
@@ -1802,7 +1802,7 @@ int xc_domain_restore(xc_interface *xch, int io_fd, uint32_t dom,
     } else if (pagebuf.acpi_ioport_location == 0) {
         DBGPRINTF("Use old firmware ioport from the checkpoint\n");
     } else {
-        ERROR("Error, unknow acpi ioport location (%i)", pagebuf.acpi_ioport_location);
+        ERROR("Error, unknow acpi ioport location (%"PRId64")", pagebuf.acpi_ioport_location);
     }
 
     tdatatmp = tdata;
diff --git a/tools/libxc/xc_gnttab.c b/tools/libxc/xc_gnttab.c
index 3b6058c..4076e47 100644
--- a/tools/libxc/xc_gnttab.c
+++ b/tools/libxc/xc_gnttab.c
@@ -75,7 +75,7 @@ static void *_gnttab_map_table(xc_interface *xch, int domid, int *gnt_num)
 
     if ( rc || (query.status != GNTST_okay) )
     {
-        ERROR("Could not query dom's grant size\n", domid);
+        ERROR("Could not query dom%d's grant size\n", domid);
         return NULL;
     }
 
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 670a82d..29e926c 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -93,7 +93,8 @@ struct xc_interface_core {
     xc_osdep_handle  ops_handle; /* opaque data for xc_osdep_ops */
 };
 
-void xc_report_error(xc_interface *xch, int code, const char *fmt, ...);
+void xc_report_error(xc_interface *xch, int code, const char *fmt, ...)
+    __attribute__((format(printf,3,4)));
 void xc_reportv(xc_interface *xch, xentoollog_logger *lg, xentoollog_level,
                 int code, const char *fmt, va_list args)
      __attribute__((format(printf,5,0)));
diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
index 5ef2f09..82c1ee4 100644
--- a/tools/xenpaging/xenpaging.c
+++ b/tools/xenpaging/xenpaging.c
@@ -912,7 +912,7 @@ int main(int argc, char *argv[])
 
             if ( req.gfn > paging->max_pages )
             {
-                ERROR("Requested gfn %"PRIx64" higher than max_pages %lx\n", req.gfn, paging->max_pages);
+                ERROR("Requested gfn %"PRIx64" higher than max_pages %x\n", req.gfn, paging->max_pages);
                 goto out;
             }
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCh-00022I-F7; Thu, 19 Jun 2014 04:44:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCe-000226-Ry
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:01 +0000
Received: from [193.109.254.147:40902] by server-6.bemta-14.messagelabs.com id
	5C/CE-13066-09A62A35; Thu, 19 Jun 2014 04:44:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403153036!12257156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26265 invoked from network); 19 Jun 2014 04:43:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCa-0002aJ-Ip
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCa-0007tV-H9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:56 +0000
Date: Thu, 19 Jun 2014 04:43:56 +0000
Message-Id: <E1WxUCa-0007tV-H9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Annotate xc_osdep_log
	with __attribute__((format))
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66f8c6391d59a2b466a4368ff78b1f527c94c7f6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 9 16:41:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:46:45 2014 +0100

    tools/libxc: Annotate xc_osdep_log with __attribute__((format))
    
    This helps the compiler spot printf formatting errors.
    
    Fix up resulting errors in xenctrl_osdep_ENOSYS.c.  Substitute %p for the
    slightly less bad %lx when trying to format an opaque structure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xenctrl_osdep_ENOSYS.c |   32 ++++++++++++++++----------------
 tools/libxc/xenctrlosdep.h         |    3 ++-
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
index 4821342..abdf3d5 100644
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c
@@ -15,19 +15,19 @@
 
 static xc_osdep_handle ENOSYS_privcmd_open(xc_interface *xch)
 {
-    IPRINTF(xch, "ENOSYS_privcmd: opening handle %p\n", (void *)1);
+    IPRINTF(xch, "ENOSYS_privcmd: opening handle %d\n", 1);
     return (xc_osdep_handle)1; /*dummy*/
 }
 
 static int ENOSYS_privcmd_close(xc_interface *xch, xc_osdep_handle h)
 {
-    IPRINTF(xch, "ENOSYS_privcmd: closing handle %p\n", h);
+    IPRINTF(xch, "ENOSYS_privcmd: closing handle %lx\n", h);
     return 0;
 }
 
 static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: hypercall: %02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
+    IPRINTF(xch, "ENOSYS_privcmd %lx: hypercall: %02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
             h, hypercall->op,
             hypercall->arg[0], hypercall->arg[1], hypercall->arg[2],
             hypercall->arg[3], hypercall->arg[4]);
@@ -37,21 +37,21 @@ static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
 static void *ENOSYS_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
                                       xen_pfn_t *arr, int num)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_batch: dom%d prot %#x arr %p num %d\n", h, dom, prot, arr, num);
+    IPRINTF(xch, "ENOSYS_privcmd %lx: map_foreign_batch: dom%d prot %#x arr %p num %d\n", h, dom, prot, arr, num);
     return MAP_FAILED;
 }
 
 static void *ENOSYS_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
                                      const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_buld: dom%d prot %#x arr %p err %p num %d\n", h, dom, prot, arr, err, num);
+    IPRINTF(xch, "ENOSYS_privcmd %lx map_foreign_buld: dom%d prot %#x arr %p err %p num %d\n", h, dom, prot, arr, err, num);
     return MAP_FAILED;
 }
 
 static void *ENOSYS_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int size, int prot,
                                       unsigned long mfn)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_range: dom%d size %#x prot %#x mfn %ld\n", h, dom, size, prot, mfn);
+    IPRINTF(xch, "ENOSYS_privcmd %lx map_foreign_range: dom%d size %#x prot %#x mfn %ld\n", h, dom, size, prot, mfn);
     return MAP_FAILED;
 }
 
@@ -59,7 +59,7 @@ static void *ENOSYS_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
                                        size_t chunksize, privcmd_mmap_entry_t entries[],
                                        int nentries)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_ranges: dom%d size %zd prot %#x chunksize %zd entries %p num %d\n", h, dom, size, prot, chunksize, entries, nentries);
+    IPRINTF(xch, "ENOSYS_privcmd %lx map_foreign_ranges: dom%d size %zd prot %#x chunksize %zd entries %p num %d\n", h, dom, size, prot, chunksize, entries, nentries);
     return MAP_FAILED;
 }
 
@@ -85,59 +85,59 @@ static xc_osdep_handle ENOSYS_evtchn_open(xc_interface *xce)
 
 static int ENOSYS_evtchn_close(xc_interface *xce, xc_osdep_handle h)
 {
-    IPRINTF(xce, "ENOSYS_evtchn: closing handle %p\n", h);
+    IPRINTF(xce, "ENOSYS_evtchn: closing handle %lx\n", h);
     return 0;
 }
 
 static int ENOSYS_evtchn_fd(xc_interface *xce, xc_osdep_handle h)
 {
-    IPRINTF(xce, "ENOSYS_fd %p: fd\n", h);
+    IPRINTF(xce, "ENOSYS_fd %lx fd\n", h);
     return (int)h;
 }
 
 static int ENOSYS_evtchn_notify(xc_interface *xce, xc_osdep_handle h, evtchn_port_t port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: notify: %d\n", h, port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx notify: %d\n", h, port);
     return -ENOSYS;
 }
 
 static int ENOSYS_evtchn_bind_unbound_port(xc_interface *xce, xc_osdep_handle h, int domid)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: bind_unbound_port: dom%d\n", h, domid);
+    IPRINTF(xce, "ENOSYS_evtchn %lx bind_unbound_port: dom%d\n", h, domid);
     return -ENOSYS;
 }
 
 
 static int ENOSYS_evtchn_bind_interdomain(xc_interface *xce, xc_osdep_handle h, int domid, evtchn_port_t remote_port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: bind_interdomain: dmo%d %d\n", h, domid, remote_port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx bind_interdomain: dmo%d %d\n", h, domid, remote_port);
     return -ENOSYS;
 }
 
 
 static int ENOSYS_evtchn_bind_virq(xc_interface *xce, xc_osdep_handle h, unsigned int virq)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: bind_virq: %d\n", h, virq);
+    IPRINTF(xce, "ENOSYS_evtchn %lx bind_virq: %d\n", h, virq);
     return -ENOSYS;
 }
 
 
 static int ENOSYS_evtchn_unbind(xc_interface *xce, xc_osdep_handle h, evtchn_port_t port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: unbind: %d\n", h, port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx unbind: %d\n", h, port);
     return -ENOSYS;
 }
 
 
 static evtchn_port_or_error_t ENOSYS_evtchn_pending(xc_interface *xce, xc_osdep_handle h)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: pending\n", h);
+    IPRINTF(xce, "ENOSYS_evtchn %lx pending\n", h);
     return -ENOSYS;
 }
 
 static int ENOSYS_evtchn_unmask(xc_interface *xce, xc_osdep_handle h, evtchn_port_t port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: unmask: %d\n", h, port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx unmask: %d\n", h, port);
     return -ENOSYS;
 }
 
diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h
index e610a24..e97944b 100644
--- a/tools/libxc/xenctrlosdep.h
+++ b/tools/libxc/xenctrlosdep.h
@@ -157,7 +157,8 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,
                                  const xen_pfn_t *arr, int *err, unsigned int num);
 
 /* Report errors through xc_interface */
-void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code, const char *fmt, ...);
+void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code,
+                  const char *fmt, ...) __attribute__((format(printf, 4, 5)));
 
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCh-00022I-F7; Thu, 19 Jun 2014 04:44:03 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCe-000226-Ry
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:01 +0000
Received: from [193.109.254.147:40902] by server-6.bemta-14.messagelabs.com id
	5C/CE-13066-09A62A35; Thu, 19 Jun 2014 04:44:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403153036!12257156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26265 invoked from network); 19 Jun 2014 04:43:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:43:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCa-0002aJ-Ip
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCa-0007tV-H9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:43:56 +0000
Date: Thu, 19 Jun 2014 04:43:56 +0000
Message-Id: <E1WxUCa-0007tV-H9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Annotate xc_osdep_log
	with __attribute__((format))
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 66f8c6391d59a2b466a4368ff78b1f527c94c7f6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 9 16:41:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:46:45 2014 +0100

    tools/libxc: Annotate xc_osdep_log with __attribute__((format))
    
    This helps the compiler spot printf formatting errors.
    
    Fix up resulting errors in xenctrl_osdep_ENOSYS.c.  Substitute %p for the
    slightly less bad %lx when trying to format an opaque structure.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xenctrl_osdep_ENOSYS.c |   32 ++++++++++++++++----------------
 tools/libxc/xenctrlosdep.h         |    3 ++-
 2 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/tools/libxc/xenctrl_osdep_ENOSYS.c b/tools/libxc/xenctrl_osdep_ENOSYS.c
index 4821342..abdf3d5 100644
--- a/tools/libxc/xenctrl_osdep_ENOSYS.c
+++ b/tools/libxc/xenctrl_osdep_ENOSYS.c
@@ -15,19 +15,19 @@
 
 static xc_osdep_handle ENOSYS_privcmd_open(xc_interface *xch)
 {
-    IPRINTF(xch, "ENOSYS_privcmd: opening handle %p\n", (void *)1);
+    IPRINTF(xch, "ENOSYS_privcmd: opening handle %d\n", 1);
     return (xc_osdep_handle)1; /*dummy*/
 }
 
 static int ENOSYS_privcmd_close(xc_interface *xch, xc_osdep_handle h)
 {
-    IPRINTF(xch, "ENOSYS_privcmd: closing handle %p\n", h);
+    IPRINTF(xch, "ENOSYS_privcmd: closing handle %lx\n", h);
     return 0;
 }
 
 static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcmd_hypercall_t *hypercall)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: hypercall: %02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
+    IPRINTF(xch, "ENOSYS_privcmd %lx: hypercall: %02lld(%#llx,%#llx,%#llx,%#llx,%#llx)\n",
             h, hypercall->op,
             hypercall->arg[0], hypercall->arg[1], hypercall->arg[2],
             hypercall->arg[3], hypercall->arg[4]);
@@ -37,21 +37,21 @@ static int ENOSYS_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
 static void *ENOSYS_privcmd_map_foreign_batch(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
                                       xen_pfn_t *arr, int num)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_batch: dom%d prot %#x arr %p num %d\n", h, dom, prot, arr, num);
+    IPRINTF(xch, "ENOSYS_privcmd %lx: map_foreign_batch: dom%d prot %#x arr %p num %d\n", h, dom, prot, arr, num);
     return MAP_FAILED;
 }
 
 static void *ENOSYS_privcmd_map_foreign_bulk(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int prot,
                                      const xen_pfn_t *arr, int *err, unsigned int num)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_buld: dom%d prot %#x arr %p err %p num %d\n", h, dom, prot, arr, err, num);
+    IPRINTF(xch, "ENOSYS_privcmd %lx map_foreign_buld: dom%d prot %#x arr %p err %p num %d\n", h, dom, prot, arr, err, num);
     return MAP_FAILED;
 }
 
 static void *ENOSYS_privcmd_map_foreign_range(xc_interface *xch, xc_osdep_handle h, uint32_t dom, int size, int prot,
                                       unsigned long mfn)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_range: dom%d size %#x prot %#x mfn %ld\n", h, dom, size, prot, mfn);
+    IPRINTF(xch, "ENOSYS_privcmd %lx map_foreign_range: dom%d size %#x prot %#x mfn %ld\n", h, dom, size, prot, mfn);
     return MAP_FAILED;
 }
 
@@ -59,7 +59,7 @@ static void *ENOSYS_privcmd_map_foreign_ranges(xc_interface *xch, xc_osdep_handl
                                        size_t chunksize, privcmd_mmap_entry_t entries[],
                                        int nentries)
 {
-    IPRINTF(xch, "ENOSYS_privcmd %p: map_foreign_ranges: dom%d size %zd prot %#x chunksize %zd entries %p num %d\n", h, dom, size, prot, chunksize, entries, nentries);
+    IPRINTF(xch, "ENOSYS_privcmd %lx map_foreign_ranges: dom%d size %zd prot %#x chunksize %zd entries %p num %d\n", h, dom, size, prot, chunksize, entries, nentries);
     return MAP_FAILED;
 }
 
@@ -85,59 +85,59 @@ static xc_osdep_handle ENOSYS_evtchn_open(xc_interface *xce)
 
 static int ENOSYS_evtchn_close(xc_interface *xce, xc_osdep_handle h)
 {
-    IPRINTF(xce, "ENOSYS_evtchn: closing handle %p\n", h);
+    IPRINTF(xce, "ENOSYS_evtchn: closing handle %lx\n", h);
     return 0;
 }
 
 static int ENOSYS_evtchn_fd(xc_interface *xce, xc_osdep_handle h)
 {
-    IPRINTF(xce, "ENOSYS_fd %p: fd\n", h);
+    IPRINTF(xce, "ENOSYS_fd %lx fd\n", h);
     return (int)h;
 }
 
 static int ENOSYS_evtchn_notify(xc_interface *xce, xc_osdep_handle h, evtchn_port_t port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: notify: %d\n", h, port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx notify: %d\n", h, port);
     return -ENOSYS;
 }
 
 static int ENOSYS_evtchn_bind_unbound_port(xc_interface *xce, xc_osdep_handle h, int domid)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: bind_unbound_port: dom%d\n", h, domid);
+    IPRINTF(xce, "ENOSYS_evtchn %lx bind_unbound_port: dom%d\n", h, domid);
     return -ENOSYS;
 }
 
 
 static int ENOSYS_evtchn_bind_interdomain(xc_interface *xce, xc_osdep_handle h, int domid, evtchn_port_t remote_port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: bind_interdomain: dmo%d %d\n", h, domid, remote_port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx bind_interdomain: dmo%d %d\n", h, domid, remote_port);
     return -ENOSYS;
 }
 
 
 static int ENOSYS_evtchn_bind_virq(xc_interface *xce, xc_osdep_handle h, unsigned int virq)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: bind_virq: %d\n", h, virq);
+    IPRINTF(xce, "ENOSYS_evtchn %lx bind_virq: %d\n", h, virq);
     return -ENOSYS;
 }
 
 
 static int ENOSYS_evtchn_unbind(xc_interface *xce, xc_osdep_handle h, evtchn_port_t port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: unbind: %d\n", h, port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx unbind: %d\n", h, port);
     return -ENOSYS;
 }
 
 
 static evtchn_port_or_error_t ENOSYS_evtchn_pending(xc_interface *xce, xc_osdep_handle h)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: pending\n", h);
+    IPRINTF(xce, "ENOSYS_evtchn %lx pending\n", h);
     return -ENOSYS;
 }
 
 static int ENOSYS_evtchn_unmask(xc_interface *xce, xc_osdep_handle h, evtchn_port_t port)
 {
-    IPRINTF(xce, "ENOSYS_evtchn %p: unmask: %d\n", h, port);
+    IPRINTF(xce, "ENOSYS_evtchn %lx unmask: %d\n", h, port);
     return -ENOSYS;
 }
 
diff --git a/tools/libxc/xenctrlosdep.h b/tools/libxc/xenctrlosdep.h
index e610a24..e97944b 100644
--- a/tools/libxc/xenctrlosdep.h
+++ b/tools/libxc/xenctrlosdep.h
@@ -157,7 +157,8 @@ void *xc_map_foreign_bulk_compat(xc_interface *xch, xc_osdep_handle h,
                                  const xen_pfn_t *arr, int *err, unsigned int num);
 
 /* Report errors through xc_interface */
-void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code, const char *fmt, ...);
+void xc_osdep_log(xc_interface *xch, xentoollog_level level, int code,
+                  const char *fmt, ...) __attribute__((format(printf, 4, 5)));
 
 #endif
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCo-00023M-Hf; Thu, 19 Jun 2014 04:44:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCn-000232-6a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:09 +0000
Received: from [193.109.254.147:41191] by server-3.bemta-14.messagelabs.com id
	E3/C5-22179-89A62A35; Thu, 19 Jun 2014 04:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1403153046!6837338!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20625 invoked from network); 19 Jun 2014 04:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCk-0002av-Pr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCk-0007u8-Nb
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:06 +0000
Date: Thu, 19 Jun 2014 04:44:06 +0000
Message-Id: <E1WxUCk-0007u8-Nb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Use _Static_assert if
	available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d5a3bc1a214b0bd384868062f0502732244c04f6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 9 16:41:08 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:46:45 2014 +0100

    tools/libxc: Use _Static_assert if available
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_private.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 29e926c..12476ec 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -48,7 +48,11 @@
 #define PAGE_MASK               XC_PAGE_MASK
 
 /* Force a compilation error if condition is true */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#define XC_BUILD_BUG_ON(p) ({ _Static_assert(!(p), "!(" #p ")"); })
+#else
 #define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); }))
+#endif
 
 /*
 ** Define max dirty page cache to permit during save/restore -- need to balance 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCo-00023M-Hf; Thu, 19 Jun 2014 04:44:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCn-000232-6a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:09 +0000
Received: from [193.109.254.147:41191] by server-3.bemta-14.messagelabs.com id
	E3/C5-22179-89A62A35; Thu, 19 Jun 2014 04:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-27.messagelabs.com!1403153046!6837338!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20625 invoked from network); 19 Jun 2014 04:44:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCk-0002av-Pr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCk-0007u8-Nb
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:06 +0000
Date: Thu, 19 Jun 2014 04:44:06 +0000
Message-Id: <E1WxUCk-0007u8-Nb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Use _Static_assert if
	available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d5a3bc1a214b0bd384868062f0502732244c04f6
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Mon Jun 9 16:41:08 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:46:45 2014 +0100

    tools/libxc: Use _Static_assert if available
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_private.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 29e926c..12476ec 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -48,7 +48,11 @@
 #define PAGE_MASK               XC_PAGE_MASK
 
 /* Force a compilation error if condition is true */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)
+#define XC_BUILD_BUG_ON(p) ({ _Static_assert(!(p), "!(" #p ")"); })
+#else
 #define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); }))
+#endif
 
 /*
 ** Define max dirty page cache to permit during save/restore -- need to balance 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCy-000257-KL; Thu, 19 Jun 2014 04:44:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCx-00024p-9D
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:19 +0000
Received: from [85.158.143.35:23922] by server-2.bemta-4.messagelabs.com id
	6F/81-06539-2AA62A35; Thu, 19 Jun 2014 04:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403153057!12383217!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8212 invoked from network); 19 Jun 2014 04:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCu-0002b1-Vg
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCu-0007uU-Tn
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:16 +0000
Date: Thu, 19 Jun 2014 04:44:16 +0000
Message-Id: <E1WxUCu-0007uU-Tn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: add
	DECLARE_HYPERCALL_BUFFER_SHADOW()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 60572c972b8dbfbfff91c3bf0773838381c5a8c4
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Jun 9 16:41:10 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:47:31 2014 +0100

    tools/libxc: add DECLARE_HYPERCALL_BUFFER_SHADOW()
    
    DECLARE_HYPERCALL_BUFFER_SHADOW() is like DECLARE_HYPERCALL_BUFFER()
    except it is backed by an already allocated hypercall buffer.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xenctrl.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 400f0df..b55d857 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -266,6 +266,24 @@ typedef struct xc_hypercall_buffer xc_hypercall_buffer_t;
     }
 
 /*
+ * Like DECLARE_HYPERCALL_BUFFER() but using an already allocated
+ * hypercall buffer, _hbuf.
+ *
+ * Useful when a hypercall buffer is passed to a function and access
+ * via the user pointer is required.
+ *
+ * See DECLARE_HYPERCALL_BUFFER_ARGUMENT() if the user pointer is not
+ * required.
+ */
+#define DECLARE_HYPERCALL_BUFFER_SHADOW(_type, _name, _hbuf)   \
+    _type *_name = _hbuf->hbuf;                                \
+    xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(_name) = { \
+        .hbuf = (void *)-1,                                    \
+        .param_shadow = _hbuf,                                 \
+        HYPERCALL_BUFFER_INIT_NO_BOUNCE                        \
+    }
+
+/*
  * Declare the necessary data structure to allow a hypercall buffer
  * passed as an argument to a function to be used in the normal way.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUCy-000257-KL; Thu, 19 Jun 2014 04:44:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCx-00024p-9D
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:19 +0000
Received: from [85.158.143.35:23922] by server-2.bemta-4.messagelabs.com id
	6F/81-06539-2AA62A35; Thu, 19 Jun 2014 04:44:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403153057!12383217!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8212 invoked from network); 19 Jun 2014 04:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCu-0002b1-Vg
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUCu-0007uU-Tn
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:16 +0000
Date: Thu, 19 Jun 2014 04:44:16 +0000
Message-Id: <E1WxUCu-0007uU-Tn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: add
	DECLARE_HYPERCALL_BUFFER_SHADOW()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 60572c972b8dbfbfff91c3bf0773838381c5a8c4
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Mon Jun 9 16:41:10 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:47:31 2014 +0100

    tools/libxc: add DECLARE_HYPERCALL_BUFFER_SHADOW()
    
    DECLARE_HYPERCALL_BUFFER_SHADOW() is like DECLARE_HYPERCALL_BUFFER()
    except it is backed by an already allocated hypercall buffer.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xenctrl.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index 400f0df..b55d857 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -266,6 +266,24 @@ typedef struct xc_hypercall_buffer xc_hypercall_buffer_t;
     }
 
 /*
+ * Like DECLARE_HYPERCALL_BUFFER() but using an already allocated
+ * hypercall buffer, _hbuf.
+ *
+ * Useful when a hypercall buffer is passed to a function and access
+ * via the user pointer is required.
+ *
+ * See DECLARE_HYPERCALL_BUFFER_ARGUMENT() if the user pointer is not
+ * required.
+ */
+#define DECLARE_HYPERCALL_BUFFER_SHADOW(_type, _name, _hbuf)   \
+    _type *_name = _hbuf->hbuf;                                \
+    xc_hypercall_buffer_t XC__HYPERCALL_BUFFER_NAME(_name) = { \
+        .hbuf = (void *)-1,                                    \
+        .param_shadow = _hbuf,                                 \
+        HYPERCALL_BUFFER_INIT_NO_BOUNCE                        \
+    }
+
+/*
  * Declare the necessary data structure to allow a hypercall buffer
  * passed as an argument to a function to be used in the normal way.
  */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxUD9-000275-Ow; Thu, 19 Jun 2014 04:44:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUD8-00026n-9m
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:30 +0000
Received: from [85.158.137.68:22024] by server-14.bemta-3.messagelabs.com id
	A3/9D-30903-DAA62A35; Thu, 19 Jun 2014 04:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1403153067!10953640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7226 invoked from network); 19 Jun 2014 04:44:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUD5-0002b7-6C
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUD5-0007vP-4T
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:27 +0000
Date: Thu, 19 Jun 2014 04:44:27 +0000
Message-Id: <E1WxUD5-0007vP-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: make
	cpupool_qualifier_to_cpupoolid a library function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a773be856b8ce55de6e4cd5aa8d69e920b4bba0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:48:36 2014 +0100

    libxl: make cpupool_qualifier_to_cpupoolid a library function
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h       |    9 ++++++++
 tools/libxl/libxl_utils.c |   31 ++++++++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    3 ++
 tools/libxl/xl_cmdimpl.c  |   49 ++++++++------------------------------------
 4 files changed, 52 insertions(+), 40 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 80947c3..a57e2fe 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -67,6 +67,15 @@
  * the same $(XEN_VERSION) (e.g. throughout a major release).
  */
 
+/* LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID
+ *
+ * If this is defined, libxl has a library function called
+ * libxl_cpupool_qualifier_to_cpupoolid, which takes in a CPU pool
+ * qualifier in the form of number or string, then returns the ID of
+ * that CPU pool.
+ */
+#define LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID 1
+
 /*
  * LIBXL_HAVE_FIRMWARE_PASSTHROUGH indicates the feature for
  * passing in SMBIOS and ACPI firmware to HVM guests is present
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 1f334f2..476921e 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -108,6 +108,37 @@ int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name,
     return rv;
 }
 
+static int qualifier_to_id(const char *p, uint32_t *id_r)
+{
+    int i, alldigit;
+
+    alldigit = 1;
+    for (i = 0; p[i]; i++) {
+        if (!isdigit((uint8_t)p[i])) {
+            alldigit = 0;
+            break;
+        }
+    }
+
+    if (i > 0 && alldigit) {
+        *id_r = strtoul(p, NULL, 10);
+        return 0;
+    } else {
+        /* check here if it's a uuid and do proper conversion */
+    }
+    return 1;
+}
+
+int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
+                                         uint32_t *poolid_r,
+                                         int *was_name_r)
+{
+    int was_name;
+
+    was_name = qualifier_to_id(p, poolid_r);
+    if (was_name_r) *was_name_r = was_name;
+    return was_name ? libxl_name_to_cpupoolid(ctx, p, poolid_r) : 0;
+}
 
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index e37fb89..8bfb81b 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -23,6 +23,9 @@ unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned
 int libxl_name_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
 int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
+int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
+                                         uint32_t *poolid_r,
+                                         int *was_name_r);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
 int libxl_cpupoolid_is_valid(libxl_ctx *ctx, uint32_t poolid);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5195914..ac3188e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -158,38 +158,6 @@ struct domain_create {
 };
 
 
-
-static int qualifier_to_id(const char *p, uint32_t *id_r)
-{
-    int i, alldigit;
-
-    alldigit = 1;
-    for (i = 0; p[i]; i++) {
-        if (!isdigit((uint8_t)p[i])) {
-            alldigit = 0;
-            break;
-        }
-    }
-
-    if (i > 0 && alldigit) {
-        *id_r = strtoul(p, NULL, 10);
-        return 0;
-    } else {
-        /* check here if it's a uuid and do proper conversion */
-    }
-    return 1;
-}
-
-static int cpupool_qualifier_to_cpupoolid(const char *p, uint32_t *poolid_r,
-                                     int *was_name_r)
-{
-    int was_name;
-
-    was_name = qualifier_to_id(p, poolid_r);
-    if (was_name_r) *was_name_r = was_name;
-    return was_name ? libxl_name_to_cpupoolid(ctx, p, poolid_r) : 0;
-}
-
 static uint32_t find_domain(const char *p) __attribute__((warn_unused_result));
 static uint32_t find_domain(const char *p)
 {
@@ -817,7 +785,7 @@ static void parse_config_data(const char *config_source,
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
-        cpupool_qualifier_to_cpupoolid(buf, &c_info->poolid, NULL);
+        libxl_cpupool_qualifier_to_cpupoolid(ctx, buf, &c_info->poolid, NULL);
     }
     if (!libxl_cpupoolid_is_valid(ctx, c_info->poolid)) {
         fprintf(stderr, "Illegal pool specified\n");
@@ -5223,7 +5191,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     int rc = 0;
 
     if (cpupool) {
-        if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
+        if (libxl_cpupool_qualifier_to_cpupoolid(ctx, cpupool, &poolid, NULL) ||
             !libxl_cpupoolid_is_valid(ctx, poolid)) {
             fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
             return -ERROR_FAIL;
@@ -5343,7 +5311,8 @@ int main_sched_credit(int argc, char **argv)
         uint32_t poolid = 0;
 
         if (cpupool) {
-            if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
+            if (libxl_cpupool_qualifier_to_cpupoolid(ctx, cpupool,
+                                                     &poolid, NULL) ||
                 !libxl_cpupoolid_is_valid(ctx, poolid)) {
                 fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
                 return -ERROR_FAIL;
@@ -6852,7 +6821,7 @@ int main_cpupooldestroy(int argc, char **argv)
 
     pool = argv[optind];
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -6874,7 +6843,7 @@ int main_cpupoolrename(int argc, char **argv)
 
     pool = argv[optind++];
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -6912,7 +6881,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
         cpu = atoi(argv[optind]);
     }
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -6957,7 +6926,7 @@ int main_cpupoolcpuremove(int argc, char **argv)
         cpu = atoi(argv[optind]);
     }
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -7001,7 +6970,7 @@ int main_cpupoolmigrate(int argc, char **argv)
         return -ERROR_FAIL;
     }
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04: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.xen.org>)
	id 1WxUD9-000275-Ow; Thu, 19 Jun 2014 04:44:31 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUD8-00026n-9m
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:30 +0000
Received: from [85.158.137.68:22024] by server-14.bemta-3.messagelabs.com id
	A3/9D-30903-DAA62A35; Thu, 19 Jun 2014 04:44:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1403153067!10953640!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7226 invoked from network); 19 Jun 2014 04:44:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUD5-0002b7-6C
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUD5-0007vP-4T
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:27 +0000
Date: Thu, 19 Jun 2014 04:44:27 +0000
Message-Id: <E1WxUD5-0007vP-4T@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: make
	cpupool_qualifier_to_cpupoolid a library function
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3a773be856b8ce55de6e4cd5aa8d69e920b4bba0
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 13:48:36 2014 +0100

    libxl: make cpupool_qualifier_to_cpupoolid a library function
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h       |    9 ++++++++
 tools/libxl/libxl_utils.c |   31 ++++++++++++++++++++++++++++
 tools/libxl/libxl_utils.h |    3 ++
 tools/libxl/xl_cmdimpl.c  |   49 ++++++++------------------------------------
 4 files changed, 52 insertions(+), 40 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 80947c3..a57e2fe 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -67,6 +67,15 @@
  * the same $(XEN_VERSION) (e.g. throughout a major release).
  */
 
+/* LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID
+ *
+ * If this is defined, libxl has a library function called
+ * libxl_cpupool_qualifier_to_cpupoolid, which takes in a CPU pool
+ * qualifier in the form of number or string, then returns the ID of
+ * that CPU pool.
+ */
+#define LIBXL_HAVE_CPUPOOL_QUALIFIER_TO_CPUPOOLID 1
+
 /*
  * LIBXL_HAVE_FIRMWARE_PASSTHROUGH indicates the feature for
  * passing in SMBIOS and ACPI firmware to HVM guests is present
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 1f334f2..476921e 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -108,6 +108,37 @@ int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name,
     return rv;
 }
 
+static int qualifier_to_id(const char *p, uint32_t *id_r)
+{
+    int i, alldigit;
+
+    alldigit = 1;
+    for (i = 0; p[i]; i++) {
+        if (!isdigit((uint8_t)p[i])) {
+            alldigit = 0;
+            break;
+        }
+    }
+
+    if (i > 0 && alldigit) {
+        *id_r = strtoul(p, NULL, 10);
+        return 0;
+    } else {
+        /* check here if it's a uuid and do proper conversion */
+    }
+    return 1;
+}
+
+int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
+                                         uint32_t *poolid_r,
+                                         int *was_name_r)
+{
+    int was_name;
+
+    was_name = qualifier_to_id(p, poolid_r);
+    if (was_name_r) *was_name_r = was_name;
+    return was_name ? libxl_name_to_cpupoolid(ctx, p, poolid_r) : 0;
+}
 
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid)
 {
diff --git a/tools/libxl/libxl_utils.h b/tools/libxl/libxl_utils.h
index e37fb89..8bfb81b 100644
--- a/tools/libxl/libxl_utils.h
+++ b/tools/libxl/libxl_utils.h
@@ -23,6 +23,9 @@ unsigned long libxl_get_required_shadow_memory(unsigned long maxmem_kb, unsigned
 int libxl_name_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
 int libxl_domain_qualifier_to_domid(libxl_ctx *ctx, const char *name, uint32_t *domid);
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
+int libxl_cpupool_qualifier_to_cpupoolid(libxl_ctx *ctx, const char *p,
+                                         uint32_t *poolid_r,
+                                         int *was_name_r);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
 int libxl_cpupoolid_is_valid(libxl_ctx *ctx, uint32_t poolid);
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 5195914..ac3188e 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -158,38 +158,6 @@ struct domain_create {
 };
 
 
-
-static int qualifier_to_id(const char *p, uint32_t *id_r)
-{
-    int i, alldigit;
-
-    alldigit = 1;
-    for (i = 0; p[i]; i++) {
-        if (!isdigit((uint8_t)p[i])) {
-            alldigit = 0;
-            break;
-        }
-    }
-
-    if (i > 0 && alldigit) {
-        *id_r = strtoul(p, NULL, 10);
-        return 0;
-    } else {
-        /* check here if it's a uuid and do proper conversion */
-    }
-    return 1;
-}
-
-static int cpupool_qualifier_to_cpupoolid(const char *p, uint32_t *poolid_r,
-                                     int *was_name_r)
-{
-    int was_name;
-
-    was_name = qualifier_to_id(p, poolid_r);
-    if (was_name_r) *was_name_r = was_name;
-    return was_name ? libxl_name_to_cpupoolid(ctx, p, poolid_r) : 0;
-}
-
 static uint32_t find_domain(const char *p) __attribute__((warn_unused_result));
 static uint32_t find_domain(const char *p)
 {
@@ -817,7 +785,7 @@ static void parse_config_data(const char *config_source,
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
-        cpupool_qualifier_to_cpupoolid(buf, &c_info->poolid, NULL);
+        libxl_cpupool_qualifier_to_cpupoolid(ctx, buf, &c_info->poolid, NULL);
     }
     if (!libxl_cpupoolid_is_valid(ctx, c_info->poolid)) {
         fprintf(stderr, "Illegal pool specified\n");
@@ -5223,7 +5191,7 @@ static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
     int rc = 0;
 
     if (cpupool) {
-        if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
+        if (libxl_cpupool_qualifier_to_cpupoolid(ctx, cpupool, &poolid, NULL) ||
             !libxl_cpupoolid_is_valid(ctx, poolid)) {
             fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
             return -ERROR_FAIL;
@@ -5343,7 +5311,8 @@ int main_sched_credit(int argc, char **argv)
         uint32_t poolid = 0;
 
         if (cpupool) {
-            if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
+            if (libxl_cpupool_qualifier_to_cpupoolid(ctx, cpupool,
+                                                     &poolid, NULL) ||
                 !libxl_cpupoolid_is_valid(ctx, poolid)) {
                 fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
                 return -ERROR_FAIL;
@@ -6852,7 +6821,7 @@ int main_cpupooldestroy(int argc, char **argv)
 
     pool = argv[optind];
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -6874,7 +6843,7 @@ int main_cpupoolrename(int argc, char **argv)
 
     pool = argv[optind++];
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -6912,7 +6881,7 @@ int main_cpupoolcpuadd(int argc, char **argv)
         cpu = atoi(argv[optind]);
     }
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -6957,7 +6926,7 @@ int main_cpupoolcpuremove(int argc, char **argv)
         cpu = atoi(argv[optind]);
     }
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
@@ -7001,7 +6970,7 @@ int main_cpupoolmigrate(int argc, char **argv)
         return -ERROR_FAIL;
     }
 
-    if (cpupool_qualifier_to_cpupoolid(pool, &poolid, NULL) ||
+    if (libxl_cpupool_qualifier_to_cpupoolid(ctx, pool, &poolid, NULL) ||
         !libxl_cpupoolid_is_valid(ctx, poolid)) {
         fprintf(stderr, "unknown cpupool \'%s\'\n", pool);
         return -ERROR_FAIL;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDJ-00028M-Rd; Thu, 19 Jun 2014 04:44:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDH-000287-UR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:40 +0000
Received: from [85.158.139.211:46294] by server-3.bemta-5.messagelabs.com id
	F6/FF-01676-7BA62A35; Thu, 19 Jun 2014 04:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1403153077!10762330!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=3.0 required=7.0 tests=ML_RADAR_551,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7048 invoked from network); 19 Jun 2014 04:44:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDF-0002bD-By
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDF-0007vs-AJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:37 +0000
Date: Thu, 19 Jun 2014 04:44:37 +0000
Message-Id: <E1WxUDF-0007vs-AJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: remove parsing of "vncviewer"
	option in xl domain config file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c28219f035562866934cdf6d39deac565553d6c2
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:16 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:05:23 2014 +0100

    xl: remove parsing of "vncviewer" option in xl domain config file
    
    Print out a warning and suggest user use "-V" option when invoking "xl
    create". Also remove that option in manpage. This will introduce a
    minor functional regression but it's very easy to work around.
    
    The rationale behind this change is that, this option is actually not
    part of domain configuration. It just affects whether a vncviewer
    should be automatically spawn, but has nothing to do with how a domain
    should be constructed. And this option is also bogus, considering if you
    migrate a domain to a remote host and the receiver spawns a vncviewer on
    the receiving side then it either dies silently or occupies resource.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5    |    4 ----
 tools/libxl/xl_cmdimpl.c |   21 ++++++++-------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a94d037..c087cbc 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1114,10 +1114,6 @@ The default is cirrus.
 Allow access to the display via the VNC protocol.  This enables the
 other VNC-related settings.  The default is to enable this.
 
-=item B<vncviewer=BOOLEAN>
-
-Automatically spawn a vncviewer when creating/restoring a guest.
-
 =item B<vnclisten="ADDRESS[:DISPLAYNUM]">
 
 Specifies the IP address, and optionally VNC display number, to use.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ac3188e..64a1c77 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -696,9 +696,7 @@ static void parse_top_level_sdl_options(XLU_Config *config,
 static void parse_config_data(const char *config_source,
                               const char *config_data,
                               int config_len,
-                              libxl_domain_config *d_config,
-                              struct domain_create *dom_info)
-
+                              libxl_domain_config *d_config)
 {
     const char *buf;
     long l;
@@ -956,12 +954,9 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long(config, "rtc_timeoffset", &l, 0))
         b_info->rtc_timeoffset = l;
 
-    if (dom_info && !xlu_cfg_get_long(config, "vncviewer", &l, 0)) {
-        /* Command line arguments must take precedence over what's
-         * specified in the configuration file. */
-        if (!dom_info->vnc)
-            dom_info->vnc = l;
-    }
+    if (!xlu_cfg_get_long(config, "vncviewer", &l, 0))
+        fprintf(stderr, "WARNING: ignoring \"vncviewer\" option. "
+                "Use \"-V\" option of \"xl create\" to automatically spawn vncviewer.\n");
 
     xlu_cfg_get_defbool(config, "localtime", &b_info->localtime, 0);
 
@@ -2154,7 +2149,7 @@ static uint32_t create_domain(struct domain_create *dom_info)
     if (!dom_info->quiet)
         printf("Parsing config from %s\n", config_source);
 
-    parse_config_data(config_source, config_data, config_len, &d_config, dom_info);
+    parse_config_data(config_source, config_data, config_len, &d_config);
 
     if (migrate_fd >= 0) {
         if (d_config.c_info.name) {
@@ -2356,7 +2351,7 @@ start:
                 libxl_domain_config_dispose(&d_config);
                 libxl_domain_config_init(&d_config);
                 parse_config_data(config_source, config_data, config_len,
-                                  &d_config, dom_info);
+                                  &d_config);
 
                 /*
                  * XXX FIXME: If this sleep is not there then domain
@@ -3167,7 +3162,7 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
             continue;
         CHK_SYSCALL(asprintf(&config_source, "<domid %d data>", info[i].domid));
         libxl_domain_config_init(&d_config);
-        parse_config_data(config_source, (char *)data, len, &d_config, NULL);
+        parse_config_data(config_source, (char *)data, len, &d_config);
         if (default_output_format == OUTPUT_FORMAT_JSON)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
         else
@@ -4475,7 +4470,7 @@ int main_config_update(int argc, char **argv)
 
     libxl_domain_config_init(&d_config);
 
-    parse_config_data(filename, config_data, config_len, &d_config, NULL);
+    parse_config_data(filename, config_data, config_len, &d_config);
 
     if (debug || dryrun_only)
         printf_info(default_output_format, -1, &d_config);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDJ-00028M-Rd; Thu, 19 Jun 2014 04:44:41 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDH-000287-UR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:40 +0000
Received: from [85.158.139.211:46294] by server-3.bemta-5.messagelabs.com id
	F6/FF-01676-7BA62A35; Thu, 19 Jun 2014 04:44:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1403153077!10762330!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=3.0 required=7.0 tests=ML_RADAR_551,spamassassin: 
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7048 invoked from network); 19 Jun 2014 04:44:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDF-0002bD-By
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDF-0007vs-AJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:37 +0000
Date: Thu, 19 Jun 2014 04:44:37 +0000
Message-Id: <E1WxUDF-0007vs-AJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl: remove parsing of "vncviewer"
	option in xl domain config file
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c28219f035562866934cdf6d39deac565553d6c2
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:16 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:05:23 2014 +0100

    xl: remove parsing of "vncviewer" option in xl domain config file
    
    Print out a warning and suggest user use "-V" option when invoking "xl
    create". Also remove that option in manpage. This will introduce a
    minor functional regression but it's very easy to work around.
    
    The rationale behind this change is that, this option is actually not
    part of domain configuration. It just affects whether a vncviewer
    should be automatically spawn, but has nothing to do with how a domain
    should be constructed. And this option is also bogus, considering if you
    migrate a domain to a remote host and the receiver spawns a vncviewer on
    the receiving side then it either dies silently or occupies resource.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 docs/man/xl.cfg.pod.5    |    4 ----
 tools/libxl/xl_cmdimpl.c |   21 ++++++++-------------
 2 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5
index a94d037..c087cbc 100644
--- a/docs/man/xl.cfg.pod.5
+++ b/docs/man/xl.cfg.pod.5
@@ -1114,10 +1114,6 @@ The default is cirrus.
 Allow access to the display via the VNC protocol.  This enables the
 other VNC-related settings.  The default is to enable this.
 
-=item B<vncviewer=BOOLEAN>
-
-Automatically spawn a vncviewer when creating/restoring a guest.
-
 =item B<vnclisten="ADDRESS[:DISPLAYNUM]">
 
 Specifies the IP address, and optionally VNC display number, to use.
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index ac3188e..64a1c77 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -696,9 +696,7 @@ static void parse_top_level_sdl_options(XLU_Config *config,
 static void parse_config_data(const char *config_source,
                               const char *config_data,
                               int config_len,
-                              libxl_domain_config *d_config,
-                              struct domain_create *dom_info)
-
+                              libxl_domain_config *d_config)
 {
     const char *buf;
     long l;
@@ -956,12 +954,9 @@ static void parse_config_data(const char *config_source,
     if (!xlu_cfg_get_long(config, "rtc_timeoffset", &l, 0))
         b_info->rtc_timeoffset = l;
 
-    if (dom_info && !xlu_cfg_get_long(config, "vncviewer", &l, 0)) {
-        /* Command line arguments must take precedence over what's
-         * specified in the configuration file. */
-        if (!dom_info->vnc)
-            dom_info->vnc = l;
-    }
+    if (!xlu_cfg_get_long(config, "vncviewer", &l, 0))
+        fprintf(stderr, "WARNING: ignoring \"vncviewer\" option. "
+                "Use \"-V\" option of \"xl create\" to automatically spawn vncviewer.\n");
 
     xlu_cfg_get_defbool(config, "localtime", &b_info->localtime, 0);
 
@@ -2154,7 +2149,7 @@ static uint32_t create_domain(struct domain_create *dom_info)
     if (!dom_info->quiet)
         printf("Parsing config from %s\n", config_source);
 
-    parse_config_data(config_source, config_data, config_len, &d_config, dom_info);
+    parse_config_data(config_source, config_data, config_len, &d_config);
 
     if (migrate_fd >= 0) {
         if (d_config.c_info.name) {
@@ -2356,7 +2351,7 @@ start:
                 libxl_domain_config_dispose(&d_config);
                 libxl_domain_config_init(&d_config);
                 parse_config_data(config_source, config_data, config_len,
-                                  &d_config, dom_info);
+                                  &d_config);
 
                 /*
                  * XXX FIXME: If this sleep is not there then domain
@@ -3167,7 +3162,7 @@ static void list_domains_details(const libxl_dominfo *info, int nb_domain)
             continue;
         CHK_SYSCALL(asprintf(&config_source, "<domid %d data>", info[i].domid));
         libxl_domain_config_init(&d_config);
-        parse_config_data(config_source, (char *)data, len, &d_config, NULL);
+        parse_config_data(config_source, (char *)data, len, &d_config);
         if (default_output_format == OUTPUT_FORMAT_JSON)
             s = printf_info_one_json(hand, info[i].domid, &d_config);
         else
@@ -4475,7 +4470,7 @@ int main_config_update(int argc, char **argv)
 
     libxl_domain_config_init(&d_config);
 
-    parse_config_data(filename, config_data, config_len, &d_config, NULL);
+    parse_config_data(filename, config_data, config_len, &d_config);
 
     if (debug || dryrun_only)
         printf_info(default_output_format, -1, &d_config);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDS-00029i-US; Thu, 19 Jun 2014 04:44:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDR-00029V-Qw
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:49 +0000
Received: from [85.158.139.211:28952] by server-16.bemta-5.messagelabs.com id
	BE/E1-18862-1CA62A35; Thu, 19 Jun 2014 04:44:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403153087!10756434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31726 invoked from network); 19 Jun 2014 04:44:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44: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 1WxUDP-0002bJ-I4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDP-0007wE-Fx
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:47 +0000
Date: Thu, 19 Jun 2014 04:44:47 +0000
Message-Id: <E1WxUDP-0007wE-Fx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix JSON generator for uint64_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43ea78f03d2b30119bec6d65aeb58a31f9c3ed9c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:17 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:06:49 2014 +0100

    libxl: fix JSON generator for uint64_t
    
    yajl_gen_integer cannot cope with uint64_t, because it takes a signed
    long long. If we pass to it an uint64_t number which is between INT_MAX
    and UINT_MAX, it generates a negative number. Later when we feed this
    generated number into parser, the result gets signed extended, which is
    wrong.
    
    A new function called libxl__uint64_gen_json is introduced to handle
    uint64_t. It utilises yajl_gen_number to generate numbers.
    
    Also removed a duplicated definition of MemKB while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/idl.py          |    2 +-
 tools/libxl/libxl_json.c    |   21 +++++++++++++++++++++
 tools/libxl/libxl_json.h    |    1 +
 tools/libxl/libxl_types.idl |    4 +---
 4 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
index e4dc79b..69e08e1 100644
--- a/tools/libxl/idl.py
+++ b/tools/libxl/idl.py
@@ -266,7 +266,7 @@ integer = Number("int", namespace = None, signed = True)
 uint8 = UInt(8)
 uint16 = UInt(16)
 uint32 = UInt(32)
-uint64 = UInt(64)
+uint64 = UInt(64, json_fn = "libxl__uint64_gen_json")
 
 string = Builtin("char *", namespace = None, dispose_fn = "free",
                  json_fn = "libxl__string_gen_json",
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index ab964ab..30cfd20 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -781,6 +781,27 @@ out:
     return ret;
 }
 
+yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val)
+{
+    char *num;
+    unsigned int len;
+    yajl_gen_status s;
+
+
+    len = asprintf(&num, "%"PRIu64, val);
+    if (len == -1) {
+        s = yajl_gen_in_error_state;
+        goto out;
+    }
+
+    s = yajl_gen_number(hand, num, len);
+
+    free(num);
+
+out:
+    return s;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index a4dd8fc..a45d429 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -22,6 +22,7 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
 yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 52f1aa9..d795510 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -22,7 +22,7 @@ libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 # Specific integer types
 #
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_fn = "libxl__uint64_gen_json")
 
 #
 # Constants / Enumerations
@@ -284,8 +284,6 @@ libxl_domain_restore_params = Struct("domain_restore_params", [
     ("checkpointed_stream", integer),
     ])
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
-
 libxl_domain_sched_params = Struct("domain_sched_params",[
     ("sched",        libxl_scheduler),
     ("weight",       integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT'}),
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDS-00029i-US; Thu, 19 Jun 2014 04:44:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDR-00029V-Qw
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:49 +0000
Received: from [85.158.139.211:28952] by server-16.bemta-5.messagelabs.com id
	BE/E1-18862-1CA62A35; Thu, 19 Jun 2014 04:44:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403153087!10756434!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31726 invoked from network); 19 Jun 2014 04:44:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:44: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 1WxUDP-0002bJ-I4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDP-0007wE-Fx
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:47 +0000
Date: Thu, 19 Jun 2014 04:44:47 +0000
Message-Id: <E1WxUDP-0007wE-Fx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: fix JSON generator for uint64_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 43ea78f03d2b30119bec6d65aeb58a31f9c3ed9c
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:17 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:06:49 2014 +0100

    libxl: fix JSON generator for uint64_t
    
    yajl_gen_integer cannot cope with uint64_t, because it takes a signed
    long long. If we pass to it an uint64_t number which is between INT_MAX
    and UINT_MAX, it generates a negative number. Later when we feed this
    generated number into parser, the result gets signed extended, which is
    wrong.
    
    A new function called libxl__uint64_gen_json is introduced to handle
    uint64_t. It utilises yajl_gen_number to generate numbers.
    
    Also removed a duplicated definition of MemKB while I was there.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/idl.py          |    2 +-
 tools/libxl/libxl_json.c    |   21 +++++++++++++++++++++
 tools/libxl/libxl_json.h    |    1 +
 tools/libxl/libxl_types.idl |    4 +---
 4 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
index e4dc79b..69e08e1 100644
--- a/tools/libxl/idl.py
+++ b/tools/libxl/idl.py
@@ -266,7 +266,7 @@ integer = Number("int", namespace = None, signed = True)
 uint8 = UInt(8)
 uint16 = UInt(16)
 uint32 = UInt(32)
-uint64 = UInt(64)
+uint64 = UInt(64, json_fn = "libxl__uint64_gen_json")
 
 string = Builtin("char *", namespace = None, dispose_fn = "free",
                  json_fn = "libxl__string_gen_json",
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index ab964ab..30cfd20 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -781,6 +781,27 @@ out:
     return ret;
 }
 
+yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val)
+{
+    char *num;
+    unsigned int len;
+    yajl_gen_status s;
+
+
+    len = asprintf(&num, "%"PRIu64, val);
+    if (len == -1) {
+        s = yajl_gen_in_error_state;
+        goto out;
+    }
+
+    s = yajl_gen_number(hand, num, len);
+
+    free(num);
+
+out:
+    return s;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index a4dd8fc..a45d429 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -22,6 +22,7 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
 yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 52f1aa9..d795510 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -22,7 +22,7 @@ libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 # Specific integer types
 #
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_fn = "libxl__uint64_gen_json")
 
 #
 # Constants / Enumerations
@@ -284,8 +284,6 @@ libxl_domain_restore_params = Struct("domain_restore_params", [
     ("checkpointed_stream", integer),
     ])
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
-
 libxl_domain_sched_params = Struct("domain_sched_params",[
     ("sched",        libxl_scheduler),
     ("weight",       integer, {'init_val': 'LIBXL_DOMAIN_SCHED_PARAM_WEIGHT_DEFAULT'}),
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDq-0002Cf-1j; Thu, 19 Jun 2014 04:45:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDo-0002CX-Dv
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:12 +0000
Received: from [193.109.254.147:57893] by server-16.bemta-14.messagelabs.com
	id A6/2A-16986-7DA62A35; Thu, 19 Jun 2014 04:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403153109!7610192!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19024 invoked from network); 19 Jun 2014 04:45: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;
	19 Jun 2014 04:45:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDk-0002cN-05
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDj-0007xH-S1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:07 +0000
Date: Thu, 19 Jun 2014 04:45:07 +0000
Message-Id: <E1WxUDj-0007xH-S1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_json: introduce
	libxl__object_from_json
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 185123b72e122708d54451347ebcb6f83988014e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:19 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:07:31 2014 +0100

    libxl_json: introduce libxl__object_from_json
    
    Given a JSON string, we need to convert it to libxl_FOO struct.
    
    The approach is:
    JSON string -> libxl__json_object -> libxl_FOO struct
    
    With this approach we can make use of libxl's infrastructure to do the
    first half (JSON string -> libxl__json_object).
    
    Second half is done by auto-generated code by libxl's IDL
    infrastructure. IDL patch(es) will come later.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    8 ++++++++
 tools/libxl/libxl_json.c     |   30 ++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5968485..80ea883 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1640,6 +1640,14 @@ typedef struct libxl__json_object {
     struct libxl__json_object *parent;
 } libxl__json_object;
 
+typedef int (*libxl__json_parse_callback)(libxl__gc *gc,
+                                          libxl__json_object *o,
+                                          void *p);
+_hidden int libxl__object_from_json(libxl_ctx *ctx, const char *type,
+                                    libxl__json_parse_callback parse,
+                                    void *p,
+                                    const char *s);
+
 typedef struct {
     char *map_key;
     libxl__json_object *obj;
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 30cfd20..8440498 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -802,6 +802,36 @@ out:
     return s;
 }
 
+int libxl__object_from_json(libxl_ctx *ctx, const char *type,
+                            libxl__json_parse_callback parse,
+                            void *p, const char *s)
+{
+    GC_INIT(ctx);
+    libxl__json_object *o;
+    int rc;
+
+    o = libxl__json_parse(gc, s);
+    if (!o) {
+        LOG(ERROR,
+            "unable to generate libxl__json_object from JSON representation of %s.",
+            type);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = parse(gc, o, p);
+    if (rc) {
+        LOG(ERROR, "unable to convert libxl__json_object to %s. (rc=%d)", type, rc);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = 0;
+out:
+    GC_FREE;
+    return rc;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDq-0002Cf-1j; Thu, 19 Jun 2014 04:45:14 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDo-0002CX-Dv
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:12 +0000
Received: from [193.109.254.147:57893] by server-16.bemta-14.messagelabs.com
	id A6/2A-16986-7DA62A35; Thu, 19 Jun 2014 04:45:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403153109!7610192!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19024 invoked from network); 19 Jun 2014 04:45: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;
	19 Jun 2014 04:45:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDk-0002cN-05
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDj-0007xH-S1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:07 +0000
Date: Thu, 19 Jun 2014 04:45:07 +0000
Message-Id: <E1WxUDj-0007xH-S1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_json: introduce
	libxl__object_from_json
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 185123b72e122708d54451347ebcb6f83988014e
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:19 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:07:31 2014 +0100

    libxl_json: introduce libxl__object_from_json
    
    Given a JSON string, we need to convert it to libxl_FOO struct.
    
    The approach is:
    JSON string -> libxl__json_object -> libxl_FOO struct
    
    With this approach we can make use of libxl's infrastructure to do the
    first half (JSON string -> libxl__json_object).
    
    Second half is done by auto-generated code by libxl's IDL
    infrastructure. IDL patch(es) will come later.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |    8 ++++++++
 tools/libxl/libxl_json.c     |   30 ++++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 5968485..80ea883 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1640,6 +1640,14 @@ typedef struct libxl__json_object {
     struct libxl__json_object *parent;
 } libxl__json_object;
 
+typedef int (*libxl__json_parse_callback)(libxl__gc *gc,
+                                          libxl__json_object *o,
+                                          void *p);
+_hidden int libxl__object_from_json(libxl_ctx *ctx, const char *type,
+                                    libxl__json_parse_callback parse,
+                                    void *p,
+                                    const char *s);
+
 typedef struct {
     char *map_key;
     libxl__json_object *obj;
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 30cfd20..8440498 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -802,6 +802,36 @@ out:
     return s;
 }
 
+int libxl__object_from_json(libxl_ctx *ctx, const char *type,
+                            libxl__json_parse_callback parse,
+                            void *p, const char *s)
+{
+    GC_INIT(ctx);
+    libxl__json_object *o;
+    int rc;
+
+    o = libxl__json_parse(gc, s);
+    if (!o) {
+        LOG(ERROR,
+            "unable to generate libxl__json_object from JSON representation of %s.",
+            type);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = parse(gc, o, p);
+    if (rc) {
+        LOG(ERROR, "unable to convert libxl__json_object to %s. (rc=%d)", type, rc);
+        rc = ERROR_FAIL;
+        goto out;
+    }
+
+    rc = 0;
+out:
+    GC_FREE;
+    return rc;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDv-0002DU-5J; Thu, 19 Jun 2014 04:45:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDt-0002DI-GP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:17 +0000
Received: from [85.158.143.35:14658] by server-3.bemta-4.messagelabs.com id
	1C/9F-16194-CDA62A35; Thu, 19 Jun 2014 04:45:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1403153097!12319426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21526 invoked from network); 19 Jun 2014 04:44:58 -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;
	19 Jun 2014 04:44:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDZ-0002bP-Ny
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDZ-0007wd-Mi
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:57 +0000
Date: Thu, 19 Jun 2014 04:44:57 +0000
Message-Id: <E1WxUDZ-0007wd-Mi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl IDL: rename json_fn to
	json_gen_fn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0382ef6596ad05586df9c721df4c5a3fab4f5567
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:07:31 2014 +0100

    libxl IDL: rename json_fn to json_gen_fn
    
    This json_fn is in fact used to generate string representation of a json
    data structure. We will introduce another json function to parse json
    data structure in later changeset, so rename json_fn to json_gen_fn to
    clarify.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/gentest.py               |    4 ++--
 tools/libxl/gentypes.py              |   12 ++++++------
 tools/libxl/idl.py                   |   12 ++++++------
 tools/libxl/idl.txt                  |    4 ++--
 tools/libxl/libxl_types.idl          |    6 +++---
 tools/libxl/libxl_types_internal.idl |    2 +-
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
index 722b7f4..eb9a21b 100644
--- a/tools/libxl/gentest.py
+++ b/tools/libxl/gentest.py
@@ -52,7 +52,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Struct) \
-     and (parent is None or ty.json_fn is None):
+     and (parent is None or ty.json_gen_fn is None):
         for f in [f for f in ty.fields if not f.const]:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += gen_rand_init(f.type, fexpr, "", nparent)
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
     f.write("    printf(\"Testing TYPE_to_json()\\n\");\n")
     f.write("    printf(\"----------------------\\n\");\n")
     f.write("    printf(\"\\n\");\n")
-    for ty in [t for t in types if t.json_fn is not None]:
+    for ty in [t for t in types if t.json_gen_fn is not None]:
         arg = ty.typename + "_val"
         f.write("    %s_rand_init(%s);\n" % (ty.typename, \
             ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index 917e2c2..61a2b3d 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -229,7 +229,7 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
                 s += "        goto out;\n"
             s += "    break;\n"
         s += "}\n"
-    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_fn is None):
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_gen_fn is None):
         s += "s = yajl_gen_map_open(hand);\n"
         s += "if (s != yajl_gen_status_ok)\n"
         s += "    goto out;\n"
@@ -243,8 +243,8 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s += "if (s != yajl_gen_status_ok)\n"
         s += "    goto out;\n"
     else:
-        if ty.json_fn is not None:
-            s += "s = %s(hand, %s);\n" % (ty.json_fn, ty.pass_arg(v, parent is None))
+        if ty.json_gen_fn is not None:
+            s += "s = %s(hand, %s);\n" % (ty.json_gen_fn, ty.pass_arg(v, parent is None))
             s += "if (s != yajl_gen_status_ok)\n"
             s += "    goto out;\n"
 
@@ -341,7 +341,7 @@ if __name__ == '__main__':
                 f.write("%svoid %s(%s, %s);\n" % (ty.hidden(), ty.init_fn + "_" + ku.keyvar.name,
                                                ty.make_arg("p"),
                                                ku.keyvar.type.make_arg(ku.keyvar.name)))
-        if ty.json_fn is not None:
+        if ty.json_gen_fn is not None:
             f.write("%schar *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
         if isinstance(ty, idl.Enumeration):
             f.write("%sconst char *%s_to_string(%s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
@@ -369,7 +369,7 @@ if __name__ == '__main__':
 
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
-    for ty in [ty for ty in types if ty.json_fn is not None]:
+    for ty in [ty for ty in types if ty.json_gen_fn is not None]:
         f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
@@ -426,7 +426,7 @@ if __name__ == '__main__':
         f.write("}\n")
         f.write("\n")
 
-    for ty in [t for t in types if t.json_fn is not None]:
+    for ty in [t for t in types if t.json_gen_fn is not None]:
         f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
         f.write("{\n")
         f.write(libxl_C_type_gen_json(ty, "p"))
diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
index 69e08e1..8b118dd 100644
--- a/tools/libxl/idl.py
+++ b/tools/libxl/idl.py
@@ -65,9 +65,9 @@ class Type(object):
         self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
 
         if self.typename is not None and not self.private:
-            self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', self.typename + "_gen_json")
         else:
-            self.json_fn = kwargs.setdefault('json_fn', None)
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', None)
 
         self.autogenerate_json = kwargs.setdefault('autogenerate_json', True)
 
@@ -118,7 +118,7 @@ class Number(Builtin):
         kwargs.setdefault('namespace', None)
         kwargs.setdefault('dispose_fn', None)
         kwargs.setdefault('signed', False)
-        kwargs.setdefault('json_fn', "yajl_gen_integer")
+        kwargs.setdefault('json_gen_fn', "yajl_gen_integer")
         self.signed = kwargs['signed']
         Builtin.__init__(self, ctype, **kwargs)
 
@@ -256,7 +256,7 @@ class KeyedUnion(Aggregate):
 
 void = Builtin("void *", namespace = None)
 bool = Builtin("bool", namespace = None,
-               json_fn = "yajl_gen_bool",
+               json_gen_fn = "yajl_gen_bool",
                autogenerate_json = False)
 
 size_t = Number("size_t", namespace = None)
@@ -266,10 +266,10 @@ integer = Number("int", namespace = None, signed = True)
 uint8 = UInt(8)
 uint16 = UInt(16)
 uint32 = UInt(32)
-uint64 = UInt(64, json_fn = "libxl__uint64_gen_json")
+uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json")
 
 string = Builtin("char *", namespace = None, dispose_fn = "free",
-                 json_fn = "libxl__string_gen_json",
+                 json_gen_fn = "libxl__string_gen_json",
                  autogenerate_json = False)
 
 class Array(Type):
diff --git a/tools/libxl/idl.txt b/tools/libxl/idl.txt
index 439aede..6a53dd8 100644
--- a/tools/libxl/idl.txt
+++ b/tools/libxl/idl.txt
@@ -60,14 +60,14 @@ Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
  Indicates if the above named Type.init_fn should be
  autogenerated.
 
-Type.json_fn: (default: typename + "_gen_json" or None if type == None)
+Type.json_gen_fn: (default: typename + "_gen_json" or None if type == None)
 
  The name of the C function which will generate a YAJL data structure
  representing this type.
 
 Type.autogenerate_json: (default: True)
 
- Indicates if the above named Type.json_fn should be autogenerated.
+ Indicates if the above named Type.json_gen_fn should be autogenerated.
 
 Other simple type-Classes
 -------------------------
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index d795510..f0f6e34 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -7,8 +7,8 @@ namespace("libxl_")
 
 libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
 
-libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
-libxl_devid = Builtin("devid", json_fn = "yajl_gen_integer", autogenerate_json = False, signed = True, init_val="-1")
+libxl_domid = Builtin("domid", json_gen_fn = "yajl_gen_integer", autogenerate_json = False)
+libxl_devid = Builtin("devid", json_gen_fn = "yajl_gen_integer", autogenerate_json = False, signed = True, init_val="-1")
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
 libxl_bitmap = Builtin("bitmap", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE)
@@ -22,7 +22,7 @@ libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 # Specific integer types
 #
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_fn = "libxl__uint64_gen_json")
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_gen_fn = "libxl__uint64_gen_json")
 
 #
 # Constants / Enumerations
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index cb9444f..a964851 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -1,7 +1,7 @@
 namespace("libxl__")
 hidden(True)
 
-libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+libxl_domid = Builtin("domid", namespace="libxl_", json_gen_fn = "yajl_gen_integer")
 
 libxl__qmp_message_type = Enumeration("qmp_message_type", [
     (1, "QMP"),
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUDv-0002DU-5J; Thu, 19 Jun 2014 04:45:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDt-0002DI-GP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:17 +0000
Received: from [85.158.143.35:14658] by server-3.bemta-4.messagelabs.com id
	1C/9F-16194-CDA62A35; Thu, 19 Jun 2014 04:45:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1403153097!12319426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21526 invoked from network); 19 Jun 2014 04:44:58 -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;
	19 Jun 2014 04:44:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDZ-0002bP-Ny
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDZ-0007wd-Mi
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:44:57 +0000
Date: Thu, 19 Jun 2014 04:44:57 +0000
Message-Id: <E1WxUDZ-0007wd-Mi@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl IDL: rename json_fn to
	json_gen_fn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0382ef6596ad05586df9c721df4c5a3fab4f5567
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:07:31 2014 +0100

    libxl IDL: rename json_fn to json_gen_fn
    
    This json_fn is in fact used to generate string representation of a json
    data structure. We will introduce another json function to parse json
    data structure in later changeset, so rename json_fn to json_gen_fn to
    clarify.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/gentest.py               |    4 ++--
 tools/libxl/gentypes.py              |   12 ++++++------
 tools/libxl/idl.py                   |   12 ++++++------
 tools/libxl/idl.txt                  |    4 ++--
 tools/libxl/libxl_types.idl          |    6 +++---
 tools/libxl/libxl_types_internal.idl |    2 +-
 6 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/tools/libxl/gentest.py b/tools/libxl/gentest.py
index 722b7f4..eb9a21b 100644
--- a/tools/libxl/gentest.py
+++ b/tools/libxl/gentest.py
@@ -52,7 +52,7 @@ def gen_rand_init(ty, v, indent = "    ", parent = None):
             s += "    break;\n"
         s += "}\n"
     elif isinstance(ty, idl.Struct) \
-     and (parent is None or ty.json_fn is None):
+     and (parent is None or ty.json_gen_fn is None):
         for f in [f for f in ty.fields if not f.const]:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += gen_rand_init(f.type, fexpr, "", nparent)
@@ -243,7 +243,7 @@ int main(int argc, char **argv)
     f.write("    printf(\"Testing TYPE_to_json()\\n\");\n")
     f.write("    printf(\"----------------------\\n\");\n")
     f.write("    printf(\"\\n\");\n")
-    for ty in [t for t in types if t.json_fn is not None]:
+    for ty in [t for t in types if t.json_gen_fn is not None]:
         arg = ty.typename + "_val"
         f.write("    %s_rand_init(%s);\n" % (ty.typename, \
             ty.pass_arg(arg, isref=False, passby=idl.PASS_BY_REFERENCE)))
diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index 917e2c2..61a2b3d 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -229,7 +229,7 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
                 s += "        goto out;\n"
             s += "    break;\n"
         s += "}\n"
-    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_fn is None):
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.json_gen_fn is None):
         s += "s = yajl_gen_map_open(hand);\n"
         s += "if (s != yajl_gen_status_ok)\n"
         s += "    goto out;\n"
@@ -243,8 +243,8 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s += "if (s != yajl_gen_status_ok)\n"
         s += "    goto out;\n"
     else:
-        if ty.json_fn is not None:
-            s += "s = %s(hand, %s);\n" % (ty.json_fn, ty.pass_arg(v, parent is None))
+        if ty.json_gen_fn is not None:
+            s += "s = %s(hand, %s);\n" % (ty.json_gen_fn, ty.pass_arg(v, parent is None))
             s += "if (s != yajl_gen_status_ok)\n"
             s += "    goto out;\n"
 
@@ -341,7 +341,7 @@ if __name__ == '__main__':
                 f.write("%svoid %s(%s, %s);\n" % (ty.hidden(), ty.init_fn + "_" + ku.keyvar.name,
                                                ty.make_arg("p"),
                                                ku.keyvar.type.make_arg(ku.keyvar.name)))
-        if ty.json_fn is not None:
+        if ty.json_gen_fn is not None:
             f.write("%schar *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
         if isinstance(ty, idl.Enumeration):
             f.write("%sconst char *%s_to_string(%s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p")))
@@ -369,7 +369,7 @@ if __name__ == '__main__':
 
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
-    for ty in [ty for ty in types if ty.json_fn is not None]:
+    for ty in [ty for ty in types if ty.json_gen_fn is not None]:
         f.write("%syajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.hidden(), ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
@@ -426,7 +426,7 @@ if __name__ == '__main__':
         f.write("}\n")
         f.write("\n")
 
-    for ty in [t for t in types if t.json_fn is not None]:
+    for ty in [t for t in types if t.json_gen_fn is not None]:
         f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s)\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
         f.write("{\n")
         f.write(libxl_C_type_gen_json(ty, "p"))
diff --git a/tools/libxl/idl.py b/tools/libxl/idl.py
index 69e08e1..8b118dd 100644
--- a/tools/libxl/idl.py
+++ b/tools/libxl/idl.py
@@ -65,9 +65,9 @@ class Type(object):
         self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
 
         if self.typename is not None and not self.private:
-            self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', self.typename + "_gen_json")
         else:
-            self.json_fn = kwargs.setdefault('json_fn', None)
+            self.json_gen_fn = kwargs.setdefault('json_gen_fn', None)
 
         self.autogenerate_json = kwargs.setdefault('autogenerate_json', True)
 
@@ -118,7 +118,7 @@ class Number(Builtin):
         kwargs.setdefault('namespace', None)
         kwargs.setdefault('dispose_fn', None)
         kwargs.setdefault('signed', False)
-        kwargs.setdefault('json_fn', "yajl_gen_integer")
+        kwargs.setdefault('json_gen_fn', "yajl_gen_integer")
         self.signed = kwargs['signed']
         Builtin.__init__(self, ctype, **kwargs)
 
@@ -256,7 +256,7 @@ class KeyedUnion(Aggregate):
 
 void = Builtin("void *", namespace = None)
 bool = Builtin("bool", namespace = None,
-               json_fn = "yajl_gen_bool",
+               json_gen_fn = "yajl_gen_bool",
                autogenerate_json = False)
 
 size_t = Number("size_t", namespace = None)
@@ -266,10 +266,10 @@ integer = Number("int", namespace = None, signed = True)
 uint8 = UInt(8)
 uint16 = UInt(16)
 uint32 = UInt(32)
-uint64 = UInt(64, json_fn = "libxl__uint64_gen_json")
+uint64 = UInt(64, json_gen_fn = "libxl__uint64_gen_json")
 
 string = Builtin("char *", namespace = None, dispose_fn = "free",
-                 json_fn = "libxl__string_gen_json",
+                 json_gen_fn = "libxl__string_gen_json",
                  autogenerate_json = False)
 
 class Array(Type):
diff --git a/tools/libxl/idl.txt b/tools/libxl/idl.txt
index 439aede..6a53dd8 100644
--- a/tools/libxl/idl.txt
+++ b/tools/libxl/idl.txt
@@ -60,14 +60,14 @@ Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
  Indicates if the above named Type.init_fn should be
  autogenerated.
 
-Type.json_fn: (default: typename + "_gen_json" or None if type == None)
+Type.json_gen_fn: (default: typename + "_gen_json" or None if type == None)
 
  The name of the C function which will generate a YAJL data structure
  representing this type.
 
 Type.autogenerate_json: (default: True)
 
- Indicates if the above named Type.json_fn should be autogenerated.
+ Indicates if the above named Type.json_gen_fn should be autogenerated.
 
 Other simple type-Classes
 -------------------------
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index d795510..f0f6e34 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -7,8 +7,8 @@ namespace("libxl_")
 
 libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
 
-libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
-libxl_devid = Builtin("devid", json_fn = "yajl_gen_integer", autogenerate_json = False, signed = True, init_val="-1")
+libxl_domid = Builtin("domid", json_gen_fn = "yajl_gen_integer", autogenerate_json = False)
+libxl_devid = Builtin("devid", json_gen_fn = "yajl_gen_integer", autogenerate_json = False, signed = True, init_val="-1")
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
 libxl_bitmap = Builtin("bitmap", dispose_fn="libxl_bitmap_dispose", passby=PASS_BY_REFERENCE)
@@ -22,7 +22,7 @@ libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 # Specific integer types
 #
 
-MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_fn = "libxl__uint64_gen_json")
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_gen_fn = "libxl__uint64_gen_json")
 
 #
 # Constants / Enumerations
diff --git a/tools/libxl/libxl_types_internal.idl b/tools/libxl/libxl_types_internal.idl
index cb9444f..a964851 100644
--- a/tools/libxl/libxl_types_internal.idl
+++ b/tools/libxl/libxl_types_internal.idl
@@ -1,7 +1,7 @@
 namespace("libxl__")
 hidden(True)
 
-libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+libxl_domid = Builtin("domid", namespace="libxl_", json_gen_fn = "yajl_gen_integer")
 
 libxl__qmp_message_type = Enumeration("qmp_message_type", [
     (1, "QMP"),
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUE1-0002Ey-8E; Thu, 19 Jun 2014 04:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDz-0002ER-1W
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:23 +0000
Received: from [85.158.139.211:29907] by server-1.bemta-5.messagelabs.com id
	84/81-30932-2EA62A35; Thu, 19 Jun 2014 04:45:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1403153120!10808383!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10968 invoked from network); 19 Jun 2014 04:45:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:45:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDw-0002cT-05
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDv-0007yM-TD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:19 +0000
Date: Thu, 19 Jun 2014 04:45:19 +0000
Message-Id: <E1WxUDv-0007yM-TD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_json: introduce parser functions
	for builtin types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 752f181fefb740523522b5730efdef28b0ff91ff
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:20 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:07:31 2014 +0100

    libxl_json: introduce parser functions for builtin types
    
    This changeset introduces following functions:
     * libxl_defbool_parse_json
     * libxl__bool_parse_json
     * libxl_uuid_parse_json
     * libxl_mac_parse_json
     * libxl_bitmap_parse_json
     * libxl_cpuid_policy_list_parse_json
     * libxl_string_list_parse_json
     * libxl_key_value_list_parse_json
     * libxl_hwcap_parse_json
     * libxl__int_parse_json
     * libxl__uint{8,16,32,64}_parse_json
     * libxl__string_parse_json
    
    They will be used in later patch to convert the libxl__json_object
    tree of a builtin type to libxl_FOO struct.
    
    Also remove declaration of libxl_domid_gen_json as libxl_domid uses
    yajl_gen_integer to generate JSON object.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Anthony Perard <anthony.perard@citrix.com>
---
 tools/libxl/libxl_cpuid.c   |   89 ++++++++++++---
 tools/libxl/libxl_json.c    |  271 +++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_json.h    |   36 ++++++-
 tools/libxl/libxl_nocpuid.c |    7 +
 4 files changed, 386 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index 3787213..d9007b2 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -338,29 +338,29 @@ void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid,
                      (const char**)(cpuid[i].policy), cpuid_res);
 }
 
+static const char *input_names[2] = { "leaf", "subleaf" };
+static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
+/*
+ * Aiming for:
+ * [
+ *     { 'leaf':    'val-eax',
+ *       'subleaf': 'val-ecx',
+ *       'eax':     'filter',
+ *       'ebx':     'filter',
+ *       'ecx':     'filter',
+ *       'edx':     'filter' },
+ *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
+ *     ... etc ...
+ * ]
+ */
+
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     libxl_cpuid_policy_list cpuid = *pcpuid;
     yajl_gen_status s;
-    const char *input_names[2] = { "leaf", "subleaf" };
-    const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
     int i, j;
 
-    /*
-     * Aiming for:
-     * [
-     *     { 'leaf':    'val-eax',
-     *       'subleaf': 'val-ecx',
-     *       'eax':     'filter',
-     *       'ebx':     'filter',
-     *       'ecx':     'filter',
-     *       'edx':     'filter' },
-     *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
-     *     ... etc ...
-     * ]
-     */
-
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
@@ -398,6 +398,63 @@ out:
     return s;
 }
 
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p)
+{
+    int i, size;
+    libxl_cpuid_policy_list l;
+    flexarray_t *array;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(o);
+    if (!array->count)
+        return 0;
+
+    size = array->count;
+    /* need one extra slot as sentinel */
+    l = *p = libxl__calloc(NOGC, size + 1, sizeof(libxl_cpuid_policy));
+
+    l[size].input[0] = XEN_CPUID_INPUT_UNUSED;
+    l[size].input[1] = XEN_CPUID_INPUT_UNUSED;
+
+    for (i = 0; i < size; i++) {
+        const libxl__json_object *t;
+        int j;
+
+        if (flexarray_get(array, i, (void**)&t) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_map(t))
+            return ERROR_FAIL;
+
+        for (j = 0; j < ARRAY_SIZE(l[0].input); j++) {
+            const libxl__json_object *r;
+
+            r = libxl__json_map_get(input_names[j], t, JSON_INTEGER);
+            if (!r)
+                l[i].input[j] = XEN_CPUID_INPUT_UNUSED;
+            else
+                l[i].input[j] = libxl__json_object_get_integer(r);
+        }
+
+        for (j = 0; j < ARRAY_SIZE(l[0].policy); j++) {
+            const libxl__json_object *r;
+
+            r = libxl__json_map_get(policy_names[j], t, JSON_STRING);
+            if (!r)
+                l[i].policy[j] = NULL;
+            else
+                l[i].policy[j] =
+                    libxl__strdup(NOGC, libxl__json_object_get_string(r));
+        }
+    }
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 8440498..fb9baf8 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -100,6 +100,42 @@ yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
     return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
 }
 
+int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             libxl_defbool *p)
+{
+    const char *s;
+
+    if (!libxl__json_object_is_string(o))
+        return ERROR_FAIL;
+
+    s = libxl__json_object_get_string(o);
+
+    if (!strncmp(s, LIBXL__DEFBOOL_STR_DEFAULT,
+                 strlen(LIBXL__DEFBOOL_STR_DEFAULT)))
+        p->val = LIBXL__DEFBOOL_DEFAULT;
+    else if (!strncmp(s, LIBXL__DEFBOOL_STR_TRUE,
+                      strlen(LIBXL__DEFBOOL_STR_TRUE)))
+        p->val = LIBXL__DEFBOOL_TRUE;
+    else if (!strncmp(s, LIBXL__DEFBOOL_STR_FALSE,
+                      strlen(LIBXL__DEFBOOL_STR_FALSE)))
+        p->val = LIBXL__DEFBOOL_FALSE;
+    else
+        return ERROR_FAIL;
+
+    return 0;
+}
+
+int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           bool *p)
+{
+    if (!libxl__json_object_is_bool(o))
+        return ERROR_FAIL;
+
+    *p = libxl__json_object_get_bool(o);
+
+    return 0;
+}
+
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
@@ -108,6 +144,15 @@ yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_UUID_FMTLEN);
 }
 
+int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          libxl_uuid *p)
+{
+    if (!libxl__json_object_is_string(o))
+        return ERROR_FAIL;
+
+    return libxl_uuid_from_string(p, o->u.string);
+}
+
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
                                       libxl_bitmap *bitmap)
 {
@@ -128,6 +173,40 @@ out:
     return s;
 }
 
+int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            libxl_bitmap *p)
+{
+    int i;
+    int size;
+    const libxl__json_object *t;
+    flexarray_t *array;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(o);
+    if (!array->count) {
+        libxl_bitmap_init(p);
+        return 0;
+    }
+
+    t = libxl__json_array_get(o, array->count - 1);
+    if (!libxl__json_object_is_integer(t))
+        return ERROR_FAIL;
+    size = libxl__json_object_get_integer(t) + 1;
+
+    libxl_bitmap_alloc(CTX, p, size);
+
+    for (i = 0; (t = libxl__json_array_get(o, i)); i++) {
+        if (!libxl__json_object_is_integer(t))
+            return ERROR_FAIL;
+
+        libxl_bitmap_set(p, libxl__json_object_get_integer(t));
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *pkvl)
 {
@@ -155,6 +234,41 @@ out:
     return s;
 }
 
+int libxl_key_value_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                    libxl_key_value_list *p)
+{
+    libxl__json_map_node *node = NULL;
+    flexarray_t *maps = NULL;
+    int i, size;
+    libxl_key_value_list kvl;
+
+    if (!libxl__json_object_is_map(o))
+        return ERROR_FAIL;
+
+    maps = libxl__json_object_get_map(o);
+    size = maps->count * 2;
+    kvl = *p = libxl__calloc(NOGC, size, sizeof(char *));
+
+    for (i = 0; i < maps->count; i++) {
+        int idx = i * 2;
+        if (flexarray_get(maps, i, (void**)&node) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_string(node->obj) &&
+            !libxl__json_object_is_null(node->obj))
+            return ERROR_FAIL;
+
+        kvl[idx] = libxl__strdup(NOGC, node->map_key);
+        if (libxl__json_object_is_string(node->obj))
+            kvl[idx+1] =
+                libxl__strdup(NOGC, libxl__json_object_get_string(node->obj));
+        else
+            kvl[idx+1] = NULL;
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *pl)
 {
     libxl_string_list l = *pl;
@@ -176,6 +290,38 @@ out:
     return s;
 }
 
+int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                 libxl_string_list *p)
+{
+    const libxl__json_object *t;
+    libxl_string_list l;
+    flexarray_t *array = NULL;
+    int i, size;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(o);
+    size = array->count;
+
+    if (size == 0) {
+        *p = NULL;
+        return 0;
+    }
+
+    /* need one extra slot as sentinel */
+    l = *p = libxl__calloc(NOGC, size + 1, sizeof(char *));
+
+    for (i = 0; (t = libxl__json_array_get(o, i)); i++) {
+        if (!libxl__json_object_is_string(t))
+            return ERROR_FAIL;
+
+        l[i] = libxl__strdup(NOGC, libxl__json_object_get_string(t));
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *mac)
 {
     char buf[LIBXL_MAC_FMTLEN+1];
@@ -183,6 +329,15 @@ yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *mac)
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_MAC_FMTLEN);
 }
 
+int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                         libxl_mac *p)
+{
+    if (!libxl__json_object_is_string(o))
+        return ERROR_FAIL;
+
+    return libxl__parse_mac(libxl__json_object_get_string(o), *p);
+}
+
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand,
                                      libxl_hwcap *p)
 {
@@ -201,6 +356,27 @@ out:
     return s;
 }
 
+int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           libxl_hwcap *p)
+{
+    int i;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    for (i = 0; i<4; i++) {
+        const libxl__json_object *t;
+
+        t = libxl__json_array_get(o, i);
+        if (!t || !libxl__json_object_is_integer(t))
+            return ERROR_FAIL;
+
+        (*p)[i] = libxl__json_object_get_integer(t);
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl__string_gen_json(yajl_gen hand,
                                        const char *p)
 {
@@ -210,6 +386,20 @@ yajl_gen_status libxl__string_gen_json(yajl_gen hand,
         return yajl_gen_null(hand);
 }
 
+int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             char **p)
+{
+    if (!libxl__json_object_is_string(o) && !libxl__json_object_is_null(o))
+        return ERROR_FAIL;
+
+    if (libxl__json_object_is_null(o))
+        *p = NULL;
+    else
+        *p = libxl__strdup(NOGC, libxl__json_object_get_string(o));
+
+    return 0;
+}
+
 /*
  * libxl__json_object helper functions
  */
@@ -832,6 +1022,87 @@ out:
     return rc;
 }
 
+int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          void *p)
+{
+    long long i;
+
+    if (!libxl__json_object_is_integer(o))
+        return ERROR_FAIL;
+
+    i = libxl__json_object_get_integer(o);
+
+    if (i > INT_MAX || i < INT_MIN)
+        return ERROR_FAIL;
+
+    *((int *)p) = i;
+
+    return 0;
+}
+
+/* Macro to generate:
+ *  libxl__uint8_parse_json
+ *  libxl__uint16_parse_json
+ *  libxl__uint32_parse_json
+ */
+#define PARSE_UINT(width)                                               \
+    int libxl__uint ## width ## _parse_json(libxl__gc *gc,              \
+                                            const libxl__json_object *o,\
+                                            void *p)                    \
+    {                                                                   \
+        long long i;                                                    \
+                                                                        \
+        if (!libxl__json_object_is_integer(o))                          \
+            return ERROR_FAIL;                                          \
+                                                                        \
+        i = libxl__json_object_get_integer(o);                          \
+                                                                        \
+        if (i < 0 || i > UINT ## width ## _MAX)                         \
+            return ERROR_FAIL;                                          \
+                                                                        \
+        *((uint ## width ## _t *)p) = i;                                \
+                                                                        \
+        return 0;                                                       \
+    }
+
+PARSE_UINT(8);
+PARSE_UINT(16);
+PARSE_UINT(32);
+
+int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p)
+{
+    if (!libxl__json_object_is_integer(o) &&
+        !libxl__json_object_is_number(o))
+        return ERROR_FAIL;
+
+    if (libxl__json_object_is_integer(o)) {
+        long long i = libxl__json_object_get_integer(o);
+
+        if (i < 0)
+            return ERROR_FAIL;
+
+        *((uint64_t *)p) = i;
+    } else {
+        const char *s;
+        unsigned long long i;
+        int saved_errno = errno;
+
+        s = libxl__json_object_get_number(o);
+
+        errno = 0;
+        i = strtoull(s, NULL, 10);
+
+        if (i == ULLONG_MAX && errno == ERANGE)
+            return ERROR_FAIL;
+
+        errno = saved_errno;
+        *((uint64_t *)p) = i;
+    }
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index a45d429..b196c1c 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -22,18 +22,52 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+typedef struct libxl__gc libxl__gc;
+typedef struct libxl__json_object libxl__json_object;
+
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
-yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
+int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             libxl_defbool *p);
+int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           bool *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
+int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          libxl_uuid *p);
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
+int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                         libxl_mac *p);
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand, libxl_bitmap *p);
+int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            libxl_bitmap *p);
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                                  libxl_cpuid_policy_list *p);
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p);
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
+int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                 libxl_string_list *p);
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *p);
+int libxl_key_value_list_parse_json(libxl__gc *gc,
+                                    const libxl__json_object *o,
+                                    libxl_key_value_list *p);
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
+int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           libxl_hwcap *p);
+int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          void *p);
+int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            void *p);
+int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             char **p);
 
 #include <_libxl_types_json.h>
 
diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libxl/libxl_nocpuid.c
index 5f7cb6a..eb525fc 100644
--- a/tools/libxl/libxl_nocpuid.c
+++ b/tools/libxl/libxl_nocpuid.c
@@ -44,6 +44,13 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
     return 0;
 }
 
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p)
+{
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUE1-0002Ey-8E; Thu, 19 Jun 2014 04:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDz-0002ER-1W
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:23 +0000
Received: from [85.158.139.211:29907] by server-1.bemta-5.messagelabs.com id
	84/81-30932-2EA62A35; Thu, 19 Jun 2014 04:45:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1403153120!10808383!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10968 invoked from network); 19 Jun 2014 04:45:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:45:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDw-0002cT-05
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUDv-0007yM-TD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:19 +0000
Date: Thu, 19 Jun 2014 04:45:19 +0000
Message-Id: <E1WxUDv-0007yM-TD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl_json: introduce parser functions
	for builtin types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 752f181fefb740523522b5730efdef28b0ff91ff
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:20 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:07:31 2014 +0100

    libxl_json: introduce parser functions for builtin types
    
    This changeset introduces following functions:
     * libxl_defbool_parse_json
     * libxl__bool_parse_json
     * libxl_uuid_parse_json
     * libxl_mac_parse_json
     * libxl_bitmap_parse_json
     * libxl_cpuid_policy_list_parse_json
     * libxl_string_list_parse_json
     * libxl_key_value_list_parse_json
     * libxl_hwcap_parse_json
     * libxl__int_parse_json
     * libxl__uint{8,16,32,64}_parse_json
     * libxl__string_parse_json
    
    They will be used in later patch to convert the libxl__json_object
    tree of a builtin type to libxl_FOO struct.
    
    Also remove declaration of libxl_domid_gen_json as libxl_domid uses
    yajl_gen_integer to generate JSON object.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Anthony Perard <anthony.perard@citrix.com>
---
 tools/libxl/libxl_cpuid.c   |   89 ++++++++++++---
 tools/libxl/libxl_json.c    |  271 +++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_json.h    |   36 ++++++-
 tools/libxl/libxl_nocpuid.c |    7 +
 4 files changed, 386 insertions(+), 17 deletions(-)

diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index 3787213..d9007b2 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -338,29 +338,29 @@ void libxl_cpuid_set(libxl_ctx *ctx, uint32_t domid,
                      (const char**)(cpuid[i].policy), cpuid_res);
 }
 
+static const char *input_names[2] = { "leaf", "subleaf" };
+static const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
+/*
+ * Aiming for:
+ * [
+ *     { 'leaf':    'val-eax',
+ *       'subleaf': 'val-ecx',
+ *       'eax':     'filter',
+ *       'ebx':     'filter',
+ *       'ecx':     'filter',
+ *       'edx':     'filter' },
+ *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
+ *     ... etc ...
+ * ]
+ */
+
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     libxl_cpuid_policy_list cpuid = *pcpuid;
     yajl_gen_status s;
-    const char *input_names[2] = { "leaf", "subleaf" };
-    const char *policy_names[4] = { "eax", "ebx", "ecx", "edx" };
     int i, j;
 
-    /*
-     * Aiming for:
-     * [
-     *     { 'leaf':    'val-eax',
-     *       'subleaf': 'val-ecx',
-     *       'eax':     'filter',
-     *       'ebx':     'filter',
-     *       'ecx':     'filter',
-     *       'edx':     'filter' },
-     *     { 'leaf':    'val-eax', ..., 'eax': 'filter', ... },
-     *     ... etc ...
-     * ]
-     */
-
     s = yajl_gen_array_open(hand);
     if (s != yajl_gen_status_ok) goto out;
 
@@ -398,6 +398,63 @@ out:
     return s;
 }
 
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p)
+{
+    int i, size;
+    libxl_cpuid_policy_list l;
+    flexarray_t *array;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(o);
+    if (!array->count)
+        return 0;
+
+    size = array->count;
+    /* need one extra slot as sentinel */
+    l = *p = libxl__calloc(NOGC, size + 1, sizeof(libxl_cpuid_policy));
+
+    l[size].input[0] = XEN_CPUID_INPUT_UNUSED;
+    l[size].input[1] = XEN_CPUID_INPUT_UNUSED;
+
+    for (i = 0; i < size; i++) {
+        const libxl__json_object *t;
+        int j;
+
+        if (flexarray_get(array, i, (void**)&t) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_map(t))
+            return ERROR_FAIL;
+
+        for (j = 0; j < ARRAY_SIZE(l[0].input); j++) {
+            const libxl__json_object *r;
+
+            r = libxl__json_map_get(input_names[j], t, JSON_INTEGER);
+            if (!r)
+                l[i].input[j] = XEN_CPUID_INPUT_UNUSED;
+            else
+                l[i].input[j] = libxl__json_object_get_integer(r);
+        }
+
+        for (j = 0; j < ARRAY_SIZE(l[0].policy); j++) {
+            const libxl__json_object *r;
+
+            r = libxl__json_map_get(policy_names[j], t, JSON_STRING);
+            if (!r)
+                l[i].policy[j] = NULL;
+            else
+                l[i].policy[j] =
+                    libxl__strdup(NOGC, libxl__json_object_get_string(r));
+        }
+    }
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index 8440498..fb9baf8 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -100,6 +100,42 @@ yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
     return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
 }
 
+int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             libxl_defbool *p)
+{
+    const char *s;
+
+    if (!libxl__json_object_is_string(o))
+        return ERROR_FAIL;
+
+    s = libxl__json_object_get_string(o);
+
+    if (!strncmp(s, LIBXL__DEFBOOL_STR_DEFAULT,
+                 strlen(LIBXL__DEFBOOL_STR_DEFAULT)))
+        p->val = LIBXL__DEFBOOL_DEFAULT;
+    else if (!strncmp(s, LIBXL__DEFBOOL_STR_TRUE,
+                      strlen(LIBXL__DEFBOOL_STR_TRUE)))
+        p->val = LIBXL__DEFBOOL_TRUE;
+    else if (!strncmp(s, LIBXL__DEFBOOL_STR_FALSE,
+                      strlen(LIBXL__DEFBOOL_STR_FALSE)))
+        p->val = LIBXL__DEFBOOL_FALSE;
+    else
+        return ERROR_FAIL;
+
+    return 0;
+}
+
+int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           bool *p)
+{
+    if (!libxl__json_object_is_bool(o))
+        return ERROR_FAIL;
+
+    *p = libxl__json_object_get_bool(o);
+
+    return 0;
+}
+
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
@@ -108,6 +144,15 @@ yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_UUID_FMTLEN);
 }
 
+int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          libxl_uuid *p)
+{
+    if (!libxl__json_object_is_string(o))
+        return ERROR_FAIL;
+
+    return libxl_uuid_from_string(p, o->u.string);
+}
+
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand,
                                       libxl_bitmap *bitmap)
 {
@@ -128,6 +173,40 @@ out:
     return s;
 }
 
+int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            libxl_bitmap *p)
+{
+    int i;
+    int size;
+    const libxl__json_object *t;
+    flexarray_t *array;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(o);
+    if (!array->count) {
+        libxl_bitmap_init(p);
+        return 0;
+    }
+
+    t = libxl__json_array_get(o, array->count - 1);
+    if (!libxl__json_object_is_integer(t))
+        return ERROR_FAIL;
+    size = libxl__json_object_get_integer(t) + 1;
+
+    libxl_bitmap_alloc(CTX, p, size);
+
+    for (i = 0; (t = libxl__json_array_get(o, i)); i++) {
+        if (!libxl__json_object_is_integer(t))
+            return ERROR_FAIL;
+
+        libxl_bitmap_set(p, libxl__json_object_get_integer(t));
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *pkvl)
 {
@@ -155,6 +234,41 @@ out:
     return s;
 }
 
+int libxl_key_value_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                    libxl_key_value_list *p)
+{
+    libxl__json_map_node *node = NULL;
+    flexarray_t *maps = NULL;
+    int i, size;
+    libxl_key_value_list kvl;
+
+    if (!libxl__json_object_is_map(o))
+        return ERROR_FAIL;
+
+    maps = libxl__json_object_get_map(o);
+    size = maps->count * 2;
+    kvl = *p = libxl__calloc(NOGC, size, sizeof(char *));
+
+    for (i = 0; i < maps->count; i++) {
+        int idx = i * 2;
+        if (flexarray_get(maps, i, (void**)&node) != 0)
+            return ERROR_FAIL;
+
+        if (!libxl__json_object_is_string(node->obj) &&
+            !libxl__json_object_is_null(node->obj))
+            return ERROR_FAIL;
+
+        kvl[idx] = libxl__strdup(NOGC, node->map_key);
+        if (libxl__json_object_is_string(node->obj))
+            kvl[idx+1] =
+                libxl__strdup(NOGC, libxl__json_object_get_string(node->obj));
+        else
+            kvl[idx+1] = NULL;
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *pl)
 {
     libxl_string_list l = *pl;
@@ -176,6 +290,38 @@ out:
     return s;
 }
 
+int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                 libxl_string_list *p)
+{
+    const libxl__json_object *t;
+    libxl_string_list l;
+    flexarray_t *array = NULL;
+    int i, size;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    array = libxl__json_object_get_array(o);
+    size = array->count;
+
+    if (size == 0) {
+        *p = NULL;
+        return 0;
+    }
+
+    /* need one extra slot as sentinel */
+    l = *p = libxl__calloc(NOGC, size + 1, sizeof(char *));
+
+    for (i = 0; (t = libxl__json_array_get(o, i)); i++) {
+        if (!libxl__json_object_is_string(t))
+            return ERROR_FAIL;
+
+        l[i] = libxl__strdup(NOGC, libxl__json_object_get_string(t));
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *mac)
 {
     char buf[LIBXL_MAC_FMTLEN+1];
@@ -183,6 +329,15 @@ yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *mac)
     return yajl_gen_string(hand, (const unsigned char *)buf, LIBXL_MAC_FMTLEN);
 }
 
+int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                         libxl_mac *p)
+{
+    if (!libxl__json_object_is_string(o))
+        return ERROR_FAIL;
+
+    return libxl__parse_mac(libxl__json_object_get_string(o), *p);
+}
+
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand,
                                      libxl_hwcap *p)
 {
@@ -201,6 +356,27 @@ out:
     return s;
 }
 
+int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           libxl_hwcap *p)
+{
+    int i;
+
+    if (!libxl__json_object_is_array(o))
+        return ERROR_FAIL;
+
+    for (i = 0; i<4; i++) {
+        const libxl__json_object *t;
+
+        t = libxl__json_array_get(o, i);
+        if (!t || !libxl__json_object_is_integer(t))
+            return ERROR_FAIL;
+
+        (*p)[i] = libxl__json_object_get_integer(t);
+    }
+
+    return 0;
+}
+
 yajl_gen_status libxl__string_gen_json(yajl_gen hand,
                                        const char *p)
 {
@@ -210,6 +386,20 @@ yajl_gen_status libxl__string_gen_json(yajl_gen hand,
         return yajl_gen_null(hand);
 }
 
+int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             char **p)
+{
+    if (!libxl__json_object_is_string(o) && !libxl__json_object_is_null(o))
+        return ERROR_FAIL;
+
+    if (libxl__json_object_is_null(o))
+        *p = NULL;
+    else
+        *p = libxl__strdup(NOGC, libxl__json_object_get_string(o));
+
+    return 0;
+}
+
 /*
  * libxl__json_object helper functions
  */
@@ -832,6 +1022,87 @@ out:
     return rc;
 }
 
+int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          void *p)
+{
+    long long i;
+
+    if (!libxl__json_object_is_integer(o))
+        return ERROR_FAIL;
+
+    i = libxl__json_object_get_integer(o);
+
+    if (i > INT_MAX || i < INT_MIN)
+        return ERROR_FAIL;
+
+    *((int *)p) = i;
+
+    return 0;
+}
+
+/* Macro to generate:
+ *  libxl__uint8_parse_json
+ *  libxl__uint16_parse_json
+ *  libxl__uint32_parse_json
+ */
+#define PARSE_UINT(width)                                               \
+    int libxl__uint ## width ## _parse_json(libxl__gc *gc,              \
+                                            const libxl__json_object *o,\
+                                            void *p)                    \
+    {                                                                   \
+        long long i;                                                    \
+                                                                        \
+        if (!libxl__json_object_is_integer(o))                          \
+            return ERROR_FAIL;                                          \
+                                                                        \
+        i = libxl__json_object_get_integer(o);                          \
+                                                                        \
+        if (i < 0 || i > UINT ## width ## _MAX)                         \
+            return ERROR_FAIL;                                          \
+                                                                        \
+        *((uint ## width ## _t *)p) = i;                                \
+                                                                        \
+        return 0;                                                       \
+    }
+
+PARSE_UINT(8);
+PARSE_UINT(16);
+PARSE_UINT(32);
+
+int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p)
+{
+    if (!libxl__json_object_is_integer(o) &&
+        !libxl__json_object_is_number(o))
+        return ERROR_FAIL;
+
+    if (libxl__json_object_is_integer(o)) {
+        long long i = libxl__json_object_get_integer(o);
+
+        if (i < 0)
+            return ERROR_FAIL;
+
+        *((uint64_t *)p) = i;
+    } else {
+        const char *s;
+        unsigned long long i;
+        int saved_errno = errno;
+
+        s = libxl__json_object_get_number(o);
+
+        errno = 0;
+        i = strtoull(s, NULL, 10);
+
+        if (i == ULLONG_MAX && errno == ERANGE)
+            return ERROR_FAIL;
+
+        errno = saved_errno;
+        *((uint64_t *)p) = i;
+    }
+
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index a45d429..b196c1c 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -22,18 +22,52 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+typedef struct libxl__gc libxl__gc;
+typedef struct libxl__json_object libxl__json_object;
+
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
-yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
+int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             libxl_defbool *p);
+int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           bool *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
+int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          libxl_uuid *p);
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
+int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                         libxl_mac *p);
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand, libxl_bitmap *p);
+int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            libxl_bitmap *p);
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                                  libxl_cpuid_policy_list *p);
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p);
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
+int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                 libxl_string_list *p);
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *p);
+int libxl_key_value_list_parse_json(libxl__gc *gc,
+                                    const libxl__json_object *o,
+                                    libxl_key_value_list *p);
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
+int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           libxl_hwcap *p);
+int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          void *p);
+int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            void *p);
+int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             char **p);
 
 #include <_libxl_types_json.h>
 
diff --git a/tools/libxl/libxl_nocpuid.c b/tools/libxl/libxl_nocpuid.c
index 5f7cb6a..eb525fc 100644
--- a/tools/libxl/libxl_nocpuid.c
+++ b/tools/libxl/libxl_nocpuid.c
@@ -44,6 +44,13 @@ yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
     return 0;
 }
 
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p)
+{
+    return 0;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEA-0002Gh-Dh; Thu, 19 Jun 2014 04:45:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUE8-0002GN-Rj
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:33 +0000
Received: from [85.158.143.35:28586] by server-1.bemta-4.messagelabs.com id
	F2/F4-09496-CEA62A35; Thu, 19 Jun 2014 04:45:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403153130!12367572!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10948 invoked from network); 19 Jun 2014 04:45:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:45:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUE6-0002cc-6a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUE6-0007yj-4s
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:30 +0000
Date: Thu, 19 Jun 2014 04:45:30 +0000
Message-Id: <E1WxUE6-0007yj-4s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl/gentypes.py: special-case
	KeyedUnion map handle generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ae765d434adbef6effe9c5dde8b241e4c299269
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:21 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:08:27 2014 +0100

    libxl/gentypes.py: special-case KeyedUnion map handle generation
    
    Generate JSON map handle according to KeyedUnion discriminator.
    
    The original JSON output for a keyed union is like:
     {
       ...
       "u" : { FIELDS }
       ...
     }
    
    The discriminator is not generated, so that the parser won't be able to
    figure out the fields in the incoming stream.
    
    So we need to change this to something more sensible. For example, for
    keyed union libxl_domain_type, which has a discriminator called "type",
    we generate following for HVM guest:
     {
       ...
       "type.hvm" : { HVM FIELDS }
       ...
     }
    
    Parser then can know the type of this union and how to interpret the
    incoming stream.
    
    Note that we change the existing API here. However the original output is
    quite broken anyway, we cannot make sensible use of it and I doubt that
    there's existing user of existing API. So we are acutally fixing a
    problem.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/gentypes.py |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index 61a2b3d..01416e7 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -186,6 +186,26 @@ def libxl_C_type_member_init(ty, field):
     s += "\n"
     return s
 
+def libxl_C_type_gen_map_key(f, parent, indent = ""):
+    s = ""
+    if isinstance(f.type, idl.KeyedUnion):
+        s += "switch (%s) {\n" % (parent + f.type.keyvar.name)
+        for x in f.type.fields:
+            v = f.type.keyvar.name + "." + x.name
+            s += "case %s:\n" % x.enumname
+            s += "    s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (v, v)
+            s += "    if (s != yajl_gen_status_ok)\n"
+            s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    else:
+        s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -235,9 +255,7 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s += "    goto out;\n"
         for f in [f for f in ty.fields if not f.const and not f.type.private]:
             (nparent,fexpr) = ty.member(v, f, parent is None)
-            s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
-            s += "if (s != yajl_gen_status_ok)\n"
-            s += "    goto out;\n"
+            s += libxl_C_type_gen_map_key(f, nparent)
             s += libxl_C_type_gen_json(f.type, fexpr, "", nparent)
         s += "s = yajl_gen_map_close(hand);\n"
         s += "if (s != yajl_gen_status_ok)\n"
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEA-0002Gh-Dh; Thu, 19 Jun 2014 04:45:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUE8-0002GN-Rj
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:33 +0000
Received: from [85.158.143.35:28586] by server-1.bemta-4.messagelabs.com id
	F2/F4-09496-CEA62A35; Thu, 19 Jun 2014 04:45:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403153130!12367572!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10948 invoked from network); 19 Jun 2014 04:45:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:45:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUE6-0002cc-6a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUE6-0007yj-4s
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:30 +0000
Date: Thu, 19 Jun 2014 04:45:30 +0000
Message-Id: <E1WxUE6-0007yj-4s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl/gentypes.py: special-case
	KeyedUnion map handle generation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0ae765d434adbef6effe9c5dde8b241e4c299269
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:21 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:08:27 2014 +0100

    libxl/gentypes.py: special-case KeyedUnion map handle generation
    
    Generate JSON map handle according to KeyedUnion discriminator.
    
    The original JSON output for a keyed union is like:
     {
       ...
       "u" : { FIELDS }
       ...
     }
    
    The discriminator is not generated, so that the parser won't be able to
    figure out the fields in the incoming stream.
    
    So we need to change this to something more sensible. For example, for
    keyed union libxl_domain_type, which has a discriminator called "type",
    we generate following for HVM guest:
     {
       ...
       "type.hvm" : { HVM FIELDS }
       ...
     }
    
    Parser then can know the type of this union and how to interpret the
    incoming stream.
    
    Note that we change the existing API here. However the original output is
    quite broken anyway, we cannot make sensible use of it and I doubt that
    there's existing user of existing API. So we are acutally fixing a
    problem.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/gentypes.py |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/tools/libxl/gentypes.py b/tools/libxl/gentypes.py
index 61a2b3d..01416e7 100644
--- a/tools/libxl/gentypes.py
+++ b/tools/libxl/gentypes.py
@@ -186,6 +186,26 @@ def libxl_C_type_member_init(ty, field):
     s += "\n"
     return s
 
+def libxl_C_type_gen_map_key(f, parent, indent = ""):
+    s = ""
+    if isinstance(f.type, idl.KeyedUnion):
+        s += "switch (%s) {\n" % (parent + f.type.keyvar.name)
+        for x in f.type.fields:
+            v = f.type.keyvar.name + "." + x.name
+            s += "case %s:\n" % x.enumname
+            s += "    s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (v, v)
+            s += "    if (s != yajl_gen_status_ok)\n"
+            s += "        goto out;\n"
+            s += "    break;\n"
+        s += "}\n"
+    else:
+        s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
+        s += "if (s != yajl_gen_status_ok)\n"
+        s += "    goto out;\n"
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -235,9 +255,7 @@ def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
         s += "    goto out;\n"
         for f in [f for f in ty.fields if not f.const and not f.type.private]:
             (nparent,fexpr) = ty.member(v, f, parent is None)
-            s += "s = yajl_gen_string(hand, (const unsigned char *)\"%s\", sizeof(\"%s\")-1);\n" % (f.name, f.name)
-            s += "if (s != yajl_gen_status_ok)\n"
-            s += "    goto out;\n"
+            s += libxl_C_type_gen_map_key(f, nparent)
             s += libxl_C_type_gen_json(f.type, fexpr, "", nparent)
         s += "s = yajl_gen_map_close(hand);\n"
         s += "if (s != yajl_gen_status_ok)\n"
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEJ-0002IB-HY; Thu, 19 Jun 2014 04:45:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEJ-0002I0-0S
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:43 +0000
Received: from [193.109.254.147:58837] by server-4.bemta-14.messagelabs.com id
	2A/B6-02781-6FA62A35; Thu, 19 Jun 2014 04:45:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403153140!12248873!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20720 invoked from network); 19 Jun 2014 04:45:41 -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;
	19 Jun 2014 04:45:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEG-0002ci-CT
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEG-0007z5-Aw
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:40 +0000
Date: Thu, 19 Jun 2014 04:45:40 +0000
Message-Id: <E1WxUEG-0007z5-Aw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce
	libxl_key_value_list_length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8e327629cdfe0e5ddf2cda65ec289a195de4df7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:25 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:27:35 2014 +0100

    libxl: introduce libxl_key_value_list_length
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   13 +++++++++++++
 tools/libxl/libxl.h |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 900b8d4..4b66afc 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -216,6 +216,19 @@ int libxl_string_list_length(const libxl_string_list *psl)
     return i;
 }
 
+int libxl_key_value_list_length(libxl_key_value_list *pkvl)
+{
+    int i = 0;
+    libxl_key_value_list kvl = *pkvl;
+
+    if (kvl) {
+        while (kvl[2 * i]) /* Only checks keys */
+            i++;
+    }
+
+    return i;
+}
+
 void libxl_key_value_list_dispose(libxl_key_value_list *pkvl)
 {
     int i;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a57e2fe..e2259b2 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -509,6 +509,7 @@ int libxl_string_list_length(const libxl_string_list *sl);
 
 typedef char **libxl_key_value_list;
 void libxl_key_value_list_dispose(libxl_key_value_list *kvl);
+int libxl_key_value_list_length(libxl_key_value_list *kvl);
 
 typedef uint32_t libxl_hwcap[8];
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:45:43 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:45:43 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEJ-0002IB-HY; Thu, 19 Jun 2014 04:45:43 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEJ-0002I0-0S
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:43 +0000
Received: from [193.109.254.147:58837] by server-4.bemta-14.messagelabs.com id
	2A/B6-02781-6FA62A35; Thu, 19 Jun 2014 04:45:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403153140!12248873!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20720 invoked from network); 19 Jun 2014 04:45:41 -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;
	19 Jun 2014 04:45:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEG-0002ci-CT
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEG-0007z5-Aw
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:40 +0000
Date: Thu, 19 Jun 2014 04:45:40 +0000
Message-Id: <E1WxUEG-0007z5-Aw@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce
	libxl_key_value_list_length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e8e327629cdfe0e5ddf2cda65ec289a195de4df7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:25 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:27:35 2014 +0100

    libxl: introduce libxl_key_value_list_length
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c |   13 +++++++++++++
 tools/libxl/libxl.h |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 900b8d4..4b66afc 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -216,6 +216,19 @@ int libxl_string_list_length(const libxl_string_list *psl)
     return i;
 }
 
+int libxl_key_value_list_length(libxl_key_value_list *pkvl)
+{
+    int i = 0;
+    libxl_key_value_list kvl = *pkvl;
+
+    if (kvl) {
+        while (kvl[2 * i]) /* Only checks keys */
+            i++;
+    }
+
+    return i;
+}
+
 void libxl_key_value_list_dispose(libxl_key_value_list *pkvl)
 {
     int i;
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index a57e2fe..e2259b2 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -509,6 +509,7 @@ int libxl_string_list_length(const libxl_string_list *sl);
 
 typedef char **libxl_key_value_list;
 void libxl_key_value_list_dispose(libxl_key_value_list *kvl);
+int libxl_key_value_list_length(libxl_key_value_list *kvl);
 
 typedef uint32_t libxl_hwcap[8];
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEf-0002KW-LT; Thu, 19 Jun 2014 04:46:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEe-0002KM-As
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:04 +0000
Received: from [193.109.254.147:59497] by server-15.bemta-14.messagelabs.com
	id 29/C3-15813-A0B62A35; Thu, 19 Jun 2014 04:46:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403153161!12165408!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28093 invoked from network); 19 Jun 2014 04:46:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEb-0002co-5S
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEb-00080E-3e
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:01 +0000
Date: Thu, 19 Jun 2014 04:46:01 +0000
Message-Id: <E1WxUEb-00080E-3e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: refine SMEP/SMAP tests in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 10 13:12:05 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 13:12:05 2014 +0200

    x86/HVM: refine SMEP/SMAP tests in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   22 +++++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 230ee9f..17ff011 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1753,7 +1753,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -3185,7 +3185,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 88e9378..90e69f5 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -406,19 +406,27 @@ static inline bool_t hvm_vcpu_has_smap(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
-        (hvm_vcpu_has_smap() ? X86_CR4_SMAP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
+        (((_restore) ? cpu_has_smap :                   \
+                       hvm_vcpu_has_smap()) ?           \
+         X86_CR4_SMAP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEf-0002KW-LT; Thu, 19 Jun 2014 04:46:05 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEe-0002KM-As
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:04 +0000
Received: from [193.109.254.147:59497] by server-15.bemta-14.messagelabs.com
	id 29/C3-15813-A0B62A35; Thu, 19 Jun 2014 04:46:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403153161!12165408!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28093 invoked from network); 19 Jun 2014 04:46:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEb-0002co-5S
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEb-00080E-3e
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:01 +0000
Date: Thu, 19 Jun 2014 04:46:01 +0000
Message-Id: <E1WxUEb-00080E-3e@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/HVM: refine SMEP/SMAP tests in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 10 13:12:05 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 13:12:05 2014 +0200

    x86/HVM: refine SMEP/SMAP tests in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   22 +++++++++++++++-------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 230ee9f..17ff011 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1753,7 +1753,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -3185,7 +3185,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 88e9378..90e69f5 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -406,19 +406,27 @@ static inline bool_t hvm_vcpu_has_smap(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
-        (hvm_vcpu_has_smap() ? X86_CR4_SMAP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
+        (((_restore) ? cpu_has_smap :                   \
+                       hvm_vcpu_has_smap()) ?           \
+         X86_CR4_SMAP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEo-0002Lq-RD; Thu, 19 Jun 2014 04:46:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEn-0002Lg-KS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:13 +0000
Received: from [85.158.143.35:20792] by server-2.bemta-4.messagelabs.com id
	A3/C2-06539-41B62A35; Thu, 19 Jun 2014 04:46:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1403153171!12371261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19622 invoked from network); 19 Jun 2014 04:46:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEl-0002dN-B7
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEl-00080k-9z
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:11 +0000
Date: Thu, 19 Jun 2014 04:46:11 +0000
Message-Id: <E1WxUEl-00080k-9z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: improve boot time diagnostics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9921387f0c14a3f0ed42f9112efb7260af13db35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 10 13:13:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 13:13:13 2014 +0200

    x86/EFI: improve boot time diagnostics
    
    To aid analysis of eventual errors, print EFI status codes with error
    messages where available.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/efi/boot.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index a772509..1966cc5 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -344,11 +344,12 @@ static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
         ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
                                      &fs_protocol, (void **)&fio);
         if ( EFI_ERROR(ret) )
-            blexit(L"Couldn't obtain the File System Protocol Interface");
+            PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
+                         ret);
         ret = fio->OpenVolume(fio, &dir_handle);
     } while ( ret == EFI_MEDIA_CHANGED );
     if ( ret != EFI_SUCCESS )
-        blexit(L"OpenVolume failure");
+        PrintErrMesg(L"OpenVolume failure", ret);
 
 #define buffer ((CHAR16 *)keyhandler_scratch)
 #define BUFFERSIZE sizeof(keyhandler_scratch)
@@ -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
                     (void **)&shim_lock)) &&
-         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
-        blexit(L"Dom0 kernel image could not be verified.");
+         (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
+        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
 
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
@@ -1381,6 +1382,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
+    if ( EFI_ERROR(status) )
+        PrintErrMesg(L"Cannot size memory map", status);
     mbi.mem_upper -= efi_memmap_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
@@ -1389,7 +1392,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
     if ( EFI_ERROR(status) )
-        blexit(L"Cannot obtain memory map");
+        PrintErrMesg(L"Cannot obtain memory map", status);
 
     /* Populate E820 table and check trampoline area availability. */
     e = e820map - 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUEo-0002Lq-RD; Thu, 19 Jun 2014 04:46:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEn-0002Lg-KS
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:13 +0000
Received: from [85.158.143.35:20792] by server-2.bemta-4.messagelabs.com id
	A3/C2-06539-41B62A35; Thu, 19 Jun 2014 04:46:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1403153171!12371261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19622 invoked from network); 19 Jun 2014 04:46:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEl-0002dN-B7
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEl-00080k-9z
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:11 +0000
Date: Thu, 19 Jun 2014 04:46:11 +0000
Message-Id: <E1WxUEl-00080k-9z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: improve boot time diagnostics
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9921387f0c14a3f0ed42f9112efb7260af13db35
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 10 13:13:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 13:13:13 2014 +0200

    x86/EFI: improve boot time diagnostics
    
    To aid analysis of eventual errors, print EFI status codes with error
    messages where available.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/efi/boot.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index a772509..1966cc5 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -344,11 +344,12 @@ static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
         ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
                                      &fs_protocol, (void **)&fio);
         if ( EFI_ERROR(ret) )
-            blexit(L"Couldn't obtain the File System Protocol Interface");
+            PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
+                         ret);
         ret = fio->OpenVolume(fio, &dir_handle);
     } while ( ret == EFI_MEDIA_CHANGED );
     if ( ret != EFI_SUCCESS )
-        blexit(L"OpenVolume failure");
+        PrintErrMesg(L"OpenVolume failure", ret);
 
 #define buffer ((CHAR16 *)keyhandler_scratch)
 #define BUFFERSIZE sizeof(keyhandler_scratch)
@@ -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
                     (void **)&shim_lock)) &&
-         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
-        blexit(L"Dom0 kernel image could not be verified.");
+         (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
+        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
 
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
@@ -1381,6 +1382,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
+    if ( EFI_ERROR(status) )
+        PrintErrMesg(L"Cannot size memory map", status);
     mbi.mem_upper -= efi_memmap_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
@@ -1389,7 +1392,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
     if ( EFI_ERROR(status) )
-        blexit(L"Cannot obtain memory map");
+        PrintErrMesg(L"Cannot obtain memory map", status);
 
     /* Populate E820 table and check trampoline area availability. */
     e = e820map - 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUF0-0002NV-UH; Thu, 19 Jun 2014 04:46:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEz-0002NG-GI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:25 +0000
Received: from [85.158.137.68:16559] by server-7.bemta-3.messagelabs.com id
	64/0E-04151-02B62A35; Thu, 19 Jun 2014 04:46:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403153181!11021638!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27031 invoked from network); 19 Jun 2014 04:46:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEv-0002dT-Ll
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEv-00081c-Gu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:21 +0000
Date: Thu, 19 Jun 2014 04:46:21 +0000
Message-Id: <E1WxUEv-00081c-Gu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: const-correctness for IST
	handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b6100a6cd5b9ff6de07726e3acf744454926c962
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 13:13:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 13:13:47 2014 +0200

    x86/traps: const-correctness for IST handlers
    
    NMI and MCE interrupt handlers have no right to modify their exception frame
    or underlying vcpu registers.  Apply liberal quantities of 'const' to 'struct
    cpu_user_regs *' throughout the codebase.
    
    The Double Fault handler, while an IST handler, reloads some extra
    architectural state back into its regs parameter.  As this is for printing
    purposes and on a terminal error path, the const requirements for #DF are
    relaxed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/alternative.c              |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.c      |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.h      |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c           |   12 ++++++------
 xen/arch/x86/cpu/mcheck/mce.h           |    4 ++--
 xen/arch/x86/cpu/mcheck/mce_amd.c       |    2 +-
 xen/arch/x86/cpu/mcheck/mce_intel.c     |   12 ++++++------
 xen/arch/x86/cpu/mcheck/x86_mca.h       |    2 +-
 xen/arch/x86/nmi.c                      |    2 +-
 xen/arch/x86/oprofile/nmi_int.c         |    2 +-
 xen/arch/x86/oprofile/op_model_athlon.c |    6 +++---
 xen/arch/x86/oprofile/op_model_p4.c     |    2 +-
 xen/arch/x86/oprofile/op_model_ppro.c   |    2 +-
 xen/arch/x86/oprofile/op_x86_model.h    |    2 +-
 xen/arch/x86/traps.c                    |   20 ++++++++++----------
 xen/arch/x86/x86_64/compat/traps.c      |    2 +-
 xen/arch/x86/x86_64/traps.c             |    2 +-
 xen/include/asm-x86/apic.h              |    2 +-
 xen/include/asm-x86/nmi.h               |    2 +-
 xen/include/asm-x86/processor.h         |   27 +++++++++++++++++----------
 xen/include/asm-x86/traps.h             |    2 +-
 21 files changed, 59 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 4b6c948..e91fb87 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -78,7 +78,7 @@ static const unsigned char * const p6_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
 
 static const unsigned char * const *ideal_nops __initdata = k8_nops;
 
-static int __init mask_nmi_callback(struct cpu_user_regs *regs, int cpu)
+static int __init mask_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
     return 1;
 }
diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index adf2ded..9cf2499 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -38,7 +38,7 @@ void mce_register_addrcheck(mce_check_addr_t cbfunc)
 void
 mc_memerr_dhandler(struct mca_binfo *binfo,
                    enum mce_result *result,
-                   struct cpu_user_regs *regs)
+                   const struct cpu_user_regs *regs)
 {
     struct mcinfo_bank *bank = binfo->mib;
     struct mcinfo_global *global = binfo->mig;
diff --git a/xen/arch/x86/cpu/mcheck/mcaction.h b/xen/arch/x86/cpu/mcheck/mcaction.h
index 0f70a24..c6044d5 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.h
+++ b/xen/arch/x86/cpu/mcheck/mcaction.h
@@ -7,7 +7,7 @@
 void
 mc_memerr_dhandler(struct mca_binfo *binfo,
                    enum mce_result *result,
-                   struct cpu_user_regs *regs);
+                   const struct cpu_user_regs *regs);
 
 #define MC_ADDR_PHYSICAL  0
 #define MC_ADDR_VIRTUAL   1
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c6e3092..13e5547 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -70,7 +70,7 @@ static void __init mce_set_verbosity(char *str)
 custom_param("mce_verbosity", mce_set_verbosity);
 
 /* Handle unconfigured int18 (should never happen) */
-static void unexpected_machine_check(struct cpu_user_regs *regs, long error_code)
+static void unexpected_machine_check(const struct cpu_user_regs *regs, long error_code)
 {
     console_force_unlock();
     printk("Unexpected Machine Check Exception\n");
@@ -88,7 +88,7 @@ void x86_mce_vector_register(x86_mce_vector_t hdlr)
 
 /* Call the installed machine check handler for this CPU setup. */
 
-void machine_check_vector(struct cpu_user_regs *regs, long error_code)
+void machine_check_vector(const struct cpu_user_regs *regs, long error_code)
 {
     _machine_check_vector(regs, error_code);
 }
@@ -424,7 +424,7 @@ static void mce_spin_unlock(spinlock_t *lk)
       spin_unlock(lk);
 }
 
-static enum mce_result mce_action(struct cpu_user_regs *regs,
+static enum mce_result mce_action(const struct cpu_user_regs *regs,
     mctelem_cookie_t mctc);
 
 /*
@@ -432,7 +432,7 @@ static enum mce_result mce_action(struct cpu_user_regs *regs,
  * -1: if system can't be recovered
  * 0: Continue to next step
  */
-static int mce_urgent_action(struct cpu_user_regs *regs,
+static int mce_urgent_action(const struct cpu_user_regs *regs,
                               mctelem_cookie_t mctc)
 {
     uint64_t gstatus;
@@ -459,7 +459,7 @@ static int mce_urgent_action(struct cpu_user_regs *regs,
 }
 
 /* Shared #MC handler. */
-void mcheck_cmn_handler(struct cpu_user_regs *regs, long error_code,
+void mcheck_cmn_handler(const struct cpu_user_regs *regs, long error_code,
     struct mca_banks *bankmask, struct mca_banks *clear_bank)
 {
     uint64_t gstatus;
@@ -1570,7 +1570,7 @@ void mc_panic(char *s)
  */
 
 /* Maybe called in MCE context, no lock, no printk */
-static enum mce_result mce_action(struct cpu_user_regs *regs,
+static enum mce_result mce_action(const struct cpu_user_regs *regs,
                       mctelem_cookie_t mctc)
 {
     struct mc_info *local_mi;
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index 33bd1ab..0397f80 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -62,12 +62,12 @@ void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
 			 uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
 /* Register a handler for machine check exceptions. */
-typedef void (*x86_mce_vector_t)(struct cpu_user_regs *, long);
+typedef void (*x86_mce_vector_t)(const struct cpu_user_regs *, long);
 extern void x86_mce_vector_register(x86_mce_vector_t);
 
 /* Common generic MCE handler that implementations may nominate
  * via x86_mce_vector_register. */
-extern void mcheck_cmn_handler(struct cpu_user_regs *, long,
+extern void mcheck_cmn_handler(const struct cpu_user_regs *, long,
     struct mca_banks *, struct mca_banks *);
 
 /* Register a handler for judging whether mce is recoverable. */
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index d59e21d..9daa461 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -242,7 +242,7 @@ amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
 }
 
 /* Common AMD Machine Check Handler for AMD K8 and higher */
-static void amd_cmn_machine_check(struct cpu_user_regs *regs, long error_code)
+static void amd_cmn_machine_check(const struct cpu_user_regs *regs, long error_code)
 {
     mcheck_cmn_handler(regs, error_code, mca_allbanks,
                        __get_cpu_var(mce_clear_banks));
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b32fdb2..ad06efc 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -258,7 +258,7 @@ static enum intel_mce_type intel_check_mce_type(uint64_t status)
 static void intel_memerr_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     mce_printk(MCE_VERBOSE, "MCE: Enter UCR recovery action\n");
     mc_memerr_dhandler(binfo, result, regs);
@@ -285,7 +285,7 @@ static int intel_checkaddr(uint64_t status, uint64_t misc, int addrtype)
 static void intel_srar_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     uint64_t status = binfo->mib->mc_status;
 
@@ -311,7 +311,7 @@ static int intel_srao_check(uint64_t status)
 static void intel_srao_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     uint64_t status = binfo->mib->mc_status;
 
@@ -340,7 +340,7 @@ static int intel_default_check(uint64_t status)
 static void intel_default_mce_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs * regs)
+             const struct cpu_user_regs * regs)
 {
     uint64_t status = binfo->mib->mc_status;
     enum intel_mce_type type;
@@ -362,7 +362,7 @@ static const struct mca_error_handler intel_mce_dhandlers[] = {
 static void intel_default_mce_uhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     uint64_t status = binfo->mib->mc_status;
     enum intel_mce_type type;
@@ -384,7 +384,7 @@ static const struct mca_error_handler intel_mce_uhandlers[] = {
     {intel_default_check, intel_default_mce_uhandler}
 };
 
-static void intel_machine_check(struct cpu_user_regs * regs, long error_code)
+static void intel_machine_check(const struct cpu_user_regs * regs, long error_code)
 {
     mcheck_cmn_handler(regs, error_code, mca_allbanks,
         __get_cpu_var(mce_clear_banks));
diff --git a/xen/arch/x86/cpu/mcheck/x86_mca.h b/xen/arch/x86/cpu/mcheck/x86_mca.h
index ca5dfff..a2cd37e 100644
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
@@ -152,7 +152,7 @@ struct mca_error_handler
      */
     int (*owned_error)(uint64_t status);
     void (*recovery_handler)(struct mca_binfo *binfo,
-                    enum mce_result *result, struct cpu_user_regs *regs);
+                    enum mce_result *result, const struct cpu_user_regs *regs);
 };
 
 /* Global variables */
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index f5810a4..c4427a6 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -432,7 +432,7 @@ int __init watchdog_setup(void)
     return 0;
 }
 
-void nmi_watchdog_tick(struct cpu_user_regs * regs)
+void nmi_watchdog_tick(const struct cpu_user_regs *regs)
 {
     unsigned int sum = this_cpu(nmi_timer_ticks);
 
diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
index c824b84..eb12fcb 100644
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -82,7 +82,7 @@ void passive_domain_destroy(struct vcpu *v)
 		model->free_msr(v);
 }
 
-static int nmi_callback(struct cpu_user_regs *regs, int cpu)
+static int nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
 	int xen_mode, ovf;
 
diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c
index 204343d..c0a81ed 100644
--- a/xen/arch/x86/oprofile/op_model_athlon.c
+++ b/xen/arch/x86/oprofile/op_model_athlon.c
@@ -237,7 +237,7 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
 }
 
 static inline void
-ibs_log_event(u64 data, struct cpu_user_regs * const regs, int mode)
+ibs_log_event(u64 data, struct cpu_user_regs const * const regs, int mode)
 {
 	struct vcpu *v = current;
 	u32 temp = 0;
@@ -250,7 +250,7 @@ ibs_log_event(u64 data, struct cpu_user_regs * const regs, int mode)
 	
 }
 
-static inline int handle_ibs(int mode, struct cpu_user_regs * const regs)
+static inline int handle_ibs(int mode, struct cpu_user_regs const * const regs)
 {
 	u64 val, ctl;
 	struct vcpu *v = current;
@@ -310,7 +310,7 @@ static inline int handle_ibs(int mode, struct cpu_user_regs * const regs)
 
 static int athlon_check_ctrs(unsigned int const cpu,
 			     struct op_msrs const * const msrs,
-			     struct cpu_user_regs * const regs)
+			     struct cpu_user_regs const * const regs)
 
 {
 	uint64_t msr_content;
diff --git a/xen/arch/x86/oprofile/op_model_p4.c b/xen/arch/x86/oprofile/op_model_p4.c
index 34f5fdb..29fe3bc 100644
--- a/xen/arch/x86/oprofile/op_model_p4.c
+++ b/xen/arch/x86/oprofile/op_model_p4.c
@@ -611,7 +611,7 @@ static void p4_setup_ctrs(struct op_msrs const * const msrs)
 
 static int p4_check_ctrs(unsigned int const cpu,
                          struct op_msrs const * const msrs,
-                         struct cpu_user_regs * const regs)
+                         struct cpu_user_regs const * const regs)
 {
 	unsigned long ctr, stag, real;
 	uint64_t msr_content;
diff --git a/xen/arch/x86/oprofile/op_model_ppro.c b/xen/arch/x86/oprofile/op_model_ppro.c
index 3225937..8b9f3f6 100644
--- a/xen/arch/x86/oprofile/op_model_ppro.c
+++ b/xen/arch/x86/oprofile/op_model_ppro.c
@@ -126,7 +126,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
 
 static int ppro_check_ctrs(unsigned int const cpu,
                            struct op_msrs const * const msrs,
-                           struct cpu_user_regs * const regs)
+                           struct cpu_user_regs const * const regs)
 {
 	u64 val;
 	int i;
diff --git a/xen/arch/x86/oprofile/op_x86_model.h b/xen/arch/x86/oprofile/op_x86_model.h
index 31d473b..35bc3c1 100644
--- a/xen/arch/x86/oprofile/op_x86_model.h
+++ b/xen/arch/x86/oprofile/op_x86_model.h
@@ -33,7 +33,7 @@ struct op_x86_model_spec {
 	void (*setup_ctrs)(struct op_msrs const * const msrs);
 	int (*check_ctrs)(unsigned int const cpu, 
 			  struct op_msrs const * const msrs,
-			  struct cpu_user_regs * const regs);
+			  struct cpu_user_regs const * const regs);
 	void (*start)(struct op_msrs const * const msrs);
 	void (*stop)(struct op_msrs const * const msrs);
 	int (*is_arch_pmu_msr)(u64 msr_index, int *type, int *index);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8161585..44ac014 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -114,7 +114,7 @@ boolean_param("ler", opt_ler);
 #define stack_words_per_line 4
 #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
 
-static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
+static void show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs)
 {
     int i;
     unsigned long *stack, addr;
@@ -290,7 +290,7 @@ static void show_trace(const struct cpu_user_regs *regs)
     printk("\n");
 }
 
-void show_stack(struct cpu_user_regs *regs)
+void show_stack(const struct cpu_user_regs *regs)
 {
     unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
     int i;
@@ -349,7 +349,7 @@ void show_stack_overflow(unsigned int cpu, const struct cpu_user_regs *regs)
 #endif
 }
 
-void show_execution_state(struct cpu_user_regs *regs)
+void show_execution_state(const struct cpu_user_regs *regs)
 {
     show_registers(regs);
     show_stack(regs);
@@ -394,7 +394,7 @@ static const char *trapstr(unsigned int trapnr)
  * are disabled). In such situations we can't do much that is safe. We try to
  * print out some tracing and then we just spin.
  */
-void fatal_trap(int trapnr, struct cpu_user_regs *regs)
+void fatal_trap(int trapnr, const struct cpu_user_regs *regs)
 {
     static DEFINE_PER_CPU(char, depth);
 
@@ -1086,7 +1086,7 @@ void do_int3(struct cpu_user_regs *regs)
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-void do_machine_check(struct cpu_user_regs *regs)
+void do_machine_check(const struct cpu_user_regs *regs)
 {
     machine_check_vector(regs, regs->error_code);
 }
@@ -3240,7 +3240,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
     send_guest_trap(d, 0, TRAP_nmi);
 }
 
-static void pci_serr_error(struct cpu_user_regs *regs)
+static void pci_serr_error(const struct cpu_user_regs *regs)
 {
     outb((inb(0x61) & 0x0f) | 0x04, 0x61); /* clear-and-disable the PCI SERR error line. */
 
@@ -3260,7 +3260,7 @@ static void pci_serr_error(struct cpu_user_regs *regs)
     }
 }
 
-static void io_check_error(struct cpu_user_regs *regs)
+static void io_check_error(const struct cpu_user_regs *regs)
 {
     switch ( opt_nmi[0] )
     {
@@ -3279,7 +3279,7 @@ static void io_check_error(struct cpu_user_regs *regs)
     outb((inb(0x61) & 0x07) | 0x00, 0x61); /* enable IOCK */
 }
 
-static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char reason)
+static void unknown_nmi_error(const struct cpu_user_regs *regs, unsigned char reason)
 {
     switch ( opt_nmi[0] )
     {
@@ -3295,14 +3295,14 @@ static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char reason)
     }
 }
 
-static int dummy_nmi_callback(struct cpu_user_regs *regs, int cpu)
+static int dummy_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
     return 0;
 }
  
 static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
-void do_nmi(struct cpu_user_regs *regs)
+void do_nmi(const struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
diff --git a/xen/arch/x86/x86_64/compat/traps.c b/xen/arch/x86/x86_64/compat/traps.c
index 5f0ea0a..b6c2563 100644
--- a/xen/arch/x86/x86_64/compat/traps.c
+++ b/xen/arch/x86/x86_64/compat/traps.c
@@ -3,7 +3,7 @@
 #include <compat/callback.h>
 #include <compat/arch-x86_32.h>
 
-void compat_show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs,
+void compat_show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs,
                              int debug_stack_lines)
 {
     unsigned int i, *stack, addr, mask = STACK_SIZE;
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index d09b6b6..650c33d 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -79,7 +79,7 @@ static void _show_registers(
            regs->gs, regs->ss, regs->cs);
 }
 
-void show_registers(struct cpu_user_regs *regs)
+void show_registers(const struct cpu_user_regs *regs)
 {
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 43b39ce..5d7623f 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -206,7 +206,7 @@ extern void release_lapic_nmi(void);
 extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern void nmi_watchdog_tick (struct cpu_user_regs *regs);
+extern void nmi_watchdog_tick (const struct cpu_user_regs *regs);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
index 58cd9a1..4504fe1 100644
--- a/xen/include/asm-x86/nmi.h
+++ b/xen/include/asm-x86/nmi.h
@@ -9,7 +9,7 @@ struct cpu_user_regs;
 /* Watchdog boolean from the command line */
 extern bool_t opt_watchdog;
  
-typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
+typedef int (*nmi_callback_t)(const struct cpu_user_regs *regs, int cpu);
  
 /** 
  * set_nmi_callback
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 4a60eb0..46107a6 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -477,27 +477,32 @@ static always_inline void rep_nop(void)
 
 #define cpu_relax() rep_nop()
 
-void show_stack(struct cpu_user_regs *regs);
+void show_stack(const struct cpu_user_regs *regs);
 void show_stack_overflow(unsigned int cpu, const struct cpu_user_regs *regs);
-void show_registers(struct cpu_user_regs *regs);
-void show_execution_state(struct cpu_user_regs *regs);
+void show_registers(const struct cpu_user_regs *regs);
+void show_execution_state(const struct cpu_user_regs *regs);
 #define dump_execution_state() run_in_exception_handler(show_execution_state)
 void show_page_walk(unsigned long addr);
-void noreturn fatal_trap(int trapnr, struct cpu_user_regs *regs);
+void noreturn fatal_trap(int trapnr, const struct cpu_user_regs *regs);
 
-void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
+void compat_show_guest_stack(struct vcpu *v,
+                             const struct cpu_user_regs *regs, int lines);
 
 extern void mtrr_ap_init(void);
 extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
-#define DECLARE_TRAP_HANDLER(_name)                     \
-void _name(void);                            \
-void do_ ## _name(struct cpu_user_regs *regs)
+#define DECLARE_TRAP_HANDLER(_name)                    \
+    void _name(void);                                  \
+    void do_ ## _name(struct cpu_user_regs *regs)
+#define DECLARE_TRAP_HANDLER_CONST(_name)              \
+    void _name(void);                                  \
+    void do_ ## _name(const struct cpu_user_regs *regs)
+
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
-DECLARE_TRAP_HANDLER(nmi);
+DECLARE_TRAP_HANDLER_CONST(nmi);
 DECLARE_TRAP_HANDLER(int3);
 DECLARE_TRAP_HANDLER(overflow);
 DECLARE_TRAP_HANDLER(bounds);
@@ -512,8 +517,10 @@ DECLARE_TRAP_HANDLER(page_fault);
 DECLARE_TRAP_HANDLER(early_page_fault);
 DECLARE_TRAP_HANDLER(coprocessor_error);
 DECLARE_TRAP_HANDLER(simd_coprocessor_error);
-DECLARE_TRAP_HANDLER(machine_check);
+DECLARE_TRAP_HANDLER_CONST(machine_check);
 DECLARE_TRAP_HANDLER(alignment_check);
+
+#undef DECLARE_TRAP_HANDLER_CONST
 #undef DECLARE_TRAP_HANDLER
 
 void trap_nop(void);
diff --git a/xen/include/asm-x86/traps.h b/xen/include/asm-x86/traps.h
index 556b133..47b7ab9 100644
--- a/xen/include/asm-x86/traps.h
+++ b/xen/include/asm-x86/traps.h
@@ -28,7 +28,7 @@ struct softirq_trap {
 
 struct cpu_user_regs;
 
-extern void machine_check_vector(struct cpu_user_regs *regs, long error_code);
+extern void machine_check_vector(const struct cpu_user_regs *regs, long error_code);
 
 void async_exception_cleanup(struct vcpu *);
  
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:27 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUF0-0002NV-UH; Thu, 19 Jun 2014 04:46:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEz-0002NG-GI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:25 +0000
Received: from [85.158.137.68:16559] by server-7.bemta-3.messagelabs.com id
	64/0E-04151-02B62A35; Thu, 19 Jun 2014 04:46:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403153181!11021638!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27031 invoked from network); 19 Jun 2014 04:46:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEv-0002dT-Ll
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEv-00081c-Gu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:21 +0000
Date: Thu, 19 Jun 2014 04:46:21 +0000
Message-Id: <E1WxUEv-00081c-Gu@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/traps: const-correctness for IST
	handlers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit b6100a6cd5b9ff6de07726e3acf744454926c962
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 13:13:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 13:13:47 2014 +0200

    x86/traps: const-correctness for IST handlers
    
    NMI and MCE interrupt handlers have no right to modify their exception frame
    or underlying vcpu registers.  Apply liberal quantities of 'const' to 'struct
    cpu_user_regs *' throughout the codebase.
    
    The Double Fault handler, while an IST handler, reloads some extra
    architectural state back into its regs parameter.  As this is for printing
    purposes and on a terminal error path, the const requirements for #DF are
    relaxed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/alternative.c              |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.c      |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.h      |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c           |   12 ++++++------
 xen/arch/x86/cpu/mcheck/mce.h           |    4 ++--
 xen/arch/x86/cpu/mcheck/mce_amd.c       |    2 +-
 xen/arch/x86/cpu/mcheck/mce_intel.c     |   12 ++++++------
 xen/arch/x86/cpu/mcheck/x86_mca.h       |    2 +-
 xen/arch/x86/nmi.c                      |    2 +-
 xen/arch/x86/oprofile/nmi_int.c         |    2 +-
 xen/arch/x86/oprofile/op_model_athlon.c |    6 +++---
 xen/arch/x86/oprofile/op_model_p4.c     |    2 +-
 xen/arch/x86/oprofile/op_model_ppro.c   |    2 +-
 xen/arch/x86/oprofile/op_x86_model.h    |    2 +-
 xen/arch/x86/traps.c                    |   20 ++++++++++----------
 xen/arch/x86/x86_64/compat/traps.c      |    2 +-
 xen/arch/x86/x86_64/traps.c             |    2 +-
 xen/include/asm-x86/apic.h              |    2 +-
 xen/include/asm-x86/nmi.h               |    2 +-
 xen/include/asm-x86/processor.h         |   27 +++++++++++++++++----------
 xen/include/asm-x86/traps.h             |    2 +-
 21 files changed, 59 insertions(+), 52 deletions(-)

diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
index 4b6c948..e91fb87 100644
--- a/xen/arch/x86/alternative.c
+++ b/xen/arch/x86/alternative.c
@@ -78,7 +78,7 @@ static const unsigned char * const p6_nops[ASM_NOP_MAX+1] /*__initconst*/ = {
 
 static const unsigned char * const *ideal_nops __initdata = k8_nops;
 
-static int __init mask_nmi_callback(struct cpu_user_regs *regs, int cpu)
+static int __init mask_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
     return 1;
 }
diff --git a/xen/arch/x86/cpu/mcheck/mcaction.c b/xen/arch/x86/cpu/mcheck/mcaction.c
index adf2ded..9cf2499 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.c
+++ b/xen/arch/x86/cpu/mcheck/mcaction.c
@@ -38,7 +38,7 @@ void mce_register_addrcheck(mce_check_addr_t cbfunc)
 void
 mc_memerr_dhandler(struct mca_binfo *binfo,
                    enum mce_result *result,
-                   struct cpu_user_regs *regs)
+                   const struct cpu_user_regs *regs)
 {
     struct mcinfo_bank *bank = binfo->mib;
     struct mcinfo_global *global = binfo->mig;
diff --git a/xen/arch/x86/cpu/mcheck/mcaction.h b/xen/arch/x86/cpu/mcheck/mcaction.h
index 0f70a24..c6044d5 100644
--- a/xen/arch/x86/cpu/mcheck/mcaction.h
+++ b/xen/arch/x86/cpu/mcheck/mcaction.h
@@ -7,7 +7,7 @@
 void
 mc_memerr_dhandler(struct mca_binfo *binfo,
                    enum mce_result *result,
-                   struct cpu_user_regs *regs);
+                   const struct cpu_user_regs *regs);
 
 #define MC_ADDR_PHYSICAL  0
 #define MC_ADDR_VIRTUAL   1
diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index c6e3092..13e5547 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -70,7 +70,7 @@ static void __init mce_set_verbosity(char *str)
 custom_param("mce_verbosity", mce_set_verbosity);
 
 /* Handle unconfigured int18 (should never happen) */
-static void unexpected_machine_check(struct cpu_user_regs *regs, long error_code)
+static void unexpected_machine_check(const struct cpu_user_regs *regs, long error_code)
 {
     console_force_unlock();
     printk("Unexpected Machine Check Exception\n");
@@ -88,7 +88,7 @@ void x86_mce_vector_register(x86_mce_vector_t hdlr)
 
 /* Call the installed machine check handler for this CPU setup. */
 
-void machine_check_vector(struct cpu_user_regs *regs, long error_code)
+void machine_check_vector(const struct cpu_user_regs *regs, long error_code)
 {
     _machine_check_vector(regs, error_code);
 }
@@ -424,7 +424,7 @@ static void mce_spin_unlock(spinlock_t *lk)
       spin_unlock(lk);
 }
 
-static enum mce_result mce_action(struct cpu_user_regs *regs,
+static enum mce_result mce_action(const struct cpu_user_regs *regs,
     mctelem_cookie_t mctc);
 
 /*
@@ -432,7 +432,7 @@ static enum mce_result mce_action(struct cpu_user_regs *regs,
  * -1: if system can't be recovered
  * 0: Continue to next step
  */
-static int mce_urgent_action(struct cpu_user_regs *regs,
+static int mce_urgent_action(const struct cpu_user_regs *regs,
                               mctelem_cookie_t mctc)
 {
     uint64_t gstatus;
@@ -459,7 +459,7 @@ static int mce_urgent_action(struct cpu_user_regs *regs,
 }
 
 /* Shared #MC handler. */
-void mcheck_cmn_handler(struct cpu_user_regs *regs, long error_code,
+void mcheck_cmn_handler(const struct cpu_user_regs *regs, long error_code,
     struct mca_banks *bankmask, struct mca_banks *clear_bank)
 {
     uint64_t gstatus;
@@ -1570,7 +1570,7 @@ void mc_panic(char *s)
  */
 
 /* Maybe called in MCE context, no lock, no printk */
-static enum mce_result mce_action(struct cpu_user_regs *regs,
+static enum mce_result mce_action(const struct cpu_user_regs *regs,
                       mctelem_cookie_t mctc)
 {
     struct mc_info *local_mi;
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index 33bd1ab..0397f80 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -62,12 +62,12 @@ void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
 			 uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
 /* Register a handler for machine check exceptions. */
-typedef void (*x86_mce_vector_t)(struct cpu_user_regs *, long);
+typedef void (*x86_mce_vector_t)(const struct cpu_user_regs *, long);
 extern void x86_mce_vector_register(x86_mce_vector_t);
 
 /* Common generic MCE handler that implementations may nominate
  * via x86_mce_vector_register. */
-extern void mcheck_cmn_handler(struct cpu_user_regs *, long,
+extern void mcheck_cmn_handler(const struct cpu_user_regs *, long,
     struct mca_banks *, struct mca_banks *);
 
 /* Register a handler for judging whether mce is recoverable. */
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index d59e21d..9daa461 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -242,7 +242,7 @@ amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
 }
 
 /* Common AMD Machine Check Handler for AMD K8 and higher */
-static void amd_cmn_machine_check(struct cpu_user_regs *regs, long error_code)
+static void amd_cmn_machine_check(const struct cpu_user_regs *regs, long error_code)
 {
     mcheck_cmn_handler(regs, error_code, mca_allbanks,
                        __get_cpu_var(mce_clear_banks));
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b32fdb2..ad06efc 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -258,7 +258,7 @@ static enum intel_mce_type intel_check_mce_type(uint64_t status)
 static void intel_memerr_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     mce_printk(MCE_VERBOSE, "MCE: Enter UCR recovery action\n");
     mc_memerr_dhandler(binfo, result, regs);
@@ -285,7 +285,7 @@ static int intel_checkaddr(uint64_t status, uint64_t misc, int addrtype)
 static void intel_srar_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     uint64_t status = binfo->mib->mc_status;
 
@@ -311,7 +311,7 @@ static int intel_srao_check(uint64_t status)
 static void intel_srao_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     uint64_t status = binfo->mib->mc_status;
 
@@ -340,7 +340,7 @@ static int intel_default_check(uint64_t status)
 static void intel_default_mce_dhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs * regs)
+             const struct cpu_user_regs * regs)
 {
     uint64_t status = binfo->mib->mc_status;
     enum intel_mce_type type;
@@ -362,7 +362,7 @@ static const struct mca_error_handler intel_mce_dhandlers[] = {
 static void intel_default_mce_uhandler(
              struct mca_binfo *binfo,
              enum mce_result *result,
-             struct cpu_user_regs *regs)
+             const struct cpu_user_regs *regs)
 {
     uint64_t status = binfo->mib->mc_status;
     enum intel_mce_type type;
@@ -384,7 +384,7 @@ static const struct mca_error_handler intel_mce_uhandlers[] = {
     {intel_default_check, intel_default_mce_uhandler}
 };
 
-static void intel_machine_check(struct cpu_user_regs * regs, long error_code)
+static void intel_machine_check(const struct cpu_user_regs * regs, long error_code)
 {
     mcheck_cmn_handler(regs, error_code, mca_allbanks,
         __get_cpu_var(mce_clear_banks));
diff --git a/xen/arch/x86/cpu/mcheck/x86_mca.h b/xen/arch/x86/cpu/mcheck/x86_mca.h
index ca5dfff..a2cd37e 100644
--- a/xen/arch/x86/cpu/mcheck/x86_mca.h
+++ b/xen/arch/x86/cpu/mcheck/x86_mca.h
@@ -152,7 +152,7 @@ struct mca_error_handler
      */
     int (*owned_error)(uint64_t status);
     void (*recovery_handler)(struct mca_binfo *binfo,
-                    enum mce_result *result, struct cpu_user_regs *regs);
+                    enum mce_result *result, const struct cpu_user_regs *regs);
 };
 
 /* Global variables */
diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index f5810a4..c4427a6 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -432,7 +432,7 @@ int __init watchdog_setup(void)
     return 0;
 }
 
-void nmi_watchdog_tick(struct cpu_user_regs * regs)
+void nmi_watchdog_tick(const struct cpu_user_regs *regs)
 {
     unsigned int sum = this_cpu(nmi_timer_ticks);
 
diff --git a/xen/arch/x86/oprofile/nmi_int.c b/xen/arch/x86/oprofile/nmi_int.c
index c824b84..eb12fcb 100644
--- a/xen/arch/x86/oprofile/nmi_int.c
+++ b/xen/arch/x86/oprofile/nmi_int.c
@@ -82,7 +82,7 @@ void passive_domain_destroy(struct vcpu *v)
 		model->free_msr(v);
 }
 
-static int nmi_callback(struct cpu_user_regs *regs, int cpu)
+static int nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
 	int xen_mode, ovf;
 
diff --git a/xen/arch/x86/oprofile/op_model_athlon.c b/xen/arch/x86/oprofile/op_model_athlon.c
index 204343d..c0a81ed 100644
--- a/xen/arch/x86/oprofile/op_model_athlon.c
+++ b/xen/arch/x86/oprofile/op_model_athlon.c
@@ -237,7 +237,7 @@ static void athlon_setup_ctrs(struct op_msrs const * const msrs)
 }
 
 static inline void
-ibs_log_event(u64 data, struct cpu_user_regs * const regs, int mode)
+ibs_log_event(u64 data, struct cpu_user_regs const * const regs, int mode)
 {
 	struct vcpu *v = current;
 	u32 temp = 0;
@@ -250,7 +250,7 @@ ibs_log_event(u64 data, struct cpu_user_regs * const regs, int mode)
 	
 }
 
-static inline int handle_ibs(int mode, struct cpu_user_regs * const regs)
+static inline int handle_ibs(int mode, struct cpu_user_regs const * const regs)
 {
 	u64 val, ctl;
 	struct vcpu *v = current;
@@ -310,7 +310,7 @@ static inline int handle_ibs(int mode, struct cpu_user_regs * const regs)
 
 static int athlon_check_ctrs(unsigned int const cpu,
 			     struct op_msrs const * const msrs,
-			     struct cpu_user_regs * const regs)
+			     struct cpu_user_regs const * const regs)
 
 {
 	uint64_t msr_content;
diff --git a/xen/arch/x86/oprofile/op_model_p4.c b/xen/arch/x86/oprofile/op_model_p4.c
index 34f5fdb..29fe3bc 100644
--- a/xen/arch/x86/oprofile/op_model_p4.c
+++ b/xen/arch/x86/oprofile/op_model_p4.c
@@ -611,7 +611,7 @@ static void p4_setup_ctrs(struct op_msrs const * const msrs)
 
 static int p4_check_ctrs(unsigned int const cpu,
                          struct op_msrs const * const msrs,
-                         struct cpu_user_regs * const regs)
+                         struct cpu_user_regs const * const regs)
 {
 	unsigned long ctr, stag, real;
 	uint64_t msr_content;
diff --git a/xen/arch/x86/oprofile/op_model_ppro.c b/xen/arch/x86/oprofile/op_model_ppro.c
index 3225937..8b9f3f6 100644
--- a/xen/arch/x86/oprofile/op_model_ppro.c
+++ b/xen/arch/x86/oprofile/op_model_ppro.c
@@ -126,7 +126,7 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs)
 
 static int ppro_check_ctrs(unsigned int const cpu,
                            struct op_msrs const * const msrs,
-                           struct cpu_user_regs * const regs)
+                           struct cpu_user_regs const * const regs)
 {
 	u64 val;
 	int i;
diff --git a/xen/arch/x86/oprofile/op_x86_model.h b/xen/arch/x86/oprofile/op_x86_model.h
index 31d473b..35bc3c1 100644
--- a/xen/arch/x86/oprofile/op_x86_model.h
+++ b/xen/arch/x86/oprofile/op_x86_model.h
@@ -33,7 +33,7 @@ struct op_x86_model_spec {
 	void (*setup_ctrs)(struct op_msrs const * const msrs);
 	int (*check_ctrs)(unsigned int const cpu, 
 			  struct op_msrs const * const msrs,
-			  struct cpu_user_regs * const regs);
+			  struct cpu_user_regs const * const regs);
 	void (*start)(struct op_msrs const * const msrs);
 	void (*stop)(struct op_msrs const * const msrs);
 	int (*is_arch_pmu_msr)(u64 msr_index, int *type, int *index);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 8161585..44ac014 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -114,7 +114,7 @@ boolean_param("ler", opt_ler);
 #define stack_words_per_line 4
 #define ESP_BEFORE_EXCEPTION(regs) ((unsigned long *)regs->rsp)
 
-static void show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs)
+static void show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs)
 {
     int i;
     unsigned long *stack, addr;
@@ -290,7 +290,7 @@ static void show_trace(const struct cpu_user_regs *regs)
     printk("\n");
 }
 
-void show_stack(struct cpu_user_regs *regs)
+void show_stack(const struct cpu_user_regs *regs)
 {
     unsigned long *stack = ESP_BEFORE_EXCEPTION(regs), addr;
     int i;
@@ -349,7 +349,7 @@ void show_stack_overflow(unsigned int cpu, const struct cpu_user_regs *regs)
 #endif
 }
 
-void show_execution_state(struct cpu_user_regs *regs)
+void show_execution_state(const struct cpu_user_regs *regs)
 {
     show_registers(regs);
     show_stack(regs);
@@ -394,7 +394,7 @@ static const char *trapstr(unsigned int trapnr)
  * are disabled). In such situations we can't do much that is safe. We try to
  * print out some tracing and then we just spin.
  */
-void fatal_trap(int trapnr, struct cpu_user_regs *regs)
+void fatal_trap(int trapnr, const struct cpu_user_regs *regs)
 {
     static DEFINE_PER_CPU(char, depth);
 
@@ -1086,7 +1086,7 @@ void do_int3(struct cpu_user_regs *regs)
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-void do_machine_check(struct cpu_user_regs *regs)
+void do_machine_check(const struct cpu_user_regs *regs)
 {
     machine_check_vector(regs, regs->error_code);
 }
@@ -3240,7 +3240,7 @@ static void nmi_hwdom_report(unsigned int reason_idx)
     send_guest_trap(d, 0, TRAP_nmi);
 }
 
-static void pci_serr_error(struct cpu_user_regs *regs)
+static void pci_serr_error(const struct cpu_user_regs *regs)
 {
     outb((inb(0x61) & 0x0f) | 0x04, 0x61); /* clear-and-disable the PCI SERR error line. */
 
@@ -3260,7 +3260,7 @@ static void pci_serr_error(struct cpu_user_regs *regs)
     }
 }
 
-static void io_check_error(struct cpu_user_regs *regs)
+static void io_check_error(const struct cpu_user_regs *regs)
 {
     switch ( opt_nmi[0] )
     {
@@ -3279,7 +3279,7 @@ static void io_check_error(struct cpu_user_regs *regs)
     outb((inb(0x61) & 0x07) | 0x00, 0x61); /* enable IOCK */
 }
 
-static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char reason)
+static void unknown_nmi_error(const struct cpu_user_regs *regs, unsigned char reason)
 {
     switch ( opt_nmi[0] )
     {
@@ -3295,14 +3295,14 @@ static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char reason)
     }
 }
 
-static int dummy_nmi_callback(struct cpu_user_regs *regs, int cpu)
+static int dummy_nmi_callback(const struct cpu_user_regs *regs, int cpu)
 {
     return 0;
 }
  
 static nmi_callback_t nmi_callback = dummy_nmi_callback;
 
-void do_nmi(struct cpu_user_regs *regs)
+void do_nmi(const struct cpu_user_regs *regs)
 {
     unsigned int cpu = smp_processor_id();
     unsigned char reason;
diff --git a/xen/arch/x86/x86_64/compat/traps.c b/xen/arch/x86/x86_64/compat/traps.c
index 5f0ea0a..b6c2563 100644
--- a/xen/arch/x86/x86_64/compat/traps.c
+++ b/xen/arch/x86/x86_64/compat/traps.c
@@ -3,7 +3,7 @@
 #include <compat/callback.h>
 #include <compat/arch-x86_32.h>
 
-void compat_show_guest_stack(struct vcpu *v, struct cpu_user_regs *regs,
+void compat_show_guest_stack(struct vcpu *v, const struct cpu_user_regs *regs,
                              int debug_stack_lines)
 {
     unsigned int i, *stack, addr, mask = STACK_SIZE;
diff --git a/xen/arch/x86/x86_64/traps.c b/xen/arch/x86/x86_64/traps.c
index d09b6b6..650c33d 100644
--- a/xen/arch/x86/x86_64/traps.c
+++ b/xen/arch/x86/x86_64/traps.c
@@ -79,7 +79,7 @@ static void _show_registers(
            regs->gs, regs->ss, regs->cs);
 }
 
-void show_registers(struct cpu_user_regs *regs)
+void show_registers(const struct cpu_user_regs *regs)
 {
     struct cpu_user_regs fault_regs = *regs;
     unsigned long fault_crs[8];
diff --git a/xen/include/asm-x86/apic.h b/xen/include/asm-x86/apic.h
index 43b39ce..5d7623f 100644
--- a/xen/include/asm-x86/apic.h
+++ b/xen/include/asm-x86/apic.h
@@ -206,7 +206,7 @@ extern void release_lapic_nmi(void);
 extern void self_nmi(void);
 extern void disable_timer_nmi_watchdog(void);
 extern void enable_timer_nmi_watchdog(void);
-extern void nmi_watchdog_tick (struct cpu_user_regs *regs);
+extern void nmi_watchdog_tick (const struct cpu_user_regs *regs);
 extern int APIC_init_uniprocessor (void);
 extern void disable_APIC_timer(void);
 extern void enable_APIC_timer(void);
diff --git a/xen/include/asm-x86/nmi.h b/xen/include/asm-x86/nmi.h
index 58cd9a1..4504fe1 100644
--- a/xen/include/asm-x86/nmi.h
+++ b/xen/include/asm-x86/nmi.h
@@ -9,7 +9,7 @@ struct cpu_user_regs;
 /* Watchdog boolean from the command line */
 extern bool_t opt_watchdog;
  
-typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
+typedef int (*nmi_callback_t)(const struct cpu_user_regs *regs, int cpu);
  
 /** 
  * set_nmi_callback
diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h
index 4a60eb0..46107a6 100644
--- a/xen/include/asm-x86/processor.h
+++ b/xen/include/asm-x86/processor.h
@@ -477,27 +477,32 @@ static always_inline void rep_nop(void)
 
 #define cpu_relax() rep_nop()
 
-void show_stack(struct cpu_user_regs *regs);
+void show_stack(const struct cpu_user_regs *regs);
 void show_stack_overflow(unsigned int cpu, const struct cpu_user_regs *regs);
-void show_registers(struct cpu_user_regs *regs);
-void show_execution_state(struct cpu_user_regs *regs);
+void show_registers(const struct cpu_user_regs *regs);
+void show_execution_state(const struct cpu_user_regs *regs);
 #define dump_execution_state() run_in_exception_handler(show_execution_state)
 void show_page_walk(unsigned long addr);
-void noreturn fatal_trap(int trapnr, struct cpu_user_regs *regs);
+void noreturn fatal_trap(int trapnr, const struct cpu_user_regs *regs);
 
-void compat_show_guest_stack(struct vcpu *, struct cpu_user_regs *, int lines);
+void compat_show_guest_stack(struct vcpu *v,
+                             const struct cpu_user_regs *regs, int lines);
 
 extern void mtrr_ap_init(void);
 extern void mtrr_bp_init(void);
 
 void mcheck_init(struct cpuinfo_x86 *c, bool_t bsp);
 
-#define DECLARE_TRAP_HANDLER(_name)                     \
-void _name(void);                            \
-void do_ ## _name(struct cpu_user_regs *regs)
+#define DECLARE_TRAP_HANDLER(_name)                    \
+    void _name(void);                                  \
+    void do_ ## _name(struct cpu_user_regs *regs)
+#define DECLARE_TRAP_HANDLER_CONST(_name)              \
+    void _name(void);                                  \
+    void do_ ## _name(const struct cpu_user_regs *regs)
+
 DECLARE_TRAP_HANDLER(divide_error);
 DECLARE_TRAP_HANDLER(debug);
-DECLARE_TRAP_HANDLER(nmi);
+DECLARE_TRAP_HANDLER_CONST(nmi);
 DECLARE_TRAP_HANDLER(int3);
 DECLARE_TRAP_HANDLER(overflow);
 DECLARE_TRAP_HANDLER(bounds);
@@ -512,8 +517,10 @@ DECLARE_TRAP_HANDLER(page_fault);
 DECLARE_TRAP_HANDLER(early_page_fault);
 DECLARE_TRAP_HANDLER(coprocessor_error);
 DECLARE_TRAP_HANDLER(simd_coprocessor_error);
-DECLARE_TRAP_HANDLER(machine_check);
+DECLARE_TRAP_HANDLER_CONST(machine_check);
 DECLARE_TRAP_HANDLER(alignment_check);
+
+#undef DECLARE_TRAP_HANDLER_CONST
 #undef DECLARE_TRAP_HANDLER
 
 void trap_nop(void);
diff --git a/xen/include/asm-x86/traps.h b/xen/include/asm-x86/traps.h
index 556b133..47b7ab9 100644
--- a/xen/include/asm-x86/traps.h
+++ b/xen/include/asm-x86/traps.h
@@ -28,7 +28,7 @@ struct softirq_trap {
 
 struct cpu_user_regs;
 
-extern void machine_check_vector(struct cpu_user_regs *regs, long error_code);
+extern void machine_check_vector(const struct cpu_user_regs *regs, long error_code);
 
 void async_exception_cleanup(struct vcpu *);
  
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFA-0002Og-1M; Thu, 19 Jun 2014 04:46:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUF8-0002OU-Ef
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:34 +0000
Received: from [85.158.143.35:21580] by server-3.bemta-4.messagelabs.com id
	8A/80-16194-92B62A35; Thu, 19 Jun 2014 04:46:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403153192!12382130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23166 invoked from network); 19 Jun 2014 04:46:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUF5-0002dZ-TA
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUF5-00081z-RK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:31 +0000
Date: Thu, 19 Jun 2014 04:46:31 +0000
Message-Id: <E1WxUF5-00081z-RK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 38d4393462ad766fd10313f323a329be29a2f58e
Merge: 92f962f4a72f297a0e21bf1acbea4a685a487fc7 b6100a6cd5b9ff6de07726e3acf744454926c962
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 10 15:11:04 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 15:11:04 2014 +0100

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

 xen/arch/x86/alternative.c              |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.c      |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.h      |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c           |   12 ++++++------
 xen/arch/x86/cpu/mcheck/mce.h           |    4 ++--
 xen/arch/x86/cpu/mcheck/mce_amd.c       |    2 +-
 xen/arch/x86/cpu/mcheck/mce_intel.c     |   12 ++++++------
 xen/arch/x86/cpu/mcheck/x86_mca.h       |    2 +-
 xen/arch/x86/efi/boot.c                 |   13 ++++++++-----
 xen/arch/x86/hvm/hvm.c                  |    4 ++--
 xen/arch/x86/nmi.c                      |    2 +-
 xen/arch/x86/oprofile/nmi_int.c         |    2 +-
 xen/arch/x86/oprofile/op_model_athlon.c |    6 +++---
 xen/arch/x86/oprofile/op_model_p4.c     |    2 +-
 xen/arch/x86/oprofile/op_model_ppro.c   |    2 +-
 xen/arch/x86/oprofile/op_x86_model.h    |    2 +-
 xen/arch/x86/traps.c                    |   20 ++++++++++----------
 xen/arch/x86/x86_64/compat/traps.c      |    2 +-
 xen/arch/x86/x86_64/traps.c             |    2 +-
 xen/include/asm-x86/apic.h              |    2 +-
 xen/include/asm-x86/hvm/hvm.h           |   22 +++++++++++++++-------
 xen/include/asm-x86/nmi.h               |    2 +-
 xen/include/asm-x86/processor.h         |   27 +++++++++++++++++----------
 xen/include/asm-x86/traps.h             |    2 +-
 24 files changed, 84 insertions(+), 66 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFA-0002Og-1M; Thu, 19 Jun 2014 04:46:36 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUF8-0002OU-Ef
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:34 +0000
Received: from [85.158.143.35:21580] by server-3.bemta-4.messagelabs.com id
	8A/80-16194-92B62A35; Thu, 19 Jun 2014 04:46:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403153192!12382130!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23166 invoked from network); 19 Jun 2014 04:46:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUF5-0002dZ-TA
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUF5-00081z-RK
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:31 +0000
Date: Thu, 19 Jun 2014 04:46:31 +0000
Message-Id: <E1WxUF5-00081z-RK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 38d4393462ad766fd10313f323a329be29a2f58e
Merge: 92f962f4a72f297a0e21bf1acbea4a685a487fc7 b6100a6cd5b9ff6de07726e3acf744454926c962
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 10 15:11:04 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 15:11:04 2014 +0100

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

 xen/arch/x86/alternative.c              |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.c      |    2 +-
 xen/arch/x86/cpu/mcheck/mcaction.h      |    2 +-
 xen/arch/x86/cpu/mcheck/mce.c           |   12 ++++++------
 xen/arch/x86/cpu/mcheck/mce.h           |    4 ++--
 xen/arch/x86/cpu/mcheck/mce_amd.c       |    2 +-
 xen/arch/x86/cpu/mcheck/mce_intel.c     |   12 ++++++------
 xen/arch/x86/cpu/mcheck/x86_mca.h       |    2 +-
 xen/arch/x86/efi/boot.c                 |   13 ++++++++-----
 xen/arch/x86/hvm/hvm.c                  |    4 ++--
 xen/arch/x86/nmi.c                      |    2 +-
 xen/arch/x86/oprofile/nmi_int.c         |    2 +-
 xen/arch/x86/oprofile/op_model_athlon.c |    6 +++---
 xen/arch/x86/oprofile/op_model_p4.c     |    2 +-
 xen/arch/x86/oprofile/op_model_ppro.c   |    2 +-
 xen/arch/x86/oprofile/op_x86_model.h    |    2 +-
 xen/arch/x86/traps.c                    |   20 ++++++++++----------
 xen/arch/x86/x86_64/compat/traps.c      |    2 +-
 xen/arch/x86/x86_64/traps.c             |    2 +-
 xen/include/asm-x86/apic.h              |    2 +-
 xen/include/asm-x86/hvm/hvm.h           |   22 +++++++++++++++-------
 xen/include/asm-x86/nmi.h               |    2 +-
 xen/include/asm-x86/processor.h         |   27 +++++++++++++++++----------
 xen/include/asm-x86/traps.h             |    2 +-
 24 files changed, 84 insertions(+), 66 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:46 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFK-0002Qf-65; Thu, 19 Jun 2014 04:46:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFI-0002QK-JH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:44 +0000
Received: from [85.158.139.211:36596] by server-5.bemta-5.messagelabs.com id
	D8/B3-23588-33B62A35; Thu, 19 Jun 2014 04:46:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1403153202!6643406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21378 invoked from network); 19 Jun 2014 04:46:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFG-0002df-7a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFG-00082M-0p
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:42 +0000
Date: Thu, 19 Jun 2014 04:46:42 +0000
Message-Id: <E1WxUFG-00082M-0p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arch/arm: domain build: let dom0
	access I/O memory of mapped devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33233c27583458e9205bd1d156cff976d06a83db
Author:     Arianna Avanzini <avanzini.arianna@gmail.com>
AuthorDate: Sun May 25 12:51:42 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 15:26:26 2014 +0100

    arch/arm: domain build: let dom0 access I/O memory of mapped devices
    
    Currently, dom0 is allowed access to the I/O memory ranges used
    to access devices exposed to it, but it doesn't have those
    ranges in its iomem_caps. This commit implements the correct
    bookkeeping in the generic function which actually maps a
    device's I/O memory to the domain, adding the ranges to the
    domain's iomem_caps.
    
    NOTE: This commit suffers from the following limitations;
          . with this patch, I/O memory ranges pertaining disabled
            devices are not mapped;
          . the "iomem" option could be used to map memory ranges that
            are not described in the device tree.
          In both these cases, this patch does not allow the domain
          the privileges needed to map the needed I/O memory ranges
          afterwards.
    
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
    Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@citrix.com>
    Cc: Dario Faggioli <dario.faggioli@citrix.com>
    Cc: Paolo Valente <paolo.valente@unimore.it>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Jan Beulich <JBeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Cc: Eric Trudeau <etrudeau@broadcom.com>
    Cc: Viktor Kleinik <viktor.kleinik@globallogic.com>
---
 xen/arch/arm/domain_build.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 46a3619..9d9cba9 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -11,6 +11,7 @@
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
+#include <xen/iocap.h>
 #include <asm/device.h>
 #include <asm/setup.h>
 #include <asm/platform.h>
@@ -763,6 +764,16 @@ static int map_device(struct domain *d, struct dt_device_node *dev)
         DPRINT("addr %u = 0x%"PRIx64" - 0x%"PRIx64"\n",
                i, addr, addr + size - 1);
 
+        res = iomem_permit_access(d, paddr_to_pfn(addr & PAGE_MASK),
+                                  paddr_to_pfn(PAGE_ALIGN(addr + size - 1)));
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to permit to dom%d access to"
+                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
+                   d->domain_id,
+                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+            return res;
+        }
         res = map_mmio_regions(d, addr & PAGE_MASK,
                                PAGE_ALIGN(addr + size) - 1,
                                addr & PAGE_MASK);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:46 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFK-0002Qf-65; Thu, 19 Jun 2014 04:46:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFI-0002QK-JH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:44 +0000
Received: from [85.158.139.211:36596] by server-5.bemta-5.messagelabs.com id
	D8/B3-23588-33B62A35; Thu, 19 Jun 2014 04:46:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-206.messagelabs.com!1403153202!6643406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21378 invoked from network); 19 Jun 2014 04:46:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFG-0002df-7a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFG-00082M-0p
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:42 +0000
Date: Thu, 19 Jun 2014 04:46:42 +0000
Message-Id: <E1WxUFG-00082M-0p@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] arch/arm: domain build: let dom0
	access I/O memory of mapped devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 33233c27583458e9205bd1d156cff976d06a83db
Author:     Arianna Avanzini <avanzini.arianna@gmail.com>
AuthorDate: Sun May 25 12:51:42 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 15:26:26 2014 +0100

    arch/arm: domain build: let dom0 access I/O memory of mapped devices
    
    Currently, dom0 is allowed access to the I/O memory ranges used
    to access devices exposed to it, but it doesn't have those
    ranges in its iomem_caps. This commit implements the correct
    bookkeeping in the generic function which actually maps a
    device's I/O memory to the domain, adding the ranges to the
    domain's iomem_caps.
    
    NOTE: This commit suffers from the following limitations;
          . with this patch, I/O memory ranges pertaining disabled
            devices are not mapped;
          . the "iomem" option could be used to map memory ranges that
            are not described in the device tree.
          In both these cases, this patch does not allow the domain
          the privileges needed to map the needed I/O memory ranges
          afterwards.
    
    Signed-off-by: Arianna Avanzini <avanzini.arianna@gmail.com>
    Acked-by: Ian Campbell <Ian.Campbell@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@citrix.com>
    Cc: Dario Faggioli <dario.faggioli@citrix.com>
    Cc: Paolo Valente <paolo.valente@unimore.it>
    Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Cc: Jan Beulich <JBeulich@suse.com>
    Cc: Keir Fraser <keir@xen.org>
    Cc: Tim Deegan <tim@xen.org>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Andrew Cooper <andrew.cooper3@citrix.com>
    Cc: Eric Trudeau <etrudeau@broadcom.com>
    Cc: Viktor Kleinik <viktor.kleinik@globallogic.com>
---
 xen/arch/arm/domain_build.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 46a3619..9d9cba9 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -11,6 +11,7 @@
 #include <xen/device_tree.h>
 #include <xen/libfdt/libfdt.h>
 #include <xen/guest_access.h>
+#include <xen/iocap.h>
 #include <asm/device.h>
 #include <asm/setup.h>
 #include <asm/platform.h>
@@ -763,6 +764,16 @@ static int map_device(struct domain *d, struct dt_device_node *dev)
         DPRINT("addr %u = 0x%"PRIx64" - 0x%"PRIx64"\n",
                i, addr, addr + size - 1);
 
+        res = iomem_permit_access(d, paddr_to_pfn(addr & PAGE_MASK),
+                                  paddr_to_pfn(PAGE_ALIGN(addr + size - 1)));
+        if ( res )
+        {
+            printk(XENLOG_ERR "Unable to permit to dom%d access to"
+                   " 0x%"PRIx64" - 0x%"PRIx64"\n",
+                   d->domain_id,
+                   addr & PAGE_MASK, PAGE_ALIGN(addr + size) - 1);
+            return res;
+        }
         res = map_mmio_regions(d, addr & PAGE_MASK,
                                PAGE_ALIGN(addr + size) - 1,
                                addr & PAGE_MASK);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFU-0002SN-8y; Thu, 19 Jun 2014 04:46:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFT-0002S7-5D
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:55 +0000
Received: from [193.109.254.147:10017] by server-1.bemta-14.messagelabs.com id
	9B/98-00839-E3B62A35; Thu, 19 Jun 2014 04:46:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403153212!12250037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20793 invoked from network); 19 Jun 2014 04:46:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFQ-0002dl-Ev
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFQ-00082i-Ch
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:52 +0000
Date: Thu, 19 Jun 2014 04:46:52 +0000
Message-Id: <E1WxUFQ-00082i-Ch@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Introduce ARRAY_SIZE()
	and replace handrolled examples
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7528dcd02de1fa72acbc841a3608046549a163a2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 15:07:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 16:04:03 2014 +0100

    tools/libxc: Introduce ARRAY_SIZE() and replace handrolled examples
    
    xen-hptool and xen-mfndump include xc_private.h.  This is bad, but not trivial
    to fix, so they gain a protective #undef and a stern comment.
    
    MiniOS leaks ARRAY_SIZE into the libxc namespace as part of a stubdom build.
    Therefore, xc_private.h gains an #ifndef until MiniOS is fixed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_arm.c |    2 +-
 tools/libxc/xc_dom_x86.c |    4 ++--
 tools/libxc/xc_minios.c  |    2 +-
 tools/libxc/xc_private.h |    5 +++++
 tools/misc/xen-hptool.c  |    1 +
 tools/misc/xen-mfndump.c |    1 +
 6 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 75f8363..cc64363 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -230,7 +230,7 @@ static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
 
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
-    for ( i = 0; i < sizeof(types)/sizeof(types[0]); i++ )
+    for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;
     if ( domctl.u.address_size.size == 0 )
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index e034d62..bf06fe4 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -716,7 +716,7 @@ static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
     memset(&domctl, 0, sizeof(domctl));
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
-    for ( i = 0; i < sizeof(types)/sizeof(types[0]); i++ )
+    for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;
     if ( domctl.u.address_size.size == 0 )
@@ -887,7 +887,7 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
     xen_pfn_t shinfo;
     int i, rc;
 
-    for ( i = 0; i < sizeof(types) / sizeof(types[0]); i++ )
+    for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, dom->guest_type) )
             pgd_type = types[i].pgd_type;
 
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index e621417..e703684 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -87,7 +87,7 @@ static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
     int i, ret;
 
     call.op = hypercall->op;
-    for (i = 0; i < sizeof(hypercall->arg) / sizeof(*hypercall->arg); i++)
+    for (i = 0; i < ARRAY_SIZE(hypercall->arg); i++)
 	call.args[i] = hypercall->arg[i];
 
     ret = HYPERVISOR_multicall(&call, 1);
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 12476ec..4447cec 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -54,6 +54,11 @@
 #define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); }))
 #endif
 
+#ifndef ARRAY_SIZE /* MiniOS leaks ARRAY_SIZE into our namespace as part of a
+                    * stubdom build.  It shouldn't... */
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
 /*
 ** Define max dirty page cache to permit during save/restore -- need to balance 
 ** keeping cache usage down with CPU impact of invalidating too often.
diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c
index d0e8e90..1134603 100644
--- a/tools/misc/xen-hptool.c
+++ b/tools/misc/xen-hptool.c
@@ -4,6 +4,7 @@
 #include <xenstore.h>
 #include <unistd.h>
 
+#undef ARRAY_SIZE /* We shouldn't be including xc_private.h */
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 static xc_interface *xch;
diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index 1af3bd8..0761f6e 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -6,6 +6,7 @@
 
 #include "xg_save_restore.h"
 
+#undef ARRAY_SIZE /* We shouldn't be including xc_private.h */
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 static xc_interface *xch;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFU-0002SN-8y; Thu, 19 Jun 2014 04:46:56 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFT-0002S7-5D
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:55 +0000
Received: from [193.109.254.147:10017] by server-1.bemta-14.messagelabs.com id
	9B/98-00839-E3B62A35; Thu, 19 Jun 2014 04:46:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403153212!12250037!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20793 invoked from network); 19 Jun 2014 04:46:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:46:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFQ-0002dl-Ev
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFQ-00082i-Ch
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:52 +0000
Date: Thu, 19 Jun 2014 04:46:52 +0000
Message-Id: <E1WxUFQ-00082i-Ch@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Introduce ARRAY_SIZE()
	and replace handrolled examples
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7528dcd02de1fa72acbc841a3608046549a163a2
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 15:07:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 16:04:03 2014 +0100

    tools/libxc: Introduce ARRAY_SIZE() and replace handrolled examples
    
    xen-hptool and xen-mfndump include xc_private.h.  This is bad, but not trivial
    to fix, so they gain a protective #undef and a stern comment.
    
    MiniOS leaks ARRAY_SIZE into the libxc namespace as part of a stubdom build.
    Therefore, xc_private.h gains an #ifndef until MiniOS is fixed.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_arm.c |    2 +-
 tools/libxc/xc_dom_x86.c |    4 ++--
 tools/libxc/xc_minios.c  |    2 +-
 tools/libxc/xc_private.h |    5 +++++
 tools/misc/xen-hptool.c  |    1 +
 tools/misc/xen-mfndump.c |    1 +
 6 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/xc_dom_arm.c b/tools/libxc/xc_dom_arm.c
index 75f8363..cc64363 100644
--- a/tools/libxc/xc_dom_arm.c
+++ b/tools/libxc/xc_dom_arm.c
@@ -230,7 +230,7 @@ static int set_mode(xc_interface *xch, domid_t domid, char *guest_type)
 
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
-    for ( i = 0; i < sizeof(types)/sizeof(types[0]); i++ )
+    for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;
     if ( domctl.u.address_size.size == 0 )
diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
index e034d62..bf06fe4 100644
--- a/tools/libxc/xc_dom_x86.c
+++ b/tools/libxc/xc_dom_x86.c
@@ -716,7 +716,7 @@ static int x86_compat(xc_interface *xch, domid_t domid, char *guest_type)
     memset(&domctl, 0, sizeof(domctl));
     domctl.domain = domid;
     domctl.cmd    = XEN_DOMCTL_set_address_size;
-    for ( i = 0; i < sizeof(types)/sizeof(types[0]); i++ )
+    for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, guest_type) )
             domctl.u.address_size.size = types[i].size;
     if ( domctl.u.address_size.size == 0 )
@@ -887,7 +887,7 @@ int arch_setup_bootlate(struct xc_dom_image *dom)
     xen_pfn_t shinfo;
     int i, rc;
 
-    for ( i = 0; i < sizeof(types) / sizeof(types[0]); i++ )
+    for ( i = 0; i < ARRAY_SIZE(types); i++ )
         if ( !strcmp(types[i].guest, dom->guest_type) )
             pgd_type = types[i].pgd_type;
 
diff --git a/tools/libxc/xc_minios.c b/tools/libxc/xc_minios.c
index e621417..e703684 100644
--- a/tools/libxc/xc_minios.c
+++ b/tools/libxc/xc_minios.c
@@ -87,7 +87,7 @@ static int minios_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h, privcm
     int i, ret;
 
     call.op = hypercall->op;
-    for (i = 0; i < sizeof(hypercall->arg) / sizeof(*hypercall->arg); i++)
+    for (i = 0; i < ARRAY_SIZE(hypercall->arg); i++)
 	call.args[i] = hypercall->arg[i];
 
     ret = HYPERVISOR_multicall(&call, 1);
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 12476ec..4447cec 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -54,6 +54,11 @@
 #define XC_BUILD_BUG_ON(p) ((void)sizeof(struct { int:-!!(p); }))
 #endif
 
+#ifndef ARRAY_SIZE /* MiniOS leaks ARRAY_SIZE into our namespace as part of a
+                    * stubdom build.  It shouldn't... */
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#endif
+
 /*
 ** Define max dirty page cache to permit during save/restore -- need to balance 
 ** keeping cache usage down with CPU impact of invalidating too often.
diff --git a/tools/misc/xen-hptool.c b/tools/misc/xen-hptool.c
index d0e8e90..1134603 100644
--- a/tools/misc/xen-hptool.c
+++ b/tools/misc/xen-hptool.c
@@ -4,6 +4,7 @@
 #include <xenstore.h>
 #include <unistd.h>
 
+#undef ARRAY_SIZE /* We shouldn't be including xc_private.h */
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 static xc_interface *xch;
diff --git a/tools/misc/xen-mfndump.c b/tools/misc/xen-mfndump.c
index 1af3bd8..0761f6e 100644
--- a/tools/misc/xen-mfndump.c
+++ b/tools/misc/xen-mfndump.c
@@ -6,6 +6,7 @@
 
 #include "xg_save_restore.h"
 
+#undef ARRAY_SIZE /* We shouldn't be including xc_private.h */
 #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0]))
 
 static xc_interface *xch;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFX-0002TB-C8; Thu, 19 Jun 2014 04:46:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFV-0002Ss-S3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:58 +0000
Received: from [193.109.254.147:14167] by server-2.bemta-14.messagelabs.com id
	B2/FF-21684-14B62A35; Thu, 19 Jun 2014 04:46:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1403152657!12261078!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7425 invoked from network); 19 Jun 2014 04:37:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6T-0002Ti-KM
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6T-0007ak-IL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:37 +0000
Date: Thu, 19 Jun 2014 04:37:37 +0000
Message-Id: <E1WxU6T-0007ak-IL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drivers/passthrough: arm: Add support
	for SMMU drivers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d9e61eb2d2c83356f51939f2be034064e13afc8a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue May 27 12:11:40 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 16:46:00 2014 +0100

    drivers/passthrough: arm: Add support for SMMU drivers
    
    This patch add support for ARM architected SMMU driver. It's based on the
    linux drivers (drivers/iommu/arm-smmu) commit 89ac23cd.
    
    The major differences with the Linux driver are:
        - Fault by default if the SMMU is enabled to translate an
        address (Linux is bypassing the SMMU)
        - Using P2M page table instead of creating new one
        - Dropped stage-1 support
        - Dropped chained SMMUs support for now
        - Reworking device assignment and the different structures
    
    Xen is programming each IOMMU by:
        - Using stage-2 mode translation
        - Sharing the page table with the processor
        - Injecting a fault if the device has made a wrong translation
    
    Signed-off-by: Julien Grall<julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/passthrough/arm/Makefile |    1 +
 xen/drivers/passthrough/arm/smmu.c   | 1742 ++++++++++++++++++++++++++++++++++
 2 files changed, 1743 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/arm/Makefile b/xen/drivers/passthrough/arm/Makefile
index 0484b79..f4cd26e 100644
--- a/xen/drivers/passthrough/arm/Makefile
+++ b/xen/drivers/passthrough/arm/Makefile
@@ -1 +1,2 @@
 obj-y += iommu.o
+obj-y += smmu.o
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
new file mode 100644
index 0000000..21b4572
--- /dev/null
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -0,0 +1,1742 @@
+/*
+ * IOMMU API for ARM architected SMMU implementations.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * Based on Linux drivers/iommu/arm-smmu.c (commit 89a23cd)
+ * Copyright (C) 2013 ARM Limited
+ *
+ * Author: Will Deacon <will.deacon@arm.com>
+ *
+ * Xen modification:
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2014 Linaro Limited.
+ *
+ * This driver currently supports:
+ *  - SMMUv1 and v2 implementations (didn't try v2 SMMU)
+ *  - Stream-matching and stream-indexing
+ *  - v7/v8 long-descriptor format
+ *  - Non-secure access to the SMMU
+ *  - 4k pages, p2m shared with the processor
+ *  - Up to 40-bit addressing
+ *  - Context fault reporting
+ */
+
+#include <xen/config.h>
+#include <xen/delay.h>
+#include <xen/errno.h>
+#include <xen/irq.h>
+#include <xen/lib.h>
+#include <xen/list.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <xen/rbtree.h>
+#include <xen/sched.h>
+#include <asm/atomic.h>
+#include <asm/device.h>
+#include <asm/io.h>
+#include <asm/platform.h>
+
+/* Driver options */
+#define SMMU_OPT_SECURE_CONFIG_ACCESS   (1 << 0)
+
+/* Maximum number of stream IDs assigned to a single device */
+#define MAX_MASTER_STREAMIDS    MAX_PHANDLE_ARGS
+
+/* Maximum stream ID */
+#define SMMU_MAX_STREAMIDS      (PAGE_SIZE_64K - 1)
+
+/* Maximum number of context banks per SMMU */
+#define SMMU_MAX_CBS        128
+
+/* Maximum number of mapping groups per SMMU */
+#define SMMU_MAX_SMRS       128
+
+/* SMMU global address space */
+#define SMMU_GR0(smmu)      ((smmu)->base)
+#define SMMU_GR1(smmu)      ((smmu)->base + (smmu)->pagesize)
+
+/*
+ * SMMU global address space with conditional offset to access secure aliases of
+ * non-secure registers (e.g. nsCR0: 0x400, nsGFSR: 0x448, nsGFSYNR0: 0x450)
+ */
+#define SMMU_GR0_NS(smmu)                                   \
+    ((smmu)->base +                                         \
+     ((smmu->options & SMMU_OPT_SECURE_CONFIG_ACCESS)    \
+        ? 0x400 : 0))
+
+/* Page table bits */
+#define SMMU_PTE_PAGE           (((pteval_t)3) << 0)
+#define SMMU_PTE_CONT           (((pteval_t)1) << 52)
+#define SMMU_PTE_AF             (((pteval_t)1) << 10)
+#define SMMU_PTE_SH_NS          (((pteval_t)0) << 8)
+#define SMMU_PTE_SH_OS          (((pteval_t)2) << 8)
+#define SMMU_PTE_SH_IS          (((pteval_t)3) << 8)
+
+#if PAGE_SIZE == PAGE_SIZE_4K
+#define SMMU_PTE_CONT_ENTRIES   16
+#elif PAGE_SIZE == PAGE_SIZE_64K
+#define SMMU_PTE_CONT_ENTRIES   32
+#else
+#define SMMU_PTE_CONT_ENTRIES   1
+#endif
+
+#define SMMU_PTE_CONT_SIZE      (PAGE_SIZE * SMMU_PTE_CONT_ENTRIES)
+#define SMMU_PTE_CONT_MASK      (~(SMMU_PTE_CONT_SIZE - 1))
+#define SMMU_PTE_HWTABLE_SIZE   (PTRS_PER_PTE * sizeof(pte_t))
+
+/* Stage-1 PTE */
+#define SMMU_PTE_AP_UNPRIV      (((pteval_t)1) << 6)
+#define SMMU_PTE_AP_RDONLY      (((pteval_t)2) << 6)
+#define SMMU_PTE_ATTRINDX_SHIFT 2
+#define SMMU_PTE_nG             (((pteval_t)1) << 11)
+
+/* Stage-2 PTE */
+#define SMMU_PTE_HAP_FAULT      (((pteval_t)0) << 6)
+#define SMMU_PTE_HAP_READ       (((pteval_t)1) << 6)
+#define SMMU_PTE_HAP_WRITE      (((pteval_t)2) << 6)
+#define SMMU_PTE_MEMATTR_OIWB   (((pteval_t)0xf) << 2)
+#define SMMU_PTE_MEMATTR_NC     (((pteval_t)0x5) << 2)
+#define SMMU_PTE_MEMATTR_DEV    (((pteval_t)0x1) << 2)
+
+/* Configuration registers */
+#define SMMU_GR0_sCR0           0x0
+#define SMMU_sCR0_CLIENTPD      (1 << 0)
+#define SMMU_sCR0_GFRE          (1 << 1)
+#define SMMU_sCR0_GFIE          (1 << 2)
+#define SMMU_sCR0_GCFGFRE       (1 << 4)
+#define SMMU_sCR0_GCFGFIE       (1 << 5)
+#define SMMU_sCR0_USFCFG        (1 << 10)
+#define SMMU_sCR0_VMIDPNE       (1 << 11)
+#define SMMU_sCR0_PTM           (1 << 12)
+#define SMMU_sCR0_FB            (1 << 13)
+#define SMMU_sCR0_BSU_SHIFT     14
+#define SMMU_sCR0_BSU_MASK      0x3
+
+/* Identification registers */
+#define SMMU_GR0_ID0            0x20
+#define SMMU_GR0_ID1            0x24
+#define SMMU_GR0_ID2            0x28
+#define SMMU_GR0_ID3            0x2c
+#define SMMU_GR0_ID4            0x30
+#define SMMU_GR0_ID5            0x34
+#define SMMU_GR0_ID6            0x38
+#define SMMU_GR0_ID7            0x3c
+#define SMMU_GR0_sGFSR          0x48
+#define SMMU_GR0_sGFSYNR0       0x50
+#define SMMU_GR0_sGFSYNR1       0x54
+#define SMMU_GR0_sGFSYNR2       0x58
+#define SMMU_GR0_PIDR0          0xfe0
+#define SMMU_GR0_PIDR1          0xfe4
+#define SMMU_GR0_PIDR2          0xfe8
+
+#define SMMU_ID0_S1TS           (1 << 30)
+#define SMMU_ID0_S2TS           (1 << 29)
+#define SMMU_ID0_NTS            (1 << 28)
+#define SMMU_ID0_SMS            (1 << 27)
+#define SMMU_ID0_PTFS_SHIFT     24
+#define SMMU_ID0_PTFS_MASK      0x2
+#define SMMU_ID0_PTFS_V8_ONLY   0x2
+#define SMMU_ID0_CTTW           (1 << 14)
+#define SMMU_ID0_NUMIRPT_SHIFT  16
+#define SMMU_ID0_NUMIRPT_MASK   0xff
+#define SMMU_ID0_NUMSMRG_SHIFT  0
+#define SMMU_ID0_NUMSMRG_MASK   0xff
+
+#define SMMU_ID1_PAGESIZE            (1 << 31)
+#define SMMU_ID1_NUMPAGENDXB_SHIFT   28
+#define SMMU_ID1_NUMPAGENDXB_MASK    7
+#define SMMU_ID1_NUMS2CB_SHIFT       16
+#define SMMU_ID1_NUMS2CB_MASK        0xff
+#define SMMU_ID1_NUMCB_SHIFT         0
+#define SMMU_ID1_NUMCB_MASK          0xff
+
+#define SMMU_ID2_OAS_SHIFT           4
+#define SMMU_ID2_OAS_MASK            0xf
+#define SMMU_ID2_IAS_SHIFT           0
+#define SMMU_ID2_IAS_MASK            0xf
+#define SMMU_ID2_UBS_SHIFT           8
+#define SMMU_ID2_UBS_MASK            0xf
+#define SMMU_ID2_PTFS_4K             (1 << 12)
+#define SMMU_ID2_PTFS_16K            (1 << 13)
+#define SMMU_ID2_PTFS_64K            (1 << 14)
+
+#define SMMU_PIDR2_ARCH_SHIFT        4
+#define SMMU_PIDR2_ARCH_MASK         0xf
+
+/* Global TLB invalidation */
+#define SMMU_GR0_STLBIALL           0x60
+#define SMMU_GR0_TLBIVMID           0x64
+#define SMMU_GR0_TLBIALLNSNH        0x68
+#define SMMU_GR0_TLBIALLH           0x6c
+#define SMMU_GR0_sTLBGSYNC          0x70
+#define SMMU_GR0_sTLBGSTATUS        0x74
+#define SMMU_sTLBGSTATUS_GSACTIVE   (1 << 0)
+#define SMMU_TLB_LOOP_TIMEOUT       1000000 /* 1s! */
+
+/* Stream mapping registers */
+#define SMMU_GR0_SMR(n)             (0x800 + ((n) << 2))
+#define SMMU_SMR_VALID              (1 << 31)
+#define SMMU_SMR_MASK_SHIFT         16
+#define SMMU_SMR_MASK_MASK          0x7fff
+#define SMMU_SMR_ID_SHIFT           0
+#define SMMU_SMR_ID_MASK            0x7fff
+
+#define SMMU_GR0_S2CR(n)        (0xc00 + ((n) << 2))
+#define SMMU_S2CR_CBNDX_SHIFT   0
+#define SMMU_S2CR_CBNDX_MASK    0xff
+#define SMMU_S2CR_TYPE_SHIFT    16
+#define SMMU_S2CR_TYPE_MASK     0x3
+#define SMMU_S2CR_TYPE_TRANS    (0 << SMMU_S2CR_TYPE_SHIFT)
+#define SMMU_S2CR_TYPE_BYPASS   (1 << SMMU_S2CR_TYPE_SHIFT)
+#define SMMU_S2CR_TYPE_FAULT    (2 << SMMU_S2CR_TYPE_SHIFT)
+
+/* Context bank attribute registers */
+#define SMMU_GR1_CBAR(n)                    (0x0 + ((n) << 2))
+#define SMMU_CBAR_VMID_SHIFT                0
+#define SMMU_CBAR_VMID_MASK                 0xff
+#define SMMU_CBAR_S1_MEMATTR_SHIFT          12
+#define SMMU_CBAR_S1_MEMATTR_MASK           0xf
+#define SMMU_CBAR_S1_MEMATTR_WB             0xf
+#define SMMU_CBAR_TYPE_SHIFT                16
+#define SMMU_CBAR_TYPE_MASK                 0x3
+#define SMMU_CBAR_TYPE_S2_TRANS             (0 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_TYPE_S1_TRANS_S2_BYPASS   (1 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_TYPE_S1_TRANS_S2_FAULT    (2 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_TYPE_S1_TRANS_S2_TRANS    (3 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_IRPTNDX_SHIFT             24
+#define SMMU_CBAR_IRPTNDX_MASK              0xff
+
+#define SMMU_GR1_CBA2R(n)                   (0x800 + ((n) << 2))
+#define SMMU_CBA2R_RW64_32BIT               (0 << 0)
+#define SMMU_CBA2R_RW64_64BIT               (1 << 0)
+
+/* Translation context bank */
+#define SMMU_CB_BASE(smmu)                  ((smmu)->base + ((smmu)->size >> 1))
+#define SMMU_CB(smmu, n)                    ((n) * (smmu)->pagesize)
+
+#define SMMU_CB_SCTLR                       0x0
+#define SMMU_CB_RESUME                      0x8
+#define SMMU_CB_TCR2                        0x10
+#define SMMU_CB_TTBR0_LO                    0x20
+#define SMMU_CB_TTBR0_HI                    0x24
+#define SMMU_CB_TCR                         0x30
+#define SMMU_CB_S1_MAIR0                    0x38
+#define SMMU_CB_FSR                         0x58
+#define SMMU_CB_FAR_LO                      0x60
+#define SMMU_CB_FAR_HI                      0x64
+#define SMMU_CB_FSYNR0                      0x68
+#define SMMU_CB_S1_TLBIASID                 0x610
+
+#define SMMU_SCTLR_S1_ASIDPNE               (1 << 12)
+#define SMMU_SCTLR_CFCFG                    (1 << 7)
+#define SMMU_SCTLR_CFIE                     (1 << 6)
+#define SMMU_SCTLR_CFRE                     (1 << 5)
+#define SMMU_SCTLR_E                        (1 << 4)
+#define SMMU_SCTLR_AFE                      (1 << 2)
+#define SMMU_SCTLR_TRE                      (1 << 1)
+#define SMMU_SCTLR_M                        (1 << 0)
+#define SMMU_SCTLR_EAE_SBOP                 (SMMU_SCTLR_AFE | SMMU_SCTLR_TRE)
+
+#define SMMU_RESUME_RETRY                   (0 << 0)
+#define SMMU_RESUME_TERMINATE               (1 << 0)
+
+#define SMMU_TCR_EAE                        (1 << 31)
+
+#define SMMU_TCR_PASIZE_SHIFT               16
+#define SMMU_TCR_PASIZE_MASK                0x7
+
+#define SMMU_TCR_TG0_4K                     (0 << 14)
+#define SMMU_TCR_TG0_64K                    (1 << 14)
+
+#define SMMU_TCR_SH0_SHIFT                  12
+#define SMMU_TCR_SH0_MASK                   0x3
+#define SMMU_TCR_SH_NS                      0
+#define SMMU_TCR_SH_OS                      2
+#define SMMU_TCR_SH_IS                      3
+
+#define SMMU_TCR_ORGN0_SHIFT                10
+#define SMMU_TCR_IRGN0_SHIFT                8
+#define SMMU_TCR_RGN_MASK                   0x3
+#define SMMU_TCR_RGN_NC                     0
+#define SMMU_TCR_RGN_WBWA                   1
+#define SMMU_TCR_RGN_WT                     2
+#define SMMU_TCR_RGN_WB                     3
+
+#define SMMU_TCR_SL0_SHIFT                  6
+#define SMMU_TCR_SL0_MASK                   0x3
+#define SMMU_TCR_SL0_LVL_2                  0
+#define SMMU_TCR_SL0_LVL_1                  1
+
+#define SMMU_TCR_T1SZ_SHIFT                 16
+#define SMMU_TCR_T0SZ_SHIFT                 0
+#define SMMU_TCR_SZ_MASK                    0xf
+
+#define SMMU_TCR2_SEP_SHIFT                 15
+#define SMMU_TCR2_SEP_MASK                  0x7
+
+#define SMMU_TCR2_PASIZE_SHIFT              0
+#define SMMU_TCR2_PASIZE_MASK               0x7
+
+/* Common definitions for PASize and SEP fields */
+#define SMMU_TCR2_ADDR_32                   0
+#define SMMU_TCR2_ADDR_36                   1
+#define SMMU_TCR2_ADDR_40                   2
+#define SMMU_TCR2_ADDR_42                   3
+#define SMMU_TCR2_ADDR_44                   4
+#define SMMU_TCR2_ADDR_48                   5
+
+#define SMMU_TTBRn_HI_ASID_SHIFT            16
+
+#define SMMU_MAIR_ATTR_SHIFT(n)             ((n) << 3)
+#define SMMU_MAIR_ATTR_MASK                 0xff
+#define SMMU_MAIR_ATTR_DEVICE               0x04
+#define SMMU_MAIR_ATTR_NC                   0x44
+#define SMMU_MAIR_ATTR_WBRWA                0xff
+#define SMMU_MAIR_ATTR_IDX_NC               0
+#define SMMU_MAIR_ATTR_IDX_CACHE            1
+#define SMMU_MAIR_ATTR_IDX_DEV              2
+
+#define SMMU_FSR_MULTI                      (1 << 31)
+#define SMMU_FSR_SS                         (1 << 30)
+#define SMMU_FSR_UUT                        (1 << 8)
+#define SMMU_FSR_ASF                        (1 << 7)
+#define SMMU_FSR_TLBLKF                     (1 << 6)
+#define SMMU_FSR_TLBMCF                     (1 << 5)
+#define SMMU_FSR_EF                         (1 << 4)
+#define SMMU_FSR_PF                         (1 << 3)
+#define SMMU_FSR_AFF                        (1 << 2)
+#define SMMU_FSR_TF                         (1 << 1)
+
+#define SMMU_FSR_IGN                        (SMMU_FSR_AFF | SMMU_FSR_ASF |    \
+                                             SMMU_FSR_TLBMCF | SMMU_FSR_TLBLKF)
+#define SMMU_FSR_FAULT                      (SMMU_FSR_MULTI | SMMU_FSR_SS |   \
+                                             SMMU_FSR_UUT | SMMU_FSR_EF |     \
+                                             SMMU_FSR_PF | SMMU_FSR_TF |      \
+                                             SMMU_FSR_IGN)
+
+#define SMMU_FSYNR0_WNR                     (1 << 4)
+
+#define smmu_print(dev, lvl, fmt, ...)                                        \
+    printk(lvl "smmu: %s: " fmt, dt_node_full_name(dev->node), ## __VA_ARGS__)
+
+#define smmu_err(dev, fmt, ...) smmu_print(dev, XENLOG_ERR, fmt, ## __VA_ARGS__)
+
+#define smmu_dbg(dev, fmt, ...)                                             \
+    smmu_print(dev, XENLOG_DEBUG, fmt, ## __VA_ARGS__)
+
+#define smmu_info(dev, fmt, ...)                                            \
+    smmu_print(dev, XENLOG_INFO, fmt, ## __VA_ARGS__)
+
+#define smmu_warn(dev, fmt, ...)                                            \
+    smmu_print(dev, XENLOG_WARNING, fmt, ## __VA_ARGS__)
+
+struct arm_smmu_device {
+    const struct dt_device_node *node;
+
+    void __iomem                *base;
+    unsigned long               size;
+    unsigned long               pagesize;
+
+#define SMMU_FEAT_COHERENT_WALK (1 << 0)
+#define SMMU_FEAT_STREAM_MATCH  (1 << 1)
+#define SMMU_FEAT_TRANS_S1      (1 << 2)
+#define SMMU_FEAT_TRANS_S2      (1 << 3)
+#define SMMU_FEAT_TRANS_NESTED  (1 << 4)
+    u32                         features;
+    u32                         options;
+    int                         version;
+
+    u32                         num_context_banks;
+    u32                         num_s2_context_banks;
+    DECLARE_BITMAP(context_map, SMMU_MAX_CBS);
+    atomic_t                    irptndx;
+
+    u32                         num_mapping_groups;
+    DECLARE_BITMAP(smr_map, SMMU_MAX_SMRS);
+
+    unsigned long               input_size;
+    unsigned long               s1_output_size;
+    unsigned long               s2_output_size;
+
+    u32                         num_global_irqs;
+    u32                         num_context_irqs;
+    unsigned int                *irqs;
+
+    u32                         smr_mask_mask;
+    u32                         smr_id_mask;
+
+    unsigned long               *sids;
+
+    struct list_head            list;
+    struct rb_root              masters;
+};
+
+struct arm_smmu_smr {
+    u8                          idx;
+    u16                         mask;
+    u16                         id;
+};
+
+#define INVALID_IRPTNDX         0xff
+
+#define SMMU_CB_ASID(cfg)       ((cfg)->cbndx)
+#define SMMU_CB_VMID(cfg)       ((cfg)->cbndx + 1)
+
+struct arm_smmu_domain_cfg {
+    struct arm_smmu_device  *smmu;
+    u8                      cbndx;
+    u8                      irptndx;
+    u32                     cbar;
+    /* Domain associated to this device */
+    struct domain           *domain;
+    /* List of master which use this structure */
+    struct list_head        masters;
+
+    /* Used to link domain context for a same domain */
+    struct list_head        list;
+};
+
+struct arm_smmu_master {
+    const struct dt_device_node *dt_node;
+
+    /*
+     * The following is specific to the master's position in the
+     * SMMU chain.
+     */
+    struct rb_node              node;
+    u32                         num_streamids;
+    u16                         streamids[MAX_MASTER_STREAMIDS];
+    int                         num_s2crs;
+
+    struct arm_smmu_smr         *smrs;
+    struct arm_smmu_domain_cfg  *cfg;
+
+    /* Used to link masters in a same domain context */
+    struct list_head            list;
+};
+
+static LIST_HEAD(arm_smmu_devices);
+
+struct arm_smmu_domain {
+    spinlock_t lock;
+    struct list_head contexts;
+};
+
+struct arm_smmu_option_prop {
+    u32         opt;
+    const char  *prop;
+};
+
+static const struct arm_smmu_option_prop arm_smmu_options [] __initconst =
+{
+    { SMMU_OPT_SECURE_CONFIG_ACCESS, "calxeda,smmu-secure-config-access" },
+    { 0, NULL},
+};
+
+static void __init check_driver_options(struct arm_smmu_device *smmu)
+{
+    int i = 0;
+
+    do {
+        if ( dt_property_read_bool(smmu->node, arm_smmu_options[i].prop) )
+        {
+            smmu->options |= arm_smmu_options[i].opt;
+            smmu_dbg(smmu, "option %s\n", arm_smmu_options[i].prop);
+        }
+    } while ( arm_smmu_options[++i].opt );
+}
+
+static void arm_smmu_context_fault(int irq, void *data,
+                                   struct cpu_user_regs *regs)
+{
+    u32 fsr, far, fsynr;
+    uint64_t iova;
+    struct arm_smmu_domain_cfg *cfg = data;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *cb_base;
+
+    cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx);
+    fsr = readl_relaxed(cb_base + SMMU_CB_FSR);
+
+    if ( !(fsr & SMMU_FSR_FAULT) )
+        return;
+
+    if ( fsr & SMMU_FSR_IGN )
+        smmu_err(smmu, "Unexpected context fault (fsr 0x%u)\n", fsr);
+
+    fsynr = readl_relaxed(cb_base + SMMU_CB_FSYNR0);
+    far = readl_relaxed(cb_base + SMMU_CB_FAR_LO);
+    iova = far;
+    far = readl_relaxed(cb_base + SMMU_CB_FAR_HI);
+    iova |= ((uint64_t)far << 32);
+
+    smmu_err(smmu, "Unhandled context fault for domain %u\n",
+             cfg->domain->domain_id);
+    smmu_err(smmu, "\tFSR 0x%x, IOVA 0x%"PRIx64", FSYNR 0x%x,  CB %d\n",
+             fsr, iova, fsynr, cfg->cbndx);
+
+    /* Clear the faulting FSR */
+    writel(fsr, cb_base + SMMU_CB_FSR);
+
+    /* Terminate any stalled transactions */
+    if ( fsr & SMMU_FSR_SS )
+        writel_relaxed(SMMU_RESUME_TERMINATE, cb_base + SMMU_CB_RESUME);
+}
+
+static void arm_smmu_global_fault(int irq, void *data,
+                                  struct cpu_user_regs *regs)
+{
+    u32 gfsr, gfsynr0, gfsynr1, gfsynr2;
+    struct arm_smmu_device *smmu = data;
+    void __iomem *gr0_base = SMMU_GR0_NS(smmu);
+
+    gfsr = readl_relaxed(gr0_base + SMMU_GR0_sGFSR);
+    gfsynr0 = readl_relaxed(gr0_base + SMMU_GR0_sGFSYNR0);
+    gfsynr1 = readl_relaxed(gr0_base + SMMU_GR0_sGFSYNR1);
+    gfsynr2 = readl_relaxed(gr0_base + SMMU_GR0_sGFSYNR2);
+
+    if ( !gfsr )
+        return;
+
+    smmu_err(smmu, "Unexpected global fault, this could be serious\n");
+    smmu_err(smmu,
+             "\tGFSR 0x%08x, GFSYNR0 0x%08x, GFSYNR1 0x%08x, GFSYNR2 0x%08x\n",
+             gfsr, gfsynr0, gfsynr1, gfsynr2);
+    writel(gfsr, gr0_base + SMMU_GR0_sGFSR);
+}
+
+static struct arm_smmu_master *
+find_smmu_master(struct arm_smmu_device *smmu,
+                 const struct dt_device_node *dev_node)
+{
+    struct rb_node *node = smmu->masters.rb_node;
+
+    while ( node )
+    {
+        struct arm_smmu_master *master;
+
+        master = container_of(node, struct arm_smmu_master, node);
+
+        if ( dev_node < master->dt_node )
+            node = node->rb_left;
+        else if ( dev_node > master->dt_node )
+            node = node->rb_right;
+        else
+            return master;
+    }
+
+    return NULL;
+}
+
+static __init int insert_smmu_master(struct arm_smmu_device *smmu,
+                                     struct arm_smmu_master *master)
+{
+    struct rb_node **new, *parent;
+
+    new = &smmu->masters.rb_node;
+    parent = NULL;
+    while ( *new )
+    {
+        struct arm_smmu_master *this;
+
+        this = container_of(*new, struct arm_smmu_master, node);
+
+        parent = *new;
+        if ( master->dt_node < this->dt_node )
+            new = &((*new)->rb_left);
+        else if (master->dt_node > this->dt_node)
+            new = &((*new)->rb_right);
+        else
+            return -EEXIST;
+    }
+
+    rb_link_node(&master->node, parent, new);
+    rb_insert_color(&master->node, &smmu->masters);
+    return 0;
+}
+
+static __init int register_smmu_master(struct arm_smmu_device *smmu,
+                                       struct dt_phandle_args *masterspec)
+{
+    int i, sid;
+    struct arm_smmu_master *master;
+    int rc = 0;
+
+    smmu_dbg(smmu, "Try to add master %s\n", masterspec->np->name);
+
+    master = find_smmu_master(smmu, masterspec->np);
+    if ( master )
+    {
+        smmu_err(smmu,
+                 "rejecting multiple registrations for master device %s\n",
+                 masterspec->np->name);
+        return -EBUSY;
+    }
+
+    if ( masterspec->args_count > MAX_MASTER_STREAMIDS )
+    {
+        smmu_err(smmu,
+            "reached maximum number (%d) of stream IDs for master device %s\n",
+            MAX_MASTER_STREAMIDS, masterspec->np->name);
+        return -ENOSPC;
+    }
+
+    master = xzalloc(struct arm_smmu_master);
+    if ( !master )
+        return -ENOMEM;
+
+    INIT_LIST_HEAD(&master->list);
+    master->dt_node = masterspec->np;
+    master->num_streamids = masterspec->args_count;
+
+    dt_device_set_protected(masterspec->np);
+
+    for ( i = 0; i < master->num_streamids; ++i )
+    {
+        sid = masterspec->args[i];
+        if ( test_and_set_bit(sid, smmu->sids) )
+        {
+            smmu_err(smmu, "duplicate stream ID (%d)\n", sid);
+            xfree(master);
+            return -EEXIST;
+        }
+        master->streamids[i] = masterspec->args[i];
+    }
+
+    rc = insert_smmu_master(smmu, master);
+    /* Insertion should never fail */
+    ASSERT(rc == 0);
+
+    return 0;
+}
+
+static int __arm_smmu_alloc_bitmap(unsigned long *map, int start, int end)
+{
+    int idx;
+
+    do
+    {
+        idx = find_next_zero_bit(map, end, start);
+        if ( idx == end )
+            return -ENOSPC;
+    } while ( test_and_set_bit(idx, map) );
+
+    return idx;
+}
+
+static void __arm_smmu_free_bitmap(unsigned long *map, int idx)
+{
+    clear_bit(idx, map);
+}
+
+static void arm_smmu_tlb_sync(struct arm_smmu_device *smmu)
+{
+    int count = 0;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+
+    writel_relaxed(0, gr0_base + SMMU_GR0_sTLBGSYNC);
+    while ( readl_relaxed(gr0_base + SMMU_GR0_sTLBGSTATUS) &
+            SMMU_sTLBGSTATUS_GSACTIVE )
+    {
+        cpu_relax();
+        if ( ++count == SMMU_TLB_LOOP_TIMEOUT )
+        {
+            smmu_err(smmu, "TLB sync timed out -- SMMU may be deadlocked\n");
+            return;
+        }
+        udelay(1);
+    }
+}
+
+static void arm_smmu_tlb_inv_context(struct arm_smmu_domain_cfg *cfg)
+{
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *base = SMMU_GR0(smmu);
+
+    writel_relaxed(SMMU_CB_VMID(cfg),
+                   base + SMMU_GR0_TLBIVMID);
+
+    arm_smmu_tlb_sync(smmu);
+}
+
+static void arm_smmu_iotlb_flush_all(struct domain *d)
+{
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_domain_cfg *cfg;
+
+    spin_lock(&smmu_domain->lock);
+    list_for_each_entry(cfg, &smmu_domain->contexts, list)
+        arm_smmu_tlb_inv_context(cfg);
+    spin_unlock(&smmu_domain->lock);
+}
+
+static void arm_smmu_iotlb_flush(struct domain *d, unsigned long gfn,
+                                 unsigned int page_count)
+{
+    /* ARM SMMU v1 doesn't have flush by VMA and VMID */
+    arm_smmu_iotlb_flush_all(d);
+}
+
+static int determine_smr_mask(struct arm_smmu_device *smmu,
+                              struct arm_smmu_master *master,
+                              struct arm_smmu_smr *smr, int start, int order)
+{
+    u16 i, zero_bits_mask, one_bits_mask, const_mask;
+    int nr;
+
+    nr = 1 << order;
+
+    if ( nr == 1 )
+    {
+        /* no mask, use streamid to match and be done with it */
+        smr->mask = 0;
+        smr->id = master->streamids[start];
+        return 0;
+    }
+
+    zero_bits_mask = 0;
+    one_bits_mask = 0xffff;
+    for ( i = start; i < start + nr; i++)
+    {
+        zero_bits_mask |= master->streamids[i];   /* const 0 bits */
+        one_bits_mask &= master->streamids[i]; /* const 1 bits */
+    }
+    zero_bits_mask = ~zero_bits_mask;
+
+    /* bits having constant values (either 0 or 1) */
+    const_mask = zero_bits_mask | one_bits_mask;
+
+    i = hweight16(~const_mask);
+    if ( (1 << i) == nr )
+    {
+        smr->mask = ~const_mask;
+        smr->id = one_bits_mask;
+    }
+    else
+        /* no usable mask for this set of streamids */
+        return 1;
+
+    if ( ((smr->mask & smmu->smr_mask_mask) != smr->mask) ||
+         ((smr->id & smmu->smr_id_mask) != smr->id) )
+        /* insufficient number of mask/id bits */
+        return 1;
+
+    return 0;
+}
+
+static int determine_smr_mapping(struct arm_smmu_device *smmu,
+                                 struct arm_smmu_master *master,
+                                 struct arm_smmu_smr *smrs, int max_smrs)
+{
+    int nr_sid, nr, i, bit, start;
+
+    /*
+     * This function is called only once -- when a master is added
+     * to a domain. If master->num_s2crs != 0 then this master
+     * was already added to a domain.
+     */
+    BUG_ON(master->num_s2crs);
+
+    start = nr = 0;
+    nr_sid = master->num_streamids;
+    do
+    {
+        /*
+         * largest power-of-2 number of streamids for which to
+         * determine a usable mask/id pair for stream matching
+         */
+        bit = fls(nr_sid);
+        if (!bit)
+            return 0;
+
+        /*
+         * iterate over power-of-2 numbers to determine
+         * largest possible mask/id pair for stream matching
+         * of next 2**i streamids
+         */
+        for ( i = bit - 1; i >= 0; i-- )
+        {
+            if( !determine_smr_mask(smmu, master,
+                                    &smrs[master->num_s2crs],
+                                    start, i))
+                break;
+        }
+
+        if ( i < 0 )
+            goto out;
+
+        nr = 1 << i;
+        nr_sid -= nr;
+        start += nr;
+        master->num_s2crs++;
+    } while ( master->num_s2crs <= max_smrs );
+
+out:
+    if ( nr_sid )
+    {
+        /* not enough mapping groups available */
+        master->num_s2crs = 0;
+        return -ENOSPC;
+    }
+
+    return 0;
+}
+
+static int arm_smmu_master_configure_smrs(struct arm_smmu_device *smmu,
+                                          struct arm_smmu_master *master)
+{
+    int i, max_smrs, ret;
+    struct arm_smmu_smr *smrs;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+
+    if ( !(smmu->features & SMMU_FEAT_STREAM_MATCH) )
+        return 0;
+
+    if ( master->smrs )
+        return -EEXIST;
+
+    max_smrs = min(smmu->num_mapping_groups, master->num_streamids);
+    smrs = xmalloc_array(struct arm_smmu_smr, max_smrs);
+    if ( !smrs )
+    {
+        smmu_err(smmu, "failed to allocated %d SMRs for master %s\n",
+                 max_smrs, dt_node_name(master->dt_node));
+        return -ENOMEM;
+    }
+
+    ret = determine_smr_mapping(smmu, master, smrs, max_smrs);
+    if ( ret )
+        goto err_free_smrs;
+
+    /* Allocate the SMRs on the root SMMU */
+    for ( i = 0; i < master->num_s2crs; ++i )
+    {
+        int idx = __arm_smmu_alloc_bitmap(smmu->smr_map, 0,
+                                          smmu->num_mapping_groups);
+        if ( idx < 0 )
+        {
+            smmu_err(smmu, "failed to allocate free SMR\n");
+            goto err_free_bitmap;
+        }
+        smrs[i].idx = idx;
+    }
+
+    /* It worked! Now, poke the actual hardware */
+    for ( i = 0; i < master->num_s2crs; ++i )
+    {
+        u32 reg = SMMU_SMR_VALID | smrs[i].id << SMMU_SMR_ID_SHIFT |
+            smrs[i].mask << SMMU_SMR_MASK_SHIFT;
+        smmu_dbg(smmu, "SMR%d: 0x%x\n", smrs[i].idx, reg);
+        writel_relaxed(reg, gr0_base + SMMU_GR0_SMR(smrs[i].idx));
+    }
+
+    master->smrs = smrs;
+    return 0;
+
+err_free_bitmap:
+    while (--i >= 0)
+        __arm_smmu_free_bitmap(smmu->smr_map, smrs[i].idx);
+    master->num_s2crs = 0;
+err_free_smrs:
+    xfree(smrs);
+    return -ENOSPC;
+}
+
+/* Forward declaration */
+static void arm_smmu_destroy_domain_context(struct arm_smmu_domain_cfg *cfg);
+
+static int arm_smmu_domain_add_master(struct domain *d,
+                                      struct arm_smmu_domain_cfg *cfg,
+                                      struct arm_smmu_master *master)
+{
+    int i, ret;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    struct arm_smmu_smr *smrs = master->smrs;
+
+    if ( master->cfg )
+        return -EBUSY;
+
+    ret = arm_smmu_master_configure_smrs(smmu, master);
+    if ( ret )
+        return ret;
+
+    /* Now we're at the root, time to point at our context bank */
+    if ( !master->num_s2crs )
+        master->num_s2crs = master->num_streamids;
+
+    for ( i = 0; i < master->num_s2crs; ++i )
+    {
+        u32 idx, s2cr;
+
+        idx = smrs ? smrs[i].idx : master->streamids[i];
+        s2cr = (SMMU_S2CR_TYPE_TRANS << SMMU_S2CR_TYPE_SHIFT) |
+            (cfg->cbndx << SMMU_S2CR_CBNDX_SHIFT);
+        smmu_dbg(smmu, "S2CR%d: 0x%x\n", idx, s2cr);
+        writel_relaxed(s2cr, gr0_base + SMMU_GR0_S2CR(idx));
+    }
+
+    master->cfg = cfg;
+    list_add(&master->list, &cfg->masters);
+
+    return 0;
+}
+
+static void arm_smmu_domain_remove_master(struct arm_smmu_master *master)
+{
+    int i;
+    struct arm_smmu_domain_cfg *cfg = master->cfg;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    struct arm_smmu_smr *smrs = master->smrs;
+
+    /*
+     * We *must* clear the S2CR first, because freeing the SMR means
+     * that it can be reallocated immediately
+     */
+    for ( i = 0; i < master->num_streamids; ++i )
+    {
+        u16 sid = master->streamids[i];
+        writel_relaxed(SMMU_S2CR_TYPE_FAULT,
+                       gr0_base + SMMU_GR0_S2CR(sid));
+    }
+
+    /* Invalidate the SMRs before freeing back to the allocator */
+    for (i = 0; i < master->num_s2crs; ++i) {
+        u8 idx = smrs[i].idx;
+        writel_relaxed(~SMMU_SMR_VALID, gr0_base + SMMU_GR0_SMR(idx));
+        __arm_smmu_free_bitmap(smmu->smr_map, idx);
+    }
+
+    master->smrs = NULL;
+    master->num_s2crs = 0;
+    xfree(smrs);
+
+    master->cfg = NULL;
+    list_del(&master->list);
+    INIT_LIST_HEAD(&master->list);
+}
+
+static void arm_smmu_init_context_bank(struct arm_smmu_domain_cfg *cfg)
+{
+    u32 reg;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *cb_base, *gr1_base;
+    paddr_t p2maddr;
+
+    ASSERT(cfg->domain != NULL);
+    p2maddr = page_to_maddr(cfg->domain->arch.p2m.first_level);
+
+    gr1_base = SMMU_GR1(smmu);
+    cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx);
+
+    /* CBAR */
+    reg = cfg->cbar;
+    if ( smmu->version == 1 )
+        reg |= cfg->irptndx << SMMU_CBAR_IRPTNDX_SHIFT;
+
+    reg |= SMMU_CB_VMID(cfg) << SMMU_CBAR_VMID_SHIFT;
+    writel_relaxed(reg, gr1_base + SMMU_GR1_CBAR(cfg->cbndx));
+
+    if ( smmu->version > 1 )
+    {
+        /* CBA2R */
+#ifdef CONFIG_ARM_64
+        reg = SMMU_CBA2R_RW64_64BIT;
+#else
+        reg = SMMU_CBA2R_RW64_32BIT;
+#endif
+        writel_relaxed(reg, gr1_base + SMMU_GR1_CBA2R(cfg->cbndx));
+    }
+
+    /* TTBR0 */
+    reg = (p2maddr & ((1ULL << 32) - 1));
+    writel_relaxed(reg, cb_base + SMMU_CB_TTBR0_LO);
+    reg = (p2maddr >> 32);
+    writel_relaxed(reg, cb_base + SMMU_CB_TTBR0_HI);
+
+    /*
+     * TCR
+     * We use long descriptor, with inner-shareable WBWA tables in TTBR0.
+     */
+    if ( smmu->version > 1 )
+    {
+        /* 4K Page Table */
+        if ( PAGE_SIZE == PAGE_SIZE_4K )
+            reg = SMMU_TCR_TG0_4K;
+        else
+            reg = SMMU_TCR_TG0_64K;
+
+        switch ( smmu->s2_output_size ) {
+        case 32:
+            reg |= (SMMU_TCR2_ADDR_32 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 36:
+            reg |= (SMMU_TCR2_ADDR_36 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 40:
+            reg |= (SMMU_TCR2_ADDR_40 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 42:
+            reg |= (SMMU_TCR2_ADDR_42 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 44:
+            reg |= (SMMU_TCR2_ADDR_44 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 48:
+            reg |= (SMMU_TCR2_ADDR_48 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        }
+    }
+    else
+        reg = 0;
+
+    /* The attribute to walk the page table should be the same as VTCR_EL2 */
+    reg |= SMMU_TCR_EAE |
+        (SMMU_TCR_SH_IS << SMMU_TCR_SH0_SHIFT) |
+        (SMMU_TCR_RGN_WBWA << SMMU_TCR_ORGN0_SHIFT) |
+        (SMMU_TCR_RGN_WBWA << SMMU_TCR_IRGN0_SHIFT) |
+        (SMMU_TCR_SL0_LVL_1 << SMMU_TCR_SL0_SHIFT) |
+        /* T0SZ=(1)100 = -8 ( 32 -(-8) = 40 bit physical addresses ) */
+        (0x18 << SMMU_TCR_T0SZ_SHIFT);
+    writel_relaxed(reg, cb_base + SMMU_CB_TCR);
+
+    /* SCTLR */
+    reg = SMMU_SCTLR_CFCFG |
+        SMMU_SCTLR_CFIE |
+        SMMU_SCTLR_CFRE |
+        SMMU_SCTLR_M |
+        SMMU_SCTLR_EAE_SBOP;
+
+    writel_relaxed(reg, cb_base + SMMU_CB_SCTLR);
+}
+
+static struct arm_smmu_domain_cfg *
+arm_smmu_alloc_domain_context(struct domain *d,
+                              struct arm_smmu_device *smmu)
+{
+    unsigned int irq;
+    int ret, start;
+    struct arm_smmu_domain_cfg *cfg;
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+
+    ASSERT(spin_is_locked(&smmu_domain->lock));
+
+    cfg = xzalloc(struct arm_smmu_domain_cfg);
+    if ( !cfg )
+        return NULL;
+
+    /* Master already initialized to another domain ... */
+    if ( cfg->domain != NULL )
+        goto out_free_mem;
+
+    cfg->cbar = SMMU_CBAR_TYPE_S2_TRANS;
+    start = 0;
+
+    ret = __arm_smmu_alloc_bitmap(smmu->context_map, start,
+                                  smmu->num_context_banks);
+    if ( ret < 0 )
+        goto out_free_mem;
+
+    cfg->cbndx = ret;
+    if ( smmu->version == 1 )
+    {
+        cfg->irptndx = atomic_inc_return(&smmu->irptndx);
+        cfg->irptndx %= smmu->num_context_irqs;
+    }
+    else
+        cfg->irptndx = cfg->cbndx;
+
+    irq = smmu->irqs[smmu->num_global_irqs + cfg->irptndx];
+    ret = request_irq(irq, IRQF_SHARED, arm_smmu_context_fault,
+                      "arm-smmu-context-fault", cfg);
+    if ( ret )
+    {
+        smmu_err(smmu, "failed to request context IRQ %d (%u)\n",
+                 cfg->irptndx, irq);
+        cfg->irptndx = INVALID_IRPTNDX;
+        goto out_free_context;
+    }
+
+    cfg->domain = d;
+    cfg->smmu = smmu;
+    if ( smmu->features & SMMU_FEAT_COHERENT_WALK )
+        iommu_set_feature(d, IOMMU_FEAT_COHERENT_WALK);
+
+    arm_smmu_init_context_bank(cfg);
+    list_add(&cfg->list, &smmu_domain->contexts);
+    INIT_LIST_HEAD(&cfg->masters);
+
+    return cfg;
+
+out_free_context:
+    __arm_smmu_free_bitmap(smmu->context_map, cfg->cbndx);
+out_free_mem:
+    xfree(cfg);
+
+    return NULL;
+}
+
+static void arm_smmu_destroy_domain_context(struct arm_smmu_domain_cfg *cfg)
+{
+    struct domain *d = cfg->domain;
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *cb_base;
+    unsigned int irq;
+
+    ASSERT(spin_is_locked(&smmu_domain->lock));
+    BUG_ON(!list_empty(&cfg->masters));
+
+    /* Disable the context bank and nuke the TLB before freeing it */
+    cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx);
+    writel_relaxed(0, cb_base + SMMU_CB_SCTLR);
+    arm_smmu_tlb_inv_context(cfg);
+
+    if ( cfg->irptndx != INVALID_IRPTNDX )
+    {
+        irq = smmu->irqs[smmu->num_global_irqs + cfg->irptndx];
+        release_irq(irq, cfg);
+    }
+
+    __arm_smmu_free_bitmap(smmu->context_map, cfg->cbndx);
+    list_del(&cfg->list);
+    xfree(cfg);
+}
+
+static struct arm_smmu_device *
+arm_smmu_find_smmu_by_dev(const struct dt_device_node *dev)
+{
+    struct arm_smmu_device *smmu;
+    struct arm_smmu_master *master = NULL;
+
+    list_for_each_entry( smmu, &arm_smmu_devices, list )
+    {
+        master = find_smmu_master(smmu, dev);
+        if ( master )
+            break;
+    }
+
+    if ( !master )
+        return NULL;
+
+    return smmu;
+}
+
+static int arm_smmu_attach_dev(struct domain *d,
+                               const struct dt_device_node *dev)
+{
+    struct arm_smmu_device *smmu = arm_smmu_find_smmu_by_dev(dev);
+    struct arm_smmu_master *master;
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_domain_cfg *cfg = NULL;
+    struct arm_smmu_domain_cfg *curr;
+    int ret;
+
+    printk(XENLOG_DEBUG "arm-smmu: attach %s to domain %d\n",
+           dt_node_full_name(dev), d->domain_id);
+
+    if ( !smmu )
+    {
+        printk(XENLOG_ERR "%s: cannot attach to SMMU, is it on the same bus?\n",
+               dt_node_full_name(dev));
+        return -ENODEV;
+    }
+
+    master = find_smmu_master(smmu, dev);
+    BUG_ON(master == NULL);
+
+    /* Check if the device is already assigned to someone */
+    if ( master->cfg )
+        return -EBUSY;
+
+    spin_lock(&smmu_domain->lock);
+    list_for_each_entry( curr, &smmu_domain->contexts, list )
+    {
+        if ( curr->smmu == smmu )
+        {
+            cfg = curr;
+            break;
+        }
+    }
+
+    if ( !cfg )
+    {
+        cfg = arm_smmu_alloc_domain_context(d, smmu);
+        if ( !cfg )
+        {
+            smmu_err(smmu, "unable to allocate context for domain %u\n",
+                     d->domain_id);
+            spin_unlock(&smmu_domain->lock);
+            return -ENOMEM;
+        }
+    }
+    spin_unlock(&smmu_domain->lock);
+
+    ret = arm_smmu_domain_add_master(d, cfg, master);
+    if ( ret )
+    {
+        spin_lock(&smmu_domain->lock);
+        if ( list_empty(&cfg->masters) )
+            arm_smmu_destroy_domain_context(cfg);
+        spin_unlock(&smmu_domain->lock);
+    }
+
+    return ret;
+}
+
+static int arm_smmu_detach_dev(struct domain *d,
+                               const struct dt_device_node *dev)
+{
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_master *master;
+    struct arm_smmu_device *smmu = arm_smmu_find_smmu_by_dev(dev);
+    struct arm_smmu_domain_cfg *cfg;
+
+    printk(XENLOG_DEBUG "arm-smmu: detach %s to domain %d\n",
+           dt_node_full_name(dev), d->domain_id);
+
+    if ( !smmu )
+    {
+        printk(XENLOG_ERR "%s: cannot find the SMMU, is it on the same bus?\n",
+               dt_node_full_name(dev));
+        return -ENODEV;
+    }
+
+    master = find_smmu_master(smmu, dev);
+    BUG_ON(master == NULL);
+
+    cfg = master->cfg;
+
+    /* Sanity check to avoid removing a device that doesn't belong to
+     * the domain
+     */
+    if ( !cfg || cfg->domain != d )
+    {
+        printk(XENLOG_ERR "%s: was not attach to domain %d\n",
+               dt_node_full_name(dev), d->domain_id);
+        return -ESRCH;
+    }
+
+    arm_smmu_domain_remove_master(master);
+
+    spin_lock(&smmu_domain->lock);
+    if ( list_empty(&cfg->masters) )
+        arm_smmu_destroy_domain_context(cfg);
+    spin_unlock(&smmu_domain->lock);
+
+    return 0;
+}
+
+static int arm_smmu_reassign_dt_dev(struct domain *s, struct domain *t,
+                                    const struct dt_device_node *dev)
+{
+    int ret = 0;
+
+    /* Don't allow remapping on other domain than hwdom */
+    if ( t != hardware_domain )
+        return -EPERM;
+
+    if ( t == s )
+        return 0;
+
+    ret = arm_smmu_detach_dev(s, dev);
+    if ( ret )
+        return ret;
+
+    ret = arm_smmu_attach_dev(t, dev);
+
+    return ret;
+}
+
+static __init int arm_smmu_id_size_to_bits(int size)
+{
+    switch ( size )
+    {
+    case 0:
+        return 32;
+    case 1:
+        return 36;
+    case 2:
+        return 40;
+    case 3:
+        return 42;
+    case 4:
+        return 44;
+    case 5:
+    default:
+        return 48;
+    }
+}
+
+static __init int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
+{
+    unsigned long size;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    u32 id;
+
+    smmu_info(smmu, "probing hardware configuration...\n");
+
+    /*
+     * Primecell ID
+     */
+    id = readl_relaxed(gr0_base + SMMU_GR0_PIDR2);
+    smmu->version = ((id >> SMMU_PIDR2_ARCH_SHIFT) & SMMU_PIDR2_ARCH_MASK) + 1;
+    smmu_info(smmu, "SMMUv%d with:\n", smmu->version);
+
+    /* ID0 */
+    id = readl_relaxed(gr0_base + SMMU_GR0_ID0);
+#ifndef CONFIG_ARM_64
+    if ( ((id >> SMMU_ID0_PTFS_SHIFT) & SMMU_ID0_PTFS_MASK) ==
+            SMMU_ID0_PTFS_V8_ONLY )
+    {
+        smmu_err(smmu, "\tno v7 descriptor support!\n");
+        return -ENODEV;
+    }
+#endif
+    if ( id & SMMU_ID0_S1TS )
+    {
+        smmu->features |= SMMU_FEAT_TRANS_S1;
+        smmu_info(smmu, "\tstage 1 translation\n");
+    }
+
+    if ( id & SMMU_ID0_S2TS )
+    {
+        smmu->features |= SMMU_FEAT_TRANS_S2;
+        smmu_info(smmu, "\tstage 2 translation\n");
+    }
+
+    if ( id & SMMU_ID0_NTS )
+    {
+        smmu->features |= SMMU_FEAT_TRANS_NESTED;
+        smmu_info(smmu, "\tnested translation\n");
+    }
+
+    if ( !(smmu->features &
+           (SMMU_FEAT_TRANS_S1 | SMMU_FEAT_TRANS_S2 |
+            SMMU_FEAT_TRANS_NESTED)) )
+    {
+        smmu_err(smmu, "\tno translation support!\n");
+        return -ENODEV;
+    }
+
+    /* We need at least support for Stage 2 */
+    if ( !(smmu->features & SMMU_FEAT_TRANS_S2) )
+    {
+        smmu_err(smmu, "\tno stage 2 translation!\n");
+        return -ENODEV;
+    }
+
+    if ( id & SMMU_ID0_CTTW )
+    {
+        smmu->features |= SMMU_FEAT_COHERENT_WALK;
+        smmu_info(smmu, "\tcoherent table walk\n");
+    }
+
+    if ( id & SMMU_ID0_SMS )
+    {
+        u32 smr, sid, mask;
+
+        smmu->features |= SMMU_FEAT_STREAM_MATCH;
+        smmu->num_mapping_groups = (id >> SMMU_ID0_NUMSMRG_SHIFT) &
+            SMMU_ID0_NUMSMRG_MASK;
+        if ( smmu->num_mapping_groups == 0 )
+        {
+            smmu_err(smmu,
+                     "stream-matching supported, but no SMRs present!\n");
+            return -ENODEV;
+        }
+
+        smr = SMMU_SMR_MASK_MASK << SMMU_SMR_MASK_SHIFT;
+        smr |= (SMMU_SMR_ID_MASK << SMMU_SMR_ID_SHIFT);
+        writel_relaxed(smr, gr0_base + SMMU_GR0_SMR(0));
+        smr = readl_relaxed(gr0_base + SMMU_GR0_SMR(0));
+
+        mask = (smr >> SMMU_SMR_MASK_SHIFT) & SMMU_SMR_MASK_MASK;
+        sid = (smr >> SMMU_SMR_ID_SHIFT) & SMMU_SMR_ID_MASK;
+        if ( (mask & sid) != sid )
+        {
+            smmu_err(smmu,
+                     "SMR mask bits (0x%x) insufficient for ID field (0x%x)\n",
+                     mask, sid);
+            return -ENODEV;
+        }
+        smmu->smr_mask_mask = mask;
+        smmu->smr_id_mask = sid;
+
+        smmu_info(smmu,
+                  "\tstream matching with %u register groups, mask 0x%x\n",
+                  smmu->num_mapping_groups, mask);
+    }
+
+    /* ID1 */
+    id = readl_relaxed(gr0_base + SMMU_GR0_ID1);
+    smmu->pagesize = (id & SMMU_ID1_PAGESIZE) ? PAGE_SIZE_64K : PAGE_SIZE_4K;
+
+    /* Check for size mismatch of SMMU address space from mapped region */
+    size = 1 << (((id >> SMMU_ID1_NUMPAGENDXB_SHIFT) &
+                  SMMU_ID1_NUMPAGENDXB_MASK) + 1);
+    size *= (smmu->pagesize << 1);
+    if ( smmu->size != size )
+        smmu_warn(smmu, "SMMU address space size (0x%lx) differs "
+                  "from mapped region size (0x%lx)!\n", size, smmu->size);
+
+    smmu->num_s2_context_banks = (id >> SMMU_ID1_NUMS2CB_SHIFT) &
+        SMMU_ID1_NUMS2CB_MASK;
+    smmu->num_context_banks = (id >> SMMU_ID1_NUMCB_SHIFT) &
+        SMMU_ID1_NUMCB_MASK;
+    if ( smmu->num_s2_context_banks > smmu->num_context_banks )
+    {
+        smmu_err(smmu, "impossible number of S2 context banks!\n");
+        return -ENODEV;
+    }
+    smmu_info(smmu, "\t%u context banks (%u stage-2 only)\n",
+              smmu->num_context_banks, smmu->num_s2_context_banks);
+
+    /* ID2 */
+    id = readl_relaxed(gr0_base + SMMU_GR0_ID2);
+    size = arm_smmu_id_size_to_bits((id >> SMMU_ID2_IAS_SHIFT) &
+                                    SMMU_ID2_IAS_MASK);
+
+    /*
+     * Stage-1 output limited by stage-2 input size due to VTCR_EL2
+     * setup (see setup_virt_paging)
+     */
+    /* Current maximum output size of 40 bits */
+    smmu->s1_output_size = min(40UL, size);
+
+    /* The stage-2 output mask is also applied for bypass */
+    size = arm_smmu_id_size_to_bits((id >> SMMU_ID2_OAS_SHIFT) &
+                                    SMMU_ID2_OAS_MASK);
+    smmu->s2_output_size = min((unsigned long)PADDR_BITS, size);
+
+    if ( smmu->version == 1 )
+        smmu->input_size = 32;
+    else
+    {
+#ifdef CONFIG_ARM_64
+        size = (id >> SMMU_ID2_UBS_SHIFT) & SMMU_ID2_UBS_MASK;
+        size = min(39, arm_smmu_id_size_to_bits(size));
+#else
+        size = 32;
+#endif
+        smmu->input_size = size;
+
+        if ( (PAGE_SIZE == PAGE_SIZE_4K && !(id & SMMU_ID2_PTFS_4K) ) ||
+             (PAGE_SIZE == PAGE_SIZE_64K && !(id & SMMU_ID2_PTFS_64K)) ||
+             (PAGE_SIZE != PAGE_SIZE_4K && PAGE_SIZE != PAGE_SIZE_64K) )
+        {
+            smmu_err(smmu, "CPU page size 0x%lx unsupported\n",
+                     PAGE_SIZE);
+            return -ENODEV;
+        }
+    }
+
+    smmu_info(smmu, "\t%lu-bit VA, %lu-bit IPA, %lu-bit PA\n",
+              smmu->input_size, smmu->s1_output_size, smmu->s2_output_size);
+    return 0;
+}
+
+static __init void arm_smmu_device_reset(struct arm_smmu_device *smmu)
+{
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    void __iomem *cb_base;
+    int i = 0;
+    u32 reg;
+
+    smmu_dbg(smmu, "device reset\n");
+
+    /* Clear Global FSR */
+    reg = readl_relaxed(SMMU_GR0_NS(smmu) + SMMU_GR0_sGFSR);
+    writel(reg, SMMU_GR0_NS(smmu) + SMMU_GR0_sGFSR);
+
+    /* Mark all SMRn as invalid and all S2CRn as fault */
+    for ( i = 0; i < smmu->num_mapping_groups; ++i )
+    {
+        writel_relaxed(~SMMU_SMR_VALID, gr0_base + SMMU_GR0_SMR(i));
+        writel_relaxed(SMMU_S2CR_TYPE_FAULT, gr0_base + SMMU_GR0_S2CR(i));
+    }
+
+    /* Make sure all context banks are disabled and clear CB_FSR  */
+    for ( i = 0; i < smmu->num_context_banks; ++i )
+    {
+        cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, i);
+        writel_relaxed(0, cb_base + SMMU_CB_SCTLR);
+        writel_relaxed(SMMU_FSR_FAULT, cb_base + SMMU_CB_FSR);
+    }
+
+    /* Invalidate the TLB, just in case */
+    writel_relaxed(0, gr0_base + SMMU_GR0_STLBIALL);
+    writel_relaxed(0, gr0_base + SMMU_GR0_TLBIALLH);
+    writel_relaxed(0, gr0_base + SMMU_GR0_TLBIALLNSNH);
+
+    reg = readl_relaxed(SMMU_GR0_NS(smmu) + SMMU_GR0_sCR0);
+
+    /* Enable fault reporting */
+    reg |= (SMMU_sCR0_GFRE | SMMU_sCR0_GFIE |
+            SMMU_sCR0_GCFGFRE | SMMU_sCR0_GCFGFIE);
+
+    /* Disable TLB broadcasting. */
+    reg |= (SMMU_sCR0_VMIDPNE | SMMU_sCR0_PTM);
+
+    /* Enable client access, generate a fault if no mapping is found */
+    reg &= ~(SMMU_sCR0_CLIENTPD);
+    reg |= SMMU_sCR0_USFCFG;
+
+    /* Disable forced broadcasting */
+    reg &= ~SMMU_sCR0_FB;
+
+    /* Don't upgrade barriers when client devices are not mapped to
+     * a translation context banks (just here for clarity as Xen policy
+     * is to deny invalid transaction). */
+    reg &= ~(SMMU_sCR0_BSU_MASK << SMMU_sCR0_BSU_SHIFT);
+
+    /* Push the button */
+    arm_smmu_tlb_sync(smmu);
+    writel_relaxed(reg, SMMU_GR0_NS(smmu) + SMMU_GR0_sCR0);
+}
+
+static int arm_smmu_iommu_domain_init(struct domain *d)
+{
+    struct arm_smmu_domain *smmu_domain;
+
+    smmu_domain = xzalloc(struct arm_smmu_domain);
+    if ( !smmu_domain )
+        return -ENOMEM;
+
+    spin_lock_init(&smmu_domain->lock);
+    INIT_LIST_HEAD(&smmu_domain->contexts);
+
+    domain_hvm_iommu(d)->arch.priv = smmu_domain;
+
+    return 0;
+}
+
+static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
+{
+}
+
+static void arm_smmu_iommu_domain_teardown(struct domain *d)
+{
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+
+    ASSERT(list_empty(&smmu_domain->contexts));
+    xfree(smmu_domain);
+}
+
+static const struct iommu_ops arm_smmu_iommu_ops = {
+    .init = arm_smmu_iommu_domain_init,
+    .hwdom_init = arm_smmu_iommu_hwdom_init,
+    .teardown = arm_smmu_iommu_domain_teardown,
+    .iotlb_flush = arm_smmu_iotlb_flush,
+    .iotlb_flush_all = arm_smmu_iotlb_flush_all,
+    .assign_dt_device = arm_smmu_attach_dev,
+    .reassign_dt_device = arm_smmu_reassign_dt_dev,
+};
+
+static int __init smmu_init(struct dt_device_node *dev,
+                            const void *data)
+{
+    struct arm_smmu_device *smmu;
+    int res;
+    u64 addr, size;
+    unsigned int num_irqs, i;
+    struct dt_phandle_args masterspec;
+    struct rb_node *node;
+
+    /* Even if the device can't be initialized, we don't want to give
+     * the smmu device to dom0.
+     */
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    smmu = xzalloc(struct arm_smmu_device);
+    if ( !smmu )
+    {
+        printk(XENLOG_ERR "%s: failed to allocate arm_smmu_device\n",
+               dt_node_full_name(dev));
+        return -ENOMEM;
+    }
+
+    smmu->node = dev;
+    check_driver_options(smmu);
+
+    res = dt_device_get_address(smmu->node, 0, &addr, &size);
+    if ( res )
+    {
+        smmu_err(smmu, "unable to retrieve the base address of the SMMU\n");
+        goto out_err;
+    }
+
+    smmu->base = ioremap_nocache(addr, size);
+    if ( !smmu->base )
+    {
+        smmu_err(smmu, "unable to map the SMMU memory\n");
+        goto out_err;
+    }
+
+    smmu->size = size;
+
+    if ( !dt_property_read_u32(smmu->node, "#global-interrupts",
+                               &smmu->num_global_irqs) )
+    {
+        smmu_err(smmu, "missing #global-interrupts\n");
+        goto out_unmap;
+    }
+
+    num_irqs = dt_number_of_irq(smmu->node);
+    if ( num_irqs > smmu->num_global_irqs )
+        smmu->num_context_irqs = num_irqs - smmu->num_global_irqs;
+
+    if ( !smmu->num_context_irqs )
+    {
+        smmu_err(smmu, "found %d interrupts but expected at least %d\n",
+                 num_irqs, smmu->num_global_irqs + 1);
+        goto out_unmap;
+    }
+
+    smmu->irqs = xzalloc_array(unsigned int, num_irqs);
+    if ( !smmu->irqs )
+    {
+        smmu_err(smmu, "failed to allocated %d irqs\n", num_irqs);
+        goto out_unmap;
+    }
+
+    for ( i = 0; i < num_irqs; i++ )
+    {
+        res = platform_get_irq(smmu->node, i);
+        if ( res < 0 )
+        {
+            smmu_err(smmu, "failed to get irq index %d\n", i);
+            goto out_free_irqs;
+        }
+        smmu->irqs[i] = res;
+    }
+
+    smmu->sids = xzalloc_array(unsigned long,
+                               BITS_TO_LONGS(SMMU_MAX_STREAMIDS));
+    if ( !smmu->sids )
+    {
+        smmu_err(smmu, "failed to allocated bitmap for stream ID tracking\n");
+        goto out_free_masters;
+    }
+
+
+    i = 0;
+    smmu->masters = RB_ROOT;
+    while ( !dt_parse_phandle_with_args(smmu->node, "mmu-masters",
+                                        "#stream-id-cells", i, &masterspec) )
+    {
+        res = register_smmu_master(smmu, &masterspec);
+        if ( res )
+        {
+            smmu_err(smmu, "failed to add master %s\n",
+                     masterspec.np->name);
+            goto out_free_masters;
+        }
+        i++;
+    }
+
+    smmu_info(smmu, "registered %d master devices\n", i);
+
+    res = arm_smmu_device_cfg_probe(smmu);
+    if ( res )
+    {
+        smmu_err(smmu, "failed to probe the SMMU\n");
+        goto out_free_masters;
+    }
+
+    if ( smmu->version > 1 &&
+         smmu->num_context_banks != smmu->num_context_irqs )
+    {
+        smmu_err(smmu,
+                 "found only %d context interrupt(s) but %d required\n",
+                 smmu->num_context_irqs, smmu->num_context_banks);
+        goto out_free_masters;
+    }
+
+    smmu_dbg(smmu, "register global IRQs handler\n");
+
+    for ( i = 0; i < smmu->num_global_irqs; ++i )
+    {
+        smmu_dbg(smmu, "\t- global IRQ %u\n", smmu->irqs[i]);
+        res = request_irq(smmu->irqs[i], IRQF_SHARED, arm_smmu_global_fault,
+                          "arm-smmu global fault", smmu);
+        if ( res )
+        {
+            smmu_err(smmu, "failed to request global IRQ %d (%u)\n",
+                     i, smmu->irqs[i]);
+            goto out_release_irqs;
+        }
+    }
+
+    INIT_LIST_HEAD(&smmu->list);
+    list_add(&smmu->list, &arm_smmu_devices);
+
+    arm_smmu_device_reset(smmu);
+
+    iommu_set_ops(&arm_smmu_iommu_ops);
+
+    /* sids field can be freed... */
+    xfree(smmu->sids);
+    smmu->sids = NULL;
+
+    return 0;
+
+out_release_irqs:
+    while (i--)
+        release_irq(smmu->irqs[i], smmu);
+
+out_free_masters:
+    for ( node = rb_first(&smmu->masters); node; node = rb_next(node) )
+    {
+        struct arm_smmu_master *master;
+
+        master = container_of(node, struct arm_smmu_master, node);
+        xfree(master);
+    }
+
+    xfree(smmu->sids);
+
+out_free_irqs:
+    xfree(smmu->irqs);
+
+out_unmap:
+    iounmap(smmu->base);
+
+out_err:
+    xfree(smmu);
+
+    return -ENODEV;
+}
+
+static const char * const smmu_dt_compat[] __initconst =
+{
+    "arm,mmu-400",
+    NULL
+};
+
+DT_DEVICE_START(smmu, "ARM SMMU", DEVICE_IOMMU)
+    .compatible = smmu_dt_compat,
+    .init = smmu_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:46:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:46:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFX-0002TB-C8; Thu, 19 Jun 2014 04:46:59 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFV-0002Ss-S3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:46:58 +0000
Received: from [193.109.254.147:14167] by server-2.bemta-14.messagelabs.com id
	B2/FF-21684-14B62A35; Thu, 19 Jun 2014 04:46:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1403152657!12261078!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7425 invoked from network); 19 Jun 2014 04:37:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:37:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6T-0002Ti-KM
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxU6T-0007ak-IL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:37:37 +0000
Date: Thu, 19 Jun 2014 04:37:37 +0000
Message-Id: <E1WxU6T-0007ak-IL@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] drivers/passthrough: arm: Add support
	for SMMU drivers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d9e61eb2d2c83356f51939f2be034064e13afc8a
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue May 27 12:11:40 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Mon Jun 2 16:46:00 2014 +0100

    drivers/passthrough: arm: Add support for SMMU drivers
    
    This patch add support for ARM architected SMMU driver. It's based on the
    linux drivers (drivers/iommu/arm-smmu) commit 89ac23cd.
    
    The major differences with the Linux driver are:
        - Fault by default if the SMMU is enabled to translate an
        address (Linux is bypassing the SMMU)
        - Using P2M page table instead of creating new one
        - Dropped stage-1 support
        - Dropped chained SMMUs support for now
        - Reworking device assignment and the different structures
    
    Xen is programming each IOMMU by:
        - Using stage-2 mode translation
        - Sharing the page table with the processor
        - Injecting a fault if the device has made a wrong translation
    
    Signed-off-by: Julien Grall<julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/drivers/passthrough/arm/Makefile |    1 +
 xen/drivers/passthrough/arm/smmu.c   | 1742 ++++++++++++++++++++++++++++++++++
 2 files changed, 1743 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/passthrough/arm/Makefile b/xen/drivers/passthrough/arm/Makefile
index 0484b79..f4cd26e 100644
--- a/xen/drivers/passthrough/arm/Makefile
+++ b/xen/drivers/passthrough/arm/Makefile
@@ -1 +1,2 @@
 obj-y += iommu.o
+obj-y += smmu.o
diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/arm/smmu.c
new file mode 100644
index 0000000..21b4572
--- /dev/null
+++ b/xen/drivers/passthrough/arm/smmu.c
@@ -0,0 +1,1742 @@
+/*
+ * IOMMU API for ARM architected SMMU implementations.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * Based on Linux drivers/iommu/arm-smmu.c (commit 89a23cd)
+ * Copyright (C) 2013 ARM Limited
+ *
+ * Author: Will Deacon <will.deacon@arm.com>
+ *
+ * Xen modification:
+ * Julien Grall <julien.grall@linaro.org>
+ * Copyright (C) 2014 Linaro Limited.
+ *
+ * This driver currently supports:
+ *  - SMMUv1 and v2 implementations (didn't try v2 SMMU)
+ *  - Stream-matching and stream-indexing
+ *  - v7/v8 long-descriptor format
+ *  - Non-secure access to the SMMU
+ *  - 4k pages, p2m shared with the processor
+ *  - Up to 40-bit addressing
+ *  - Context fault reporting
+ */
+
+#include <xen/config.h>
+#include <xen/delay.h>
+#include <xen/errno.h>
+#include <xen/irq.h>
+#include <xen/lib.h>
+#include <xen/list.h>
+#include <xen/mm.h>
+#include <xen/vmap.h>
+#include <xen/rbtree.h>
+#include <xen/sched.h>
+#include <asm/atomic.h>
+#include <asm/device.h>
+#include <asm/io.h>
+#include <asm/platform.h>
+
+/* Driver options */
+#define SMMU_OPT_SECURE_CONFIG_ACCESS   (1 << 0)
+
+/* Maximum number of stream IDs assigned to a single device */
+#define MAX_MASTER_STREAMIDS    MAX_PHANDLE_ARGS
+
+/* Maximum stream ID */
+#define SMMU_MAX_STREAMIDS      (PAGE_SIZE_64K - 1)
+
+/* Maximum number of context banks per SMMU */
+#define SMMU_MAX_CBS        128
+
+/* Maximum number of mapping groups per SMMU */
+#define SMMU_MAX_SMRS       128
+
+/* SMMU global address space */
+#define SMMU_GR0(smmu)      ((smmu)->base)
+#define SMMU_GR1(smmu)      ((smmu)->base + (smmu)->pagesize)
+
+/*
+ * SMMU global address space with conditional offset to access secure aliases of
+ * non-secure registers (e.g. nsCR0: 0x400, nsGFSR: 0x448, nsGFSYNR0: 0x450)
+ */
+#define SMMU_GR0_NS(smmu)                                   \
+    ((smmu)->base +                                         \
+     ((smmu->options & SMMU_OPT_SECURE_CONFIG_ACCESS)    \
+        ? 0x400 : 0))
+
+/* Page table bits */
+#define SMMU_PTE_PAGE           (((pteval_t)3) << 0)
+#define SMMU_PTE_CONT           (((pteval_t)1) << 52)
+#define SMMU_PTE_AF             (((pteval_t)1) << 10)
+#define SMMU_PTE_SH_NS          (((pteval_t)0) << 8)
+#define SMMU_PTE_SH_OS          (((pteval_t)2) << 8)
+#define SMMU_PTE_SH_IS          (((pteval_t)3) << 8)
+
+#if PAGE_SIZE == PAGE_SIZE_4K
+#define SMMU_PTE_CONT_ENTRIES   16
+#elif PAGE_SIZE == PAGE_SIZE_64K
+#define SMMU_PTE_CONT_ENTRIES   32
+#else
+#define SMMU_PTE_CONT_ENTRIES   1
+#endif
+
+#define SMMU_PTE_CONT_SIZE      (PAGE_SIZE * SMMU_PTE_CONT_ENTRIES)
+#define SMMU_PTE_CONT_MASK      (~(SMMU_PTE_CONT_SIZE - 1))
+#define SMMU_PTE_HWTABLE_SIZE   (PTRS_PER_PTE * sizeof(pte_t))
+
+/* Stage-1 PTE */
+#define SMMU_PTE_AP_UNPRIV      (((pteval_t)1) << 6)
+#define SMMU_PTE_AP_RDONLY      (((pteval_t)2) << 6)
+#define SMMU_PTE_ATTRINDX_SHIFT 2
+#define SMMU_PTE_nG             (((pteval_t)1) << 11)
+
+/* Stage-2 PTE */
+#define SMMU_PTE_HAP_FAULT      (((pteval_t)0) << 6)
+#define SMMU_PTE_HAP_READ       (((pteval_t)1) << 6)
+#define SMMU_PTE_HAP_WRITE      (((pteval_t)2) << 6)
+#define SMMU_PTE_MEMATTR_OIWB   (((pteval_t)0xf) << 2)
+#define SMMU_PTE_MEMATTR_NC     (((pteval_t)0x5) << 2)
+#define SMMU_PTE_MEMATTR_DEV    (((pteval_t)0x1) << 2)
+
+/* Configuration registers */
+#define SMMU_GR0_sCR0           0x0
+#define SMMU_sCR0_CLIENTPD      (1 << 0)
+#define SMMU_sCR0_GFRE          (1 << 1)
+#define SMMU_sCR0_GFIE          (1 << 2)
+#define SMMU_sCR0_GCFGFRE       (1 << 4)
+#define SMMU_sCR0_GCFGFIE       (1 << 5)
+#define SMMU_sCR0_USFCFG        (1 << 10)
+#define SMMU_sCR0_VMIDPNE       (1 << 11)
+#define SMMU_sCR0_PTM           (1 << 12)
+#define SMMU_sCR0_FB            (1 << 13)
+#define SMMU_sCR0_BSU_SHIFT     14
+#define SMMU_sCR0_BSU_MASK      0x3
+
+/* Identification registers */
+#define SMMU_GR0_ID0            0x20
+#define SMMU_GR0_ID1            0x24
+#define SMMU_GR0_ID2            0x28
+#define SMMU_GR0_ID3            0x2c
+#define SMMU_GR0_ID4            0x30
+#define SMMU_GR0_ID5            0x34
+#define SMMU_GR0_ID6            0x38
+#define SMMU_GR0_ID7            0x3c
+#define SMMU_GR0_sGFSR          0x48
+#define SMMU_GR0_sGFSYNR0       0x50
+#define SMMU_GR0_sGFSYNR1       0x54
+#define SMMU_GR0_sGFSYNR2       0x58
+#define SMMU_GR0_PIDR0          0xfe0
+#define SMMU_GR0_PIDR1          0xfe4
+#define SMMU_GR0_PIDR2          0xfe8
+
+#define SMMU_ID0_S1TS           (1 << 30)
+#define SMMU_ID0_S2TS           (1 << 29)
+#define SMMU_ID0_NTS            (1 << 28)
+#define SMMU_ID0_SMS            (1 << 27)
+#define SMMU_ID0_PTFS_SHIFT     24
+#define SMMU_ID0_PTFS_MASK      0x2
+#define SMMU_ID0_PTFS_V8_ONLY   0x2
+#define SMMU_ID0_CTTW           (1 << 14)
+#define SMMU_ID0_NUMIRPT_SHIFT  16
+#define SMMU_ID0_NUMIRPT_MASK   0xff
+#define SMMU_ID0_NUMSMRG_SHIFT  0
+#define SMMU_ID0_NUMSMRG_MASK   0xff
+
+#define SMMU_ID1_PAGESIZE            (1 << 31)
+#define SMMU_ID1_NUMPAGENDXB_SHIFT   28
+#define SMMU_ID1_NUMPAGENDXB_MASK    7
+#define SMMU_ID1_NUMS2CB_SHIFT       16
+#define SMMU_ID1_NUMS2CB_MASK        0xff
+#define SMMU_ID1_NUMCB_SHIFT         0
+#define SMMU_ID1_NUMCB_MASK          0xff
+
+#define SMMU_ID2_OAS_SHIFT           4
+#define SMMU_ID2_OAS_MASK            0xf
+#define SMMU_ID2_IAS_SHIFT           0
+#define SMMU_ID2_IAS_MASK            0xf
+#define SMMU_ID2_UBS_SHIFT           8
+#define SMMU_ID2_UBS_MASK            0xf
+#define SMMU_ID2_PTFS_4K             (1 << 12)
+#define SMMU_ID2_PTFS_16K            (1 << 13)
+#define SMMU_ID2_PTFS_64K            (1 << 14)
+
+#define SMMU_PIDR2_ARCH_SHIFT        4
+#define SMMU_PIDR2_ARCH_MASK         0xf
+
+/* Global TLB invalidation */
+#define SMMU_GR0_STLBIALL           0x60
+#define SMMU_GR0_TLBIVMID           0x64
+#define SMMU_GR0_TLBIALLNSNH        0x68
+#define SMMU_GR0_TLBIALLH           0x6c
+#define SMMU_GR0_sTLBGSYNC          0x70
+#define SMMU_GR0_sTLBGSTATUS        0x74
+#define SMMU_sTLBGSTATUS_GSACTIVE   (1 << 0)
+#define SMMU_TLB_LOOP_TIMEOUT       1000000 /* 1s! */
+
+/* Stream mapping registers */
+#define SMMU_GR0_SMR(n)             (0x800 + ((n) << 2))
+#define SMMU_SMR_VALID              (1 << 31)
+#define SMMU_SMR_MASK_SHIFT         16
+#define SMMU_SMR_MASK_MASK          0x7fff
+#define SMMU_SMR_ID_SHIFT           0
+#define SMMU_SMR_ID_MASK            0x7fff
+
+#define SMMU_GR0_S2CR(n)        (0xc00 + ((n) << 2))
+#define SMMU_S2CR_CBNDX_SHIFT   0
+#define SMMU_S2CR_CBNDX_MASK    0xff
+#define SMMU_S2CR_TYPE_SHIFT    16
+#define SMMU_S2CR_TYPE_MASK     0x3
+#define SMMU_S2CR_TYPE_TRANS    (0 << SMMU_S2CR_TYPE_SHIFT)
+#define SMMU_S2CR_TYPE_BYPASS   (1 << SMMU_S2CR_TYPE_SHIFT)
+#define SMMU_S2CR_TYPE_FAULT    (2 << SMMU_S2CR_TYPE_SHIFT)
+
+/* Context bank attribute registers */
+#define SMMU_GR1_CBAR(n)                    (0x0 + ((n) << 2))
+#define SMMU_CBAR_VMID_SHIFT                0
+#define SMMU_CBAR_VMID_MASK                 0xff
+#define SMMU_CBAR_S1_MEMATTR_SHIFT          12
+#define SMMU_CBAR_S1_MEMATTR_MASK           0xf
+#define SMMU_CBAR_S1_MEMATTR_WB             0xf
+#define SMMU_CBAR_TYPE_SHIFT                16
+#define SMMU_CBAR_TYPE_MASK                 0x3
+#define SMMU_CBAR_TYPE_S2_TRANS             (0 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_TYPE_S1_TRANS_S2_BYPASS   (1 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_TYPE_S1_TRANS_S2_FAULT    (2 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_TYPE_S1_TRANS_S2_TRANS    (3 << SMMU_CBAR_TYPE_SHIFT)
+#define SMMU_CBAR_IRPTNDX_SHIFT             24
+#define SMMU_CBAR_IRPTNDX_MASK              0xff
+
+#define SMMU_GR1_CBA2R(n)                   (0x800 + ((n) << 2))
+#define SMMU_CBA2R_RW64_32BIT               (0 << 0)
+#define SMMU_CBA2R_RW64_64BIT               (1 << 0)
+
+/* Translation context bank */
+#define SMMU_CB_BASE(smmu)                  ((smmu)->base + ((smmu)->size >> 1))
+#define SMMU_CB(smmu, n)                    ((n) * (smmu)->pagesize)
+
+#define SMMU_CB_SCTLR                       0x0
+#define SMMU_CB_RESUME                      0x8
+#define SMMU_CB_TCR2                        0x10
+#define SMMU_CB_TTBR0_LO                    0x20
+#define SMMU_CB_TTBR0_HI                    0x24
+#define SMMU_CB_TCR                         0x30
+#define SMMU_CB_S1_MAIR0                    0x38
+#define SMMU_CB_FSR                         0x58
+#define SMMU_CB_FAR_LO                      0x60
+#define SMMU_CB_FAR_HI                      0x64
+#define SMMU_CB_FSYNR0                      0x68
+#define SMMU_CB_S1_TLBIASID                 0x610
+
+#define SMMU_SCTLR_S1_ASIDPNE               (1 << 12)
+#define SMMU_SCTLR_CFCFG                    (1 << 7)
+#define SMMU_SCTLR_CFIE                     (1 << 6)
+#define SMMU_SCTLR_CFRE                     (1 << 5)
+#define SMMU_SCTLR_E                        (1 << 4)
+#define SMMU_SCTLR_AFE                      (1 << 2)
+#define SMMU_SCTLR_TRE                      (1 << 1)
+#define SMMU_SCTLR_M                        (1 << 0)
+#define SMMU_SCTLR_EAE_SBOP                 (SMMU_SCTLR_AFE | SMMU_SCTLR_TRE)
+
+#define SMMU_RESUME_RETRY                   (0 << 0)
+#define SMMU_RESUME_TERMINATE               (1 << 0)
+
+#define SMMU_TCR_EAE                        (1 << 31)
+
+#define SMMU_TCR_PASIZE_SHIFT               16
+#define SMMU_TCR_PASIZE_MASK                0x7
+
+#define SMMU_TCR_TG0_4K                     (0 << 14)
+#define SMMU_TCR_TG0_64K                    (1 << 14)
+
+#define SMMU_TCR_SH0_SHIFT                  12
+#define SMMU_TCR_SH0_MASK                   0x3
+#define SMMU_TCR_SH_NS                      0
+#define SMMU_TCR_SH_OS                      2
+#define SMMU_TCR_SH_IS                      3
+
+#define SMMU_TCR_ORGN0_SHIFT                10
+#define SMMU_TCR_IRGN0_SHIFT                8
+#define SMMU_TCR_RGN_MASK                   0x3
+#define SMMU_TCR_RGN_NC                     0
+#define SMMU_TCR_RGN_WBWA                   1
+#define SMMU_TCR_RGN_WT                     2
+#define SMMU_TCR_RGN_WB                     3
+
+#define SMMU_TCR_SL0_SHIFT                  6
+#define SMMU_TCR_SL0_MASK                   0x3
+#define SMMU_TCR_SL0_LVL_2                  0
+#define SMMU_TCR_SL0_LVL_1                  1
+
+#define SMMU_TCR_T1SZ_SHIFT                 16
+#define SMMU_TCR_T0SZ_SHIFT                 0
+#define SMMU_TCR_SZ_MASK                    0xf
+
+#define SMMU_TCR2_SEP_SHIFT                 15
+#define SMMU_TCR2_SEP_MASK                  0x7
+
+#define SMMU_TCR2_PASIZE_SHIFT              0
+#define SMMU_TCR2_PASIZE_MASK               0x7
+
+/* Common definitions for PASize and SEP fields */
+#define SMMU_TCR2_ADDR_32                   0
+#define SMMU_TCR2_ADDR_36                   1
+#define SMMU_TCR2_ADDR_40                   2
+#define SMMU_TCR2_ADDR_42                   3
+#define SMMU_TCR2_ADDR_44                   4
+#define SMMU_TCR2_ADDR_48                   5
+
+#define SMMU_TTBRn_HI_ASID_SHIFT            16
+
+#define SMMU_MAIR_ATTR_SHIFT(n)             ((n) << 3)
+#define SMMU_MAIR_ATTR_MASK                 0xff
+#define SMMU_MAIR_ATTR_DEVICE               0x04
+#define SMMU_MAIR_ATTR_NC                   0x44
+#define SMMU_MAIR_ATTR_WBRWA                0xff
+#define SMMU_MAIR_ATTR_IDX_NC               0
+#define SMMU_MAIR_ATTR_IDX_CACHE            1
+#define SMMU_MAIR_ATTR_IDX_DEV              2
+
+#define SMMU_FSR_MULTI                      (1 << 31)
+#define SMMU_FSR_SS                         (1 << 30)
+#define SMMU_FSR_UUT                        (1 << 8)
+#define SMMU_FSR_ASF                        (1 << 7)
+#define SMMU_FSR_TLBLKF                     (1 << 6)
+#define SMMU_FSR_TLBMCF                     (1 << 5)
+#define SMMU_FSR_EF                         (1 << 4)
+#define SMMU_FSR_PF                         (1 << 3)
+#define SMMU_FSR_AFF                        (1 << 2)
+#define SMMU_FSR_TF                         (1 << 1)
+
+#define SMMU_FSR_IGN                        (SMMU_FSR_AFF | SMMU_FSR_ASF |    \
+                                             SMMU_FSR_TLBMCF | SMMU_FSR_TLBLKF)
+#define SMMU_FSR_FAULT                      (SMMU_FSR_MULTI | SMMU_FSR_SS |   \
+                                             SMMU_FSR_UUT | SMMU_FSR_EF |     \
+                                             SMMU_FSR_PF | SMMU_FSR_TF |      \
+                                             SMMU_FSR_IGN)
+
+#define SMMU_FSYNR0_WNR                     (1 << 4)
+
+#define smmu_print(dev, lvl, fmt, ...)                                        \
+    printk(lvl "smmu: %s: " fmt, dt_node_full_name(dev->node), ## __VA_ARGS__)
+
+#define smmu_err(dev, fmt, ...) smmu_print(dev, XENLOG_ERR, fmt, ## __VA_ARGS__)
+
+#define smmu_dbg(dev, fmt, ...)                                             \
+    smmu_print(dev, XENLOG_DEBUG, fmt, ## __VA_ARGS__)
+
+#define smmu_info(dev, fmt, ...)                                            \
+    smmu_print(dev, XENLOG_INFO, fmt, ## __VA_ARGS__)
+
+#define smmu_warn(dev, fmt, ...)                                            \
+    smmu_print(dev, XENLOG_WARNING, fmt, ## __VA_ARGS__)
+
+struct arm_smmu_device {
+    const struct dt_device_node *node;
+
+    void __iomem                *base;
+    unsigned long               size;
+    unsigned long               pagesize;
+
+#define SMMU_FEAT_COHERENT_WALK (1 << 0)
+#define SMMU_FEAT_STREAM_MATCH  (1 << 1)
+#define SMMU_FEAT_TRANS_S1      (1 << 2)
+#define SMMU_FEAT_TRANS_S2      (1 << 3)
+#define SMMU_FEAT_TRANS_NESTED  (1 << 4)
+    u32                         features;
+    u32                         options;
+    int                         version;
+
+    u32                         num_context_banks;
+    u32                         num_s2_context_banks;
+    DECLARE_BITMAP(context_map, SMMU_MAX_CBS);
+    atomic_t                    irptndx;
+
+    u32                         num_mapping_groups;
+    DECLARE_BITMAP(smr_map, SMMU_MAX_SMRS);
+
+    unsigned long               input_size;
+    unsigned long               s1_output_size;
+    unsigned long               s2_output_size;
+
+    u32                         num_global_irqs;
+    u32                         num_context_irqs;
+    unsigned int                *irqs;
+
+    u32                         smr_mask_mask;
+    u32                         smr_id_mask;
+
+    unsigned long               *sids;
+
+    struct list_head            list;
+    struct rb_root              masters;
+};
+
+struct arm_smmu_smr {
+    u8                          idx;
+    u16                         mask;
+    u16                         id;
+};
+
+#define INVALID_IRPTNDX         0xff
+
+#define SMMU_CB_ASID(cfg)       ((cfg)->cbndx)
+#define SMMU_CB_VMID(cfg)       ((cfg)->cbndx + 1)
+
+struct arm_smmu_domain_cfg {
+    struct arm_smmu_device  *smmu;
+    u8                      cbndx;
+    u8                      irptndx;
+    u32                     cbar;
+    /* Domain associated to this device */
+    struct domain           *domain;
+    /* List of master which use this structure */
+    struct list_head        masters;
+
+    /* Used to link domain context for a same domain */
+    struct list_head        list;
+};
+
+struct arm_smmu_master {
+    const struct dt_device_node *dt_node;
+
+    /*
+     * The following is specific to the master's position in the
+     * SMMU chain.
+     */
+    struct rb_node              node;
+    u32                         num_streamids;
+    u16                         streamids[MAX_MASTER_STREAMIDS];
+    int                         num_s2crs;
+
+    struct arm_smmu_smr         *smrs;
+    struct arm_smmu_domain_cfg  *cfg;
+
+    /* Used to link masters in a same domain context */
+    struct list_head            list;
+};
+
+static LIST_HEAD(arm_smmu_devices);
+
+struct arm_smmu_domain {
+    spinlock_t lock;
+    struct list_head contexts;
+};
+
+struct arm_smmu_option_prop {
+    u32         opt;
+    const char  *prop;
+};
+
+static const struct arm_smmu_option_prop arm_smmu_options [] __initconst =
+{
+    { SMMU_OPT_SECURE_CONFIG_ACCESS, "calxeda,smmu-secure-config-access" },
+    { 0, NULL},
+};
+
+static void __init check_driver_options(struct arm_smmu_device *smmu)
+{
+    int i = 0;
+
+    do {
+        if ( dt_property_read_bool(smmu->node, arm_smmu_options[i].prop) )
+        {
+            smmu->options |= arm_smmu_options[i].opt;
+            smmu_dbg(smmu, "option %s\n", arm_smmu_options[i].prop);
+        }
+    } while ( arm_smmu_options[++i].opt );
+}
+
+static void arm_smmu_context_fault(int irq, void *data,
+                                   struct cpu_user_regs *regs)
+{
+    u32 fsr, far, fsynr;
+    uint64_t iova;
+    struct arm_smmu_domain_cfg *cfg = data;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *cb_base;
+
+    cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx);
+    fsr = readl_relaxed(cb_base + SMMU_CB_FSR);
+
+    if ( !(fsr & SMMU_FSR_FAULT) )
+        return;
+
+    if ( fsr & SMMU_FSR_IGN )
+        smmu_err(smmu, "Unexpected context fault (fsr 0x%u)\n", fsr);
+
+    fsynr = readl_relaxed(cb_base + SMMU_CB_FSYNR0);
+    far = readl_relaxed(cb_base + SMMU_CB_FAR_LO);
+    iova = far;
+    far = readl_relaxed(cb_base + SMMU_CB_FAR_HI);
+    iova |= ((uint64_t)far << 32);
+
+    smmu_err(smmu, "Unhandled context fault for domain %u\n",
+             cfg->domain->domain_id);
+    smmu_err(smmu, "\tFSR 0x%x, IOVA 0x%"PRIx64", FSYNR 0x%x,  CB %d\n",
+             fsr, iova, fsynr, cfg->cbndx);
+
+    /* Clear the faulting FSR */
+    writel(fsr, cb_base + SMMU_CB_FSR);
+
+    /* Terminate any stalled transactions */
+    if ( fsr & SMMU_FSR_SS )
+        writel_relaxed(SMMU_RESUME_TERMINATE, cb_base + SMMU_CB_RESUME);
+}
+
+static void arm_smmu_global_fault(int irq, void *data,
+                                  struct cpu_user_regs *regs)
+{
+    u32 gfsr, gfsynr0, gfsynr1, gfsynr2;
+    struct arm_smmu_device *smmu = data;
+    void __iomem *gr0_base = SMMU_GR0_NS(smmu);
+
+    gfsr = readl_relaxed(gr0_base + SMMU_GR0_sGFSR);
+    gfsynr0 = readl_relaxed(gr0_base + SMMU_GR0_sGFSYNR0);
+    gfsynr1 = readl_relaxed(gr0_base + SMMU_GR0_sGFSYNR1);
+    gfsynr2 = readl_relaxed(gr0_base + SMMU_GR0_sGFSYNR2);
+
+    if ( !gfsr )
+        return;
+
+    smmu_err(smmu, "Unexpected global fault, this could be serious\n");
+    smmu_err(smmu,
+             "\tGFSR 0x%08x, GFSYNR0 0x%08x, GFSYNR1 0x%08x, GFSYNR2 0x%08x\n",
+             gfsr, gfsynr0, gfsynr1, gfsynr2);
+    writel(gfsr, gr0_base + SMMU_GR0_sGFSR);
+}
+
+static struct arm_smmu_master *
+find_smmu_master(struct arm_smmu_device *smmu,
+                 const struct dt_device_node *dev_node)
+{
+    struct rb_node *node = smmu->masters.rb_node;
+
+    while ( node )
+    {
+        struct arm_smmu_master *master;
+
+        master = container_of(node, struct arm_smmu_master, node);
+
+        if ( dev_node < master->dt_node )
+            node = node->rb_left;
+        else if ( dev_node > master->dt_node )
+            node = node->rb_right;
+        else
+            return master;
+    }
+
+    return NULL;
+}
+
+static __init int insert_smmu_master(struct arm_smmu_device *smmu,
+                                     struct arm_smmu_master *master)
+{
+    struct rb_node **new, *parent;
+
+    new = &smmu->masters.rb_node;
+    parent = NULL;
+    while ( *new )
+    {
+        struct arm_smmu_master *this;
+
+        this = container_of(*new, struct arm_smmu_master, node);
+
+        parent = *new;
+        if ( master->dt_node < this->dt_node )
+            new = &((*new)->rb_left);
+        else if (master->dt_node > this->dt_node)
+            new = &((*new)->rb_right);
+        else
+            return -EEXIST;
+    }
+
+    rb_link_node(&master->node, parent, new);
+    rb_insert_color(&master->node, &smmu->masters);
+    return 0;
+}
+
+static __init int register_smmu_master(struct arm_smmu_device *smmu,
+                                       struct dt_phandle_args *masterspec)
+{
+    int i, sid;
+    struct arm_smmu_master *master;
+    int rc = 0;
+
+    smmu_dbg(smmu, "Try to add master %s\n", masterspec->np->name);
+
+    master = find_smmu_master(smmu, masterspec->np);
+    if ( master )
+    {
+        smmu_err(smmu,
+                 "rejecting multiple registrations for master device %s\n",
+                 masterspec->np->name);
+        return -EBUSY;
+    }
+
+    if ( masterspec->args_count > MAX_MASTER_STREAMIDS )
+    {
+        smmu_err(smmu,
+            "reached maximum number (%d) of stream IDs for master device %s\n",
+            MAX_MASTER_STREAMIDS, masterspec->np->name);
+        return -ENOSPC;
+    }
+
+    master = xzalloc(struct arm_smmu_master);
+    if ( !master )
+        return -ENOMEM;
+
+    INIT_LIST_HEAD(&master->list);
+    master->dt_node = masterspec->np;
+    master->num_streamids = masterspec->args_count;
+
+    dt_device_set_protected(masterspec->np);
+
+    for ( i = 0; i < master->num_streamids; ++i )
+    {
+        sid = masterspec->args[i];
+        if ( test_and_set_bit(sid, smmu->sids) )
+        {
+            smmu_err(smmu, "duplicate stream ID (%d)\n", sid);
+            xfree(master);
+            return -EEXIST;
+        }
+        master->streamids[i] = masterspec->args[i];
+    }
+
+    rc = insert_smmu_master(smmu, master);
+    /* Insertion should never fail */
+    ASSERT(rc == 0);
+
+    return 0;
+}
+
+static int __arm_smmu_alloc_bitmap(unsigned long *map, int start, int end)
+{
+    int idx;
+
+    do
+    {
+        idx = find_next_zero_bit(map, end, start);
+        if ( idx == end )
+            return -ENOSPC;
+    } while ( test_and_set_bit(idx, map) );
+
+    return idx;
+}
+
+static void __arm_smmu_free_bitmap(unsigned long *map, int idx)
+{
+    clear_bit(idx, map);
+}
+
+static void arm_smmu_tlb_sync(struct arm_smmu_device *smmu)
+{
+    int count = 0;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+
+    writel_relaxed(0, gr0_base + SMMU_GR0_sTLBGSYNC);
+    while ( readl_relaxed(gr0_base + SMMU_GR0_sTLBGSTATUS) &
+            SMMU_sTLBGSTATUS_GSACTIVE )
+    {
+        cpu_relax();
+        if ( ++count == SMMU_TLB_LOOP_TIMEOUT )
+        {
+            smmu_err(smmu, "TLB sync timed out -- SMMU may be deadlocked\n");
+            return;
+        }
+        udelay(1);
+    }
+}
+
+static void arm_smmu_tlb_inv_context(struct arm_smmu_domain_cfg *cfg)
+{
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *base = SMMU_GR0(smmu);
+
+    writel_relaxed(SMMU_CB_VMID(cfg),
+                   base + SMMU_GR0_TLBIVMID);
+
+    arm_smmu_tlb_sync(smmu);
+}
+
+static void arm_smmu_iotlb_flush_all(struct domain *d)
+{
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_domain_cfg *cfg;
+
+    spin_lock(&smmu_domain->lock);
+    list_for_each_entry(cfg, &smmu_domain->contexts, list)
+        arm_smmu_tlb_inv_context(cfg);
+    spin_unlock(&smmu_domain->lock);
+}
+
+static void arm_smmu_iotlb_flush(struct domain *d, unsigned long gfn,
+                                 unsigned int page_count)
+{
+    /* ARM SMMU v1 doesn't have flush by VMA and VMID */
+    arm_smmu_iotlb_flush_all(d);
+}
+
+static int determine_smr_mask(struct arm_smmu_device *smmu,
+                              struct arm_smmu_master *master,
+                              struct arm_smmu_smr *smr, int start, int order)
+{
+    u16 i, zero_bits_mask, one_bits_mask, const_mask;
+    int nr;
+
+    nr = 1 << order;
+
+    if ( nr == 1 )
+    {
+        /* no mask, use streamid to match and be done with it */
+        smr->mask = 0;
+        smr->id = master->streamids[start];
+        return 0;
+    }
+
+    zero_bits_mask = 0;
+    one_bits_mask = 0xffff;
+    for ( i = start; i < start + nr; i++)
+    {
+        zero_bits_mask |= master->streamids[i];   /* const 0 bits */
+        one_bits_mask &= master->streamids[i]; /* const 1 bits */
+    }
+    zero_bits_mask = ~zero_bits_mask;
+
+    /* bits having constant values (either 0 or 1) */
+    const_mask = zero_bits_mask | one_bits_mask;
+
+    i = hweight16(~const_mask);
+    if ( (1 << i) == nr )
+    {
+        smr->mask = ~const_mask;
+        smr->id = one_bits_mask;
+    }
+    else
+        /* no usable mask for this set of streamids */
+        return 1;
+
+    if ( ((smr->mask & smmu->smr_mask_mask) != smr->mask) ||
+         ((smr->id & smmu->smr_id_mask) != smr->id) )
+        /* insufficient number of mask/id bits */
+        return 1;
+
+    return 0;
+}
+
+static int determine_smr_mapping(struct arm_smmu_device *smmu,
+                                 struct arm_smmu_master *master,
+                                 struct arm_smmu_smr *smrs, int max_smrs)
+{
+    int nr_sid, nr, i, bit, start;
+
+    /*
+     * This function is called only once -- when a master is added
+     * to a domain. If master->num_s2crs != 0 then this master
+     * was already added to a domain.
+     */
+    BUG_ON(master->num_s2crs);
+
+    start = nr = 0;
+    nr_sid = master->num_streamids;
+    do
+    {
+        /*
+         * largest power-of-2 number of streamids for which to
+         * determine a usable mask/id pair for stream matching
+         */
+        bit = fls(nr_sid);
+        if (!bit)
+            return 0;
+
+        /*
+         * iterate over power-of-2 numbers to determine
+         * largest possible mask/id pair for stream matching
+         * of next 2**i streamids
+         */
+        for ( i = bit - 1; i >= 0; i-- )
+        {
+            if( !determine_smr_mask(smmu, master,
+                                    &smrs[master->num_s2crs],
+                                    start, i))
+                break;
+        }
+
+        if ( i < 0 )
+            goto out;
+
+        nr = 1 << i;
+        nr_sid -= nr;
+        start += nr;
+        master->num_s2crs++;
+    } while ( master->num_s2crs <= max_smrs );
+
+out:
+    if ( nr_sid )
+    {
+        /* not enough mapping groups available */
+        master->num_s2crs = 0;
+        return -ENOSPC;
+    }
+
+    return 0;
+}
+
+static int arm_smmu_master_configure_smrs(struct arm_smmu_device *smmu,
+                                          struct arm_smmu_master *master)
+{
+    int i, max_smrs, ret;
+    struct arm_smmu_smr *smrs;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+
+    if ( !(smmu->features & SMMU_FEAT_STREAM_MATCH) )
+        return 0;
+
+    if ( master->smrs )
+        return -EEXIST;
+
+    max_smrs = min(smmu->num_mapping_groups, master->num_streamids);
+    smrs = xmalloc_array(struct arm_smmu_smr, max_smrs);
+    if ( !smrs )
+    {
+        smmu_err(smmu, "failed to allocated %d SMRs for master %s\n",
+                 max_smrs, dt_node_name(master->dt_node));
+        return -ENOMEM;
+    }
+
+    ret = determine_smr_mapping(smmu, master, smrs, max_smrs);
+    if ( ret )
+        goto err_free_smrs;
+
+    /* Allocate the SMRs on the root SMMU */
+    for ( i = 0; i < master->num_s2crs; ++i )
+    {
+        int idx = __arm_smmu_alloc_bitmap(smmu->smr_map, 0,
+                                          smmu->num_mapping_groups);
+        if ( idx < 0 )
+        {
+            smmu_err(smmu, "failed to allocate free SMR\n");
+            goto err_free_bitmap;
+        }
+        smrs[i].idx = idx;
+    }
+
+    /* It worked! Now, poke the actual hardware */
+    for ( i = 0; i < master->num_s2crs; ++i )
+    {
+        u32 reg = SMMU_SMR_VALID | smrs[i].id << SMMU_SMR_ID_SHIFT |
+            smrs[i].mask << SMMU_SMR_MASK_SHIFT;
+        smmu_dbg(smmu, "SMR%d: 0x%x\n", smrs[i].idx, reg);
+        writel_relaxed(reg, gr0_base + SMMU_GR0_SMR(smrs[i].idx));
+    }
+
+    master->smrs = smrs;
+    return 0;
+
+err_free_bitmap:
+    while (--i >= 0)
+        __arm_smmu_free_bitmap(smmu->smr_map, smrs[i].idx);
+    master->num_s2crs = 0;
+err_free_smrs:
+    xfree(smrs);
+    return -ENOSPC;
+}
+
+/* Forward declaration */
+static void arm_smmu_destroy_domain_context(struct arm_smmu_domain_cfg *cfg);
+
+static int arm_smmu_domain_add_master(struct domain *d,
+                                      struct arm_smmu_domain_cfg *cfg,
+                                      struct arm_smmu_master *master)
+{
+    int i, ret;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    struct arm_smmu_smr *smrs = master->smrs;
+
+    if ( master->cfg )
+        return -EBUSY;
+
+    ret = arm_smmu_master_configure_smrs(smmu, master);
+    if ( ret )
+        return ret;
+
+    /* Now we're at the root, time to point at our context bank */
+    if ( !master->num_s2crs )
+        master->num_s2crs = master->num_streamids;
+
+    for ( i = 0; i < master->num_s2crs; ++i )
+    {
+        u32 idx, s2cr;
+
+        idx = smrs ? smrs[i].idx : master->streamids[i];
+        s2cr = (SMMU_S2CR_TYPE_TRANS << SMMU_S2CR_TYPE_SHIFT) |
+            (cfg->cbndx << SMMU_S2CR_CBNDX_SHIFT);
+        smmu_dbg(smmu, "S2CR%d: 0x%x\n", idx, s2cr);
+        writel_relaxed(s2cr, gr0_base + SMMU_GR0_S2CR(idx));
+    }
+
+    master->cfg = cfg;
+    list_add(&master->list, &cfg->masters);
+
+    return 0;
+}
+
+static void arm_smmu_domain_remove_master(struct arm_smmu_master *master)
+{
+    int i;
+    struct arm_smmu_domain_cfg *cfg = master->cfg;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    struct arm_smmu_smr *smrs = master->smrs;
+
+    /*
+     * We *must* clear the S2CR first, because freeing the SMR means
+     * that it can be reallocated immediately
+     */
+    for ( i = 0; i < master->num_streamids; ++i )
+    {
+        u16 sid = master->streamids[i];
+        writel_relaxed(SMMU_S2CR_TYPE_FAULT,
+                       gr0_base + SMMU_GR0_S2CR(sid));
+    }
+
+    /* Invalidate the SMRs before freeing back to the allocator */
+    for (i = 0; i < master->num_s2crs; ++i) {
+        u8 idx = smrs[i].idx;
+        writel_relaxed(~SMMU_SMR_VALID, gr0_base + SMMU_GR0_SMR(idx));
+        __arm_smmu_free_bitmap(smmu->smr_map, idx);
+    }
+
+    master->smrs = NULL;
+    master->num_s2crs = 0;
+    xfree(smrs);
+
+    master->cfg = NULL;
+    list_del(&master->list);
+    INIT_LIST_HEAD(&master->list);
+}
+
+static void arm_smmu_init_context_bank(struct arm_smmu_domain_cfg *cfg)
+{
+    u32 reg;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *cb_base, *gr1_base;
+    paddr_t p2maddr;
+
+    ASSERT(cfg->domain != NULL);
+    p2maddr = page_to_maddr(cfg->domain->arch.p2m.first_level);
+
+    gr1_base = SMMU_GR1(smmu);
+    cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx);
+
+    /* CBAR */
+    reg = cfg->cbar;
+    if ( smmu->version == 1 )
+        reg |= cfg->irptndx << SMMU_CBAR_IRPTNDX_SHIFT;
+
+    reg |= SMMU_CB_VMID(cfg) << SMMU_CBAR_VMID_SHIFT;
+    writel_relaxed(reg, gr1_base + SMMU_GR1_CBAR(cfg->cbndx));
+
+    if ( smmu->version > 1 )
+    {
+        /* CBA2R */
+#ifdef CONFIG_ARM_64
+        reg = SMMU_CBA2R_RW64_64BIT;
+#else
+        reg = SMMU_CBA2R_RW64_32BIT;
+#endif
+        writel_relaxed(reg, gr1_base + SMMU_GR1_CBA2R(cfg->cbndx));
+    }
+
+    /* TTBR0 */
+    reg = (p2maddr & ((1ULL << 32) - 1));
+    writel_relaxed(reg, cb_base + SMMU_CB_TTBR0_LO);
+    reg = (p2maddr >> 32);
+    writel_relaxed(reg, cb_base + SMMU_CB_TTBR0_HI);
+
+    /*
+     * TCR
+     * We use long descriptor, with inner-shareable WBWA tables in TTBR0.
+     */
+    if ( smmu->version > 1 )
+    {
+        /* 4K Page Table */
+        if ( PAGE_SIZE == PAGE_SIZE_4K )
+            reg = SMMU_TCR_TG0_4K;
+        else
+            reg = SMMU_TCR_TG0_64K;
+
+        switch ( smmu->s2_output_size ) {
+        case 32:
+            reg |= (SMMU_TCR2_ADDR_32 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 36:
+            reg |= (SMMU_TCR2_ADDR_36 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 40:
+            reg |= (SMMU_TCR2_ADDR_40 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 42:
+            reg |= (SMMU_TCR2_ADDR_42 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 44:
+            reg |= (SMMU_TCR2_ADDR_44 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        case 48:
+            reg |= (SMMU_TCR2_ADDR_48 << SMMU_TCR_PASIZE_SHIFT);
+            break;
+        }
+    }
+    else
+        reg = 0;
+
+    /* The attribute to walk the page table should be the same as VTCR_EL2 */
+    reg |= SMMU_TCR_EAE |
+        (SMMU_TCR_SH_IS << SMMU_TCR_SH0_SHIFT) |
+        (SMMU_TCR_RGN_WBWA << SMMU_TCR_ORGN0_SHIFT) |
+        (SMMU_TCR_RGN_WBWA << SMMU_TCR_IRGN0_SHIFT) |
+        (SMMU_TCR_SL0_LVL_1 << SMMU_TCR_SL0_SHIFT) |
+        /* T0SZ=(1)100 = -8 ( 32 -(-8) = 40 bit physical addresses ) */
+        (0x18 << SMMU_TCR_T0SZ_SHIFT);
+    writel_relaxed(reg, cb_base + SMMU_CB_TCR);
+
+    /* SCTLR */
+    reg = SMMU_SCTLR_CFCFG |
+        SMMU_SCTLR_CFIE |
+        SMMU_SCTLR_CFRE |
+        SMMU_SCTLR_M |
+        SMMU_SCTLR_EAE_SBOP;
+
+    writel_relaxed(reg, cb_base + SMMU_CB_SCTLR);
+}
+
+static struct arm_smmu_domain_cfg *
+arm_smmu_alloc_domain_context(struct domain *d,
+                              struct arm_smmu_device *smmu)
+{
+    unsigned int irq;
+    int ret, start;
+    struct arm_smmu_domain_cfg *cfg;
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+
+    ASSERT(spin_is_locked(&smmu_domain->lock));
+
+    cfg = xzalloc(struct arm_smmu_domain_cfg);
+    if ( !cfg )
+        return NULL;
+
+    /* Master already initialized to another domain ... */
+    if ( cfg->domain != NULL )
+        goto out_free_mem;
+
+    cfg->cbar = SMMU_CBAR_TYPE_S2_TRANS;
+    start = 0;
+
+    ret = __arm_smmu_alloc_bitmap(smmu->context_map, start,
+                                  smmu->num_context_banks);
+    if ( ret < 0 )
+        goto out_free_mem;
+
+    cfg->cbndx = ret;
+    if ( smmu->version == 1 )
+    {
+        cfg->irptndx = atomic_inc_return(&smmu->irptndx);
+        cfg->irptndx %= smmu->num_context_irqs;
+    }
+    else
+        cfg->irptndx = cfg->cbndx;
+
+    irq = smmu->irqs[smmu->num_global_irqs + cfg->irptndx];
+    ret = request_irq(irq, IRQF_SHARED, arm_smmu_context_fault,
+                      "arm-smmu-context-fault", cfg);
+    if ( ret )
+    {
+        smmu_err(smmu, "failed to request context IRQ %d (%u)\n",
+                 cfg->irptndx, irq);
+        cfg->irptndx = INVALID_IRPTNDX;
+        goto out_free_context;
+    }
+
+    cfg->domain = d;
+    cfg->smmu = smmu;
+    if ( smmu->features & SMMU_FEAT_COHERENT_WALK )
+        iommu_set_feature(d, IOMMU_FEAT_COHERENT_WALK);
+
+    arm_smmu_init_context_bank(cfg);
+    list_add(&cfg->list, &smmu_domain->contexts);
+    INIT_LIST_HEAD(&cfg->masters);
+
+    return cfg;
+
+out_free_context:
+    __arm_smmu_free_bitmap(smmu->context_map, cfg->cbndx);
+out_free_mem:
+    xfree(cfg);
+
+    return NULL;
+}
+
+static void arm_smmu_destroy_domain_context(struct arm_smmu_domain_cfg *cfg)
+{
+    struct domain *d = cfg->domain;
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_device *smmu = cfg->smmu;
+    void __iomem *cb_base;
+    unsigned int irq;
+
+    ASSERT(spin_is_locked(&smmu_domain->lock));
+    BUG_ON(!list_empty(&cfg->masters));
+
+    /* Disable the context bank and nuke the TLB before freeing it */
+    cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, cfg->cbndx);
+    writel_relaxed(0, cb_base + SMMU_CB_SCTLR);
+    arm_smmu_tlb_inv_context(cfg);
+
+    if ( cfg->irptndx != INVALID_IRPTNDX )
+    {
+        irq = smmu->irqs[smmu->num_global_irqs + cfg->irptndx];
+        release_irq(irq, cfg);
+    }
+
+    __arm_smmu_free_bitmap(smmu->context_map, cfg->cbndx);
+    list_del(&cfg->list);
+    xfree(cfg);
+}
+
+static struct arm_smmu_device *
+arm_smmu_find_smmu_by_dev(const struct dt_device_node *dev)
+{
+    struct arm_smmu_device *smmu;
+    struct arm_smmu_master *master = NULL;
+
+    list_for_each_entry( smmu, &arm_smmu_devices, list )
+    {
+        master = find_smmu_master(smmu, dev);
+        if ( master )
+            break;
+    }
+
+    if ( !master )
+        return NULL;
+
+    return smmu;
+}
+
+static int arm_smmu_attach_dev(struct domain *d,
+                               const struct dt_device_node *dev)
+{
+    struct arm_smmu_device *smmu = arm_smmu_find_smmu_by_dev(dev);
+    struct arm_smmu_master *master;
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_domain_cfg *cfg = NULL;
+    struct arm_smmu_domain_cfg *curr;
+    int ret;
+
+    printk(XENLOG_DEBUG "arm-smmu: attach %s to domain %d\n",
+           dt_node_full_name(dev), d->domain_id);
+
+    if ( !smmu )
+    {
+        printk(XENLOG_ERR "%s: cannot attach to SMMU, is it on the same bus?\n",
+               dt_node_full_name(dev));
+        return -ENODEV;
+    }
+
+    master = find_smmu_master(smmu, dev);
+    BUG_ON(master == NULL);
+
+    /* Check if the device is already assigned to someone */
+    if ( master->cfg )
+        return -EBUSY;
+
+    spin_lock(&smmu_domain->lock);
+    list_for_each_entry( curr, &smmu_domain->contexts, list )
+    {
+        if ( curr->smmu == smmu )
+        {
+            cfg = curr;
+            break;
+        }
+    }
+
+    if ( !cfg )
+    {
+        cfg = arm_smmu_alloc_domain_context(d, smmu);
+        if ( !cfg )
+        {
+            smmu_err(smmu, "unable to allocate context for domain %u\n",
+                     d->domain_id);
+            spin_unlock(&smmu_domain->lock);
+            return -ENOMEM;
+        }
+    }
+    spin_unlock(&smmu_domain->lock);
+
+    ret = arm_smmu_domain_add_master(d, cfg, master);
+    if ( ret )
+    {
+        spin_lock(&smmu_domain->lock);
+        if ( list_empty(&cfg->masters) )
+            arm_smmu_destroy_domain_context(cfg);
+        spin_unlock(&smmu_domain->lock);
+    }
+
+    return ret;
+}
+
+static int arm_smmu_detach_dev(struct domain *d,
+                               const struct dt_device_node *dev)
+{
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+    struct arm_smmu_master *master;
+    struct arm_smmu_device *smmu = arm_smmu_find_smmu_by_dev(dev);
+    struct arm_smmu_domain_cfg *cfg;
+
+    printk(XENLOG_DEBUG "arm-smmu: detach %s to domain %d\n",
+           dt_node_full_name(dev), d->domain_id);
+
+    if ( !smmu )
+    {
+        printk(XENLOG_ERR "%s: cannot find the SMMU, is it on the same bus?\n",
+               dt_node_full_name(dev));
+        return -ENODEV;
+    }
+
+    master = find_smmu_master(smmu, dev);
+    BUG_ON(master == NULL);
+
+    cfg = master->cfg;
+
+    /* Sanity check to avoid removing a device that doesn't belong to
+     * the domain
+     */
+    if ( !cfg || cfg->domain != d )
+    {
+        printk(XENLOG_ERR "%s: was not attach to domain %d\n",
+               dt_node_full_name(dev), d->domain_id);
+        return -ESRCH;
+    }
+
+    arm_smmu_domain_remove_master(master);
+
+    spin_lock(&smmu_domain->lock);
+    if ( list_empty(&cfg->masters) )
+        arm_smmu_destroy_domain_context(cfg);
+    spin_unlock(&smmu_domain->lock);
+
+    return 0;
+}
+
+static int arm_smmu_reassign_dt_dev(struct domain *s, struct domain *t,
+                                    const struct dt_device_node *dev)
+{
+    int ret = 0;
+
+    /* Don't allow remapping on other domain than hwdom */
+    if ( t != hardware_domain )
+        return -EPERM;
+
+    if ( t == s )
+        return 0;
+
+    ret = arm_smmu_detach_dev(s, dev);
+    if ( ret )
+        return ret;
+
+    ret = arm_smmu_attach_dev(t, dev);
+
+    return ret;
+}
+
+static __init int arm_smmu_id_size_to_bits(int size)
+{
+    switch ( size )
+    {
+    case 0:
+        return 32;
+    case 1:
+        return 36;
+    case 2:
+        return 40;
+    case 3:
+        return 42;
+    case 4:
+        return 44;
+    case 5:
+    default:
+        return 48;
+    }
+}
+
+static __init int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu)
+{
+    unsigned long size;
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    u32 id;
+
+    smmu_info(smmu, "probing hardware configuration...\n");
+
+    /*
+     * Primecell ID
+     */
+    id = readl_relaxed(gr0_base + SMMU_GR0_PIDR2);
+    smmu->version = ((id >> SMMU_PIDR2_ARCH_SHIFT) & SMMU_PIDR2_ARCH_MASK) + 1;
+    smmu_info(smmu, "SMMUv%d with:\n", smmu->version);
+
+    /* ID0 */
+    id = readl_relaxed(gr0_base + SMMU_GR0_ID0);
+#ifndef CONFIG_ARM_64
+    if ( ((id >> SMMU_ID0_PTFS_SHIFT) & SMMU_ID0_PTFS_MASK) ==
+            SMMU_ID0_PTFS_V8_ONLY )
+    {
+        smmu_err(smmu, "\tno v7 descriptor support!\n");
+        return -ENODEV;
+    }
+#endif
+    if ( id & SMMU_ID0_S1TS )
+    {
+        smmu->features |= SMMU_FEAT_TRANS_S1;
+        smmu_info(smmu, "\tstage 1 translation\n");
+    }
+
+    if ( id & SMMU_ID0_S2TS )
+    {
+        smmu->features |= SMMU_FEAT_TRANS_S2;
+        smmu_info(smmu, "\tstage 2 translation\n");
+    }
+
+    if ( id & SMMU_ID0_NTS )
+    {
+        smmu->features |= SMMU_FEAT_TRANS_NESTED;
+        smmu_info(smmu, "\tnested translation\n");
+    }
+
+    if ( !(smmu->features &
+           (SMMU_FEAT_TRANS_S1 | SMMU_FEAT_TRANS_S2 |
+            SMMU_FEAT_TRANS_NESTED)) )
+    {
+        smmu_err(smmu, "\tno translation support!\n");
+        return -ENODEV;
+    }
+
+    /* We need at least support for Stage 2 */
+    if ( !(smmu->features & SMMU_FEAT_TRANS_S2) )
+    {
+        smmu_err(smmu, "\tno stage 2 translation!\n");
+        return -ENODEV;
+    }
+
+    if ( id & SMMU_ID0_CTTW )
+    {
+        smmu->features |= SMMU_FEAT_COHERENT_WALK;
+        smmu_info(smmu, "\tcoherent table walk\n");
+    }
+
+    if ( id & SMMU_ID0_SMS )
+    {
+        u32 smr, sid, mask;
+
+        smmu->features |= SMMU_FEAT_STREAM_MATCH;
+        smmu->num_mapping_groups = (id >> SMMU_ID0_NUMSMRG_SHIFT) &
+            SMMU_ID0_NUMSMRG_MASK;
+        if ( smmu->num_mapping_groups == 0 )
+        {
+            smmu_err(smmu,
+                     "stream-matching supported, but no SMRs present!\n");
+            return -ENODEV;
+        }
+
+        smr = SMMU_SMR_MASK_MASK << SMMU_SMR_MASK_SHIFT;
+        smr |= (SMMU_SMR_ID_MASK << SMMU_SMR_ID_SHIFT);
+        writel_relaxed(smr, gr0_base + SMMU_GR0_SMR(0));
+        smr = readl_relaxed(gr0_base + SMMU_GR0_SMR(0));
+
+        mask = (smr >> SMMU_SMR_MASK_SHIFT) & SMMU_SMR_MASK_MASK;
+        sid = (smr >> SMMU_SMR_ID_SHIFT) & SMMU_SMR_ID_MASK;
+        if ( (mask & sid) != sid )
+        {
+            smmu_err(smmu,
+                     "SMR mask bits (0x%x) insufficient for ID field (0x%x)\n",
+                     mask, sid);
+            return -ENODEV;
+        }
+        smmu->smr_mask_mask = mask;
+        smmu->smr_id_mask = sid;
+
+        smmu_info(smmu,
+                  "\tstream matching with %u register groups, mask 0x%x\n",
+                  smmu->num_mapping_groups, mask);
+    }
+
+    /* ID1 */
+    id = readl_relaxed(gr0_base + SMMU_GR0_ID1);
+    smmu->pagesize = (id & SMMU_ID1_PAGESIZE) ? PAGE_SIZE_64K : PAGE_SIZE_4K;
+
+    /* Check for size mismatch of SMMU address space from mapped region */
+    size = 1 << (((id >> SMMU_ID1_NUMPAGENDXB_SHIFT) &
+                  SMMU_ID1_NUMPAGENDXB_MASK) + 1);
+    size *= (smmu->pagesize << 1);
+    if ( smmu->size != size )
+        smmu_warn(smmu, "SMMU address space size (0x%lx) differs "
+                  "from mapped region size (0x%lx)!\n", size, smmu->size);
+
+    smmu->num_s2_context_banks = (id >> SMMU_ID1_NUMS2CB_SHIFT) &
+        SMMU_ID1_NUMS2CB_MASK;
+    smmu->num_context_banks = (id >> SMMU_ID1_NUMCB_SHIFT) &
+        SMMU_ID1_NUMCB_MASK;
+    if ( smmu->num_s2_context_banks > smmu->num_context_banks )
+    {
+        smmu_err(smmu, "impossible number of S2 context banks!\n");
+        return -ENODEV;
+    }
+    smmu_info(smmu, "\t%u context banks (%u stage-2 only)\n",
+              smmu->num_context_banks, smmu->num_s2_context_banks);
+
+    /* ID2 */
+    id = readl_relaxed(gr0_base + SMMU_GR0_ID2);
+    size = arm_smmu_id_size_to_bits((id >> SMMU_ID2_IAS_SHIFT) &
+                                    SMMU_ID2_IAS_MASK);
+
+    /*
+     * Stage-1 output limited by stage-2 input size due to VTCR_EL2
+     * setup (see setup_virt_paging)
+     */
+    /* Current maximum output size of 40 bits */
+    smmu->s1_output_size = min(40UL, size);
+
+    /* The stage-2 output mask is also applied for bypass */
+    size = arm_smmu_id_size_to_bits((id >> SMMU_ID2_OAS_SHIFT) &
+                                    SMMU_ID2_OAS_MASK);
+    smmu->s2_output_size = min((unsigned long)PADDR_BITS, size);
+
+    if ( smmu->version == 1 )
+        smmu->input_size = 32;
+    else
+    {
+#ifdef CONFIG_ARM_64
+        size = (id >> SMMU_ID2_UBS_SHIFT) & SMMU_ID2_UBS_MASK;
+        size = min(39, arm_smmu_id_size_to_bits(size));
+#else
+        size = 32;
+#endif
+        smmu->input_size = size;
+
+        if ( (PAGE_SIZE == PAGE_SIZE_4K && !(id & SMMU_ID2_PTFS_4K) ) ||
+             (PAGE_SIZE == PAGE_SIZE_64K && !(id & SMMU_ID2_PTFS_64K)) ||
+             (PAGE_SIZE != PAGE_SIZE_4K && PAGE_SIZE != PAGE_SIZE_64K) )
+        {
+            smmu_err(smmu, "CPU page size 0x%lx unsupported\n",
+                     PAGE_SIZE);
+            return -ENODEV;
+        }
+    }
+
+    smmu_info(smmu, "\t%lu-bit VA, %lu-bit IPA, %lu-bit PA\n",
+              smmu->input_size, smmu->s1_output_size, smmu->s2_output_size);
+    return 0;
+}
+
+static __init void arm_smmu_device_reset(struct arm_smmu_device *smmu)
+{
+    void __iomem *gr0_base = SMMU_GR0(smmu);
+    void __iomem *cb_base;
+    int i = 0;
+    u32 reg;
+
+    smmu_dbg(smmu, "device reset\n");
+
+    /* Clear Global FSR */
+    reg = readl_relaxed(SMMU_GR0_NS(smmu) + SMMU_GR0_sGFSR);
+    writel(reg, SMMU_GR0_NS(smmu) + SMMU_GR0_sGFSR);
+
+    /* Mark all SMRn as invalid and all S2CRn as fault */
+    for ( i = 0; i < smmu->num_mapping_groups; ++i )
+    {
+        writel_relaxed(~SMMU_SMR_VALID, gr0_base + SMMU_GR0_SMR(i));
+        writel_relaxed(SMMU_S2CR_TYPE_FAULT, gr0_base + SMMU_GR0_S2CR(i));
+    }
+
+    /* Make sure all context banks are disabled and clear CB_FSR  */
+    for ( i = 0; i < smmu->num_context_banks; ++i )
+    {
+        cb_base = SMMU_CB_BASE(smmu) + SMMU_CB(smmu, i);
+        writel_relaxed(0, cb_base + SMMU_CB_SCTLR);
+        writel_relaxed(SMMU_FSR_FAULT, cb_base + SMMU_CB_FSR);
+    }
+
+    /* Invalidate the TLB, just in case */
+    writel_relaxed(0, gr0_base + SMMU_GR0_STLBIALL);
+    writel_relaxed(0, gr0_base + SMMU_GR0_TLBIALLH);
+    writel_relaxed(0, gr0_base + SMMU_GR0_TLBIALLNSNH);
+
+    reg = readl_relaxed(SMMU_GR0_NS(smmu) + SMMU_GR0_sCR0);
+
+    /* Enable fault reporting */
+    reg |= (SMMU_sCR0_GFRE | SMMU_sCR0_GFIE |
+            SMMU_sCR0_GCFGFRE | SMMU_sCR0_GCFGFIE);
+
+    /* Disable TLB broadcasting. */
+    reg |= (SMMU_sCR0_VMIDPNE | SMMU_sCR0_PTM);
+
+    /* Enable client access, generate a fault if no mapping is found */
+    reg &= ~(SMMU_sCR0_CLIENTPD);
+    reg |= SMMU_sCR0_USFCFG;
+
+    /* Disable forced broadcasting */
+    reg &= ~SMMU_sCR0_FB;
+
+    /* Don't upgrade barriers when client devices are not mapped to
+     * a translation context banks (just here for clarity as Xen policy
+     * is to deny invalid transaction). */
+    reg &= ~(SMMU_sCR0_BSU_MASK << SMMU_sCR0_BSU_SHIFT);
+
+    /* Push the button */
+    arm_smmu_tlb_sync(smmu);
+    writel_relaxed(reg, SMMU_GR0_NS(smmu) + SMMU_GR0_sCR0);
+}
+
+static int arm_smmu_iommu_domain_init(struct domain *d)
+{
+    struct arm_smmu_domain *smmu_domain;
+
+    smmu_domain = xzalloc(struct arm_smmu_domain);
+    if ( !smmu_domain )
+        return -ENOMEM;
+
+    spin_lock_init(&smmu_domain->lock);
+    INIT_LIST_HEAD(&smmu_domain->contexts);
+
+    domain_hvm_iommu(d)->arch.priv = smmu_domain;
+
+    return 0;
+}
+
+static void __hwdom_init arm_smmu_iommu_hwdom_init(struct domain *d)
+{
+}
+
+static void arm_smmu_iommu_domain_teardown(struct domain *d)
+{
+    struct arm_smmu_domain *smmu_domain = domain_hvm_iommu(d)->arch.priv;
+
+    ASSERT(list_empty(&smmu_domain->contexts));
+    xfree(smmu_domain);
+}
+
+static const struct iommu_ops arm_smmu_iommu_ops = {
+    .init = arm_smmu_iommu_domain_init,
+    .hwdom_init = arm_smmu_iommu_hwdom_init,
+    .teardown = arm_smmu_iommu_domain_teardown,
+    .iotlb_flush = arm_smmu_iotlb_flush,
+    .iotlb_flush_all = arm_smmu_iotlb_flush_all,
+    .assign_dt_device = arm_smmu_attach_dev,
+    .reassign_dt_device = arm_smmu_reassign_dt_dev,
+};
+
+static int __init smmu_init(struct dt_device_node *dev,
+                            const void *data)
+{
+    struct arm_smmu_device *smmu;
+    int res;
+    u64 addr, size;
+    unsigned int num_irqs, i;
+    struct dt_phandle_args masterspec;
+    struct rb_node *node;
+
+    /* Even if the device can't be initialized, we don't want to give
+     * the smmu device to dom0.
+     */
+    dt_device_set_used_by(dev, DOMID_XEN);
+
+    smmu = xzalloc(struct arm_smmu_device);
+    if ( !smmu )
+    {
+        printk(XENLOG_ERR "%s: failed to allocate arm_smmu_device\n",
+               dt_node_full_name(dev));
+        return -ENOMEM;
+    }
+
+    smmu->node = dev;
+    check_driver_options(smmu);
+
+    res = dt_device_get_address(smmu->node, 0, &addr, &size);
+    if ( res )
+    {
+        smmu_err(smmu, "unable to retrieve the base address of the SMMU\n");
+        goto out_err;
+    }
+
+    smmu->base = ioremap_nocache(addr, size);
+    if ( !smmu->base )
+    {
+        smmu_err(smmu, "unable to map the SMMU memory\n");
+        goto out_err;
+    }
+
+    smmu->size = size;
+
+    if ( !dt_property_read_u32(smmu->node, "#global-interrupts",
+                               &smmu->num_global_irqs) )
+    {
+        smmu_err(smmu, "missing #global-interrupts\n");
+        goto out_unmap;
+    }
+
+    num_irqs = dt_number_of_irq(smmu->node);
+    if ( num_irqs > smmu->num_global_irqs )
+        smmu->num_context_irqs = num_irqs - smmu->num_global_irqs;
+
+    if ( !smmu->num_context_irqs )
+    {
+        smmu_err(smmu, "found %d interrupts but expected at least %d\n",
+                 num_irqs, smmu->num_global_irqs + 1);
+        goto out_unmap;
+    }
+
+    smmu->irqs = xzalloc_array(unsigned int, num_irqs);
+    if ( !smmu->irqs )
+    {
+        smmu_err(smmu, "failed to allocated %d irqs\n", num_irqs);
+        goto out_unmap;
+    }
+
+    for ( i = 0; i < num_irqs; i++ )
+    {
+        res = platform_get_irq(smmu->node, i);
+        if ( res < 0 )
+        {
+            smmu_err(smmu, "failed to get irq index %d\n", i);
+            goto out_free_irqs;
+        }
+        smmu->irqs[i] = res;
+    }
+
+    smmu->sids = xzalloc_array(unsigned long,
+                               BITS_TO_LONGS(SMMU_MAX_STREAMIDS));
+    if ( !smmu->sids )
+    {
+        smmu_err(smmu, "failed to allocated bitmap for stream ID tracking\n");
+        goto out_free_masters;
+    }
+
+
+    i = 0;
+    smmu->masters = RB_ROOT;
+    while ( !dt_parse_phandle_with_args(smmu->node, "mmu-masters",
+                                        "#stream-id-cells", i, &masterspec) )
+    {
+        res = register_smmu_master(smmu, &masterspec);
+        if ( res )
+        {
+            smmu_err(smmu, "failed to add master %s\n",
+                     masterspec.np->name);
+            goto out_free_masters;
+        }
+        i++;
+    }
+
+    smmu_info(smmu, "registered %d master devices\n", i);
+
+    res = arm_smmu_device_cfg_probe(smmu);
+    if ( res )
+    {
+        smmu_err(smmu, "failed to probe the SMMU\n");
+        goto out_free_masters;
+    }
+
+    if ( smmu->version > 1 &&
+         smmu->num_context_banks != smmu->num_context_irqs )
+    {
+        smmu_err(smmu,
+                 "found only %d context interrupt(s) but %d required\n",
+                 smmu->num_context_irqs, smmu->num_context_banks);
+        goto out_free_masters;
+    }
+
+    smmu_dbg(smmu, "register global IRQs handler\n");
+
+    for ( i = 0; i < smmu->num_global_irqs; ++i )
+    {
+        smmu_dbg(smmu, "\t- global IRQ %u\n", smmu->irqs[i]);
+        res = request_irq(smmu->irqs[i], IRQF_SHARED, arm_smmu_global_fault,
+                          "arm-smmu global fault", smmu);
+        if ( res )
+        {
+            smmu_err(smmu, "failed to request global IRQ %d (%u)\n",
+                     i, smmu->irqs[i]);
+            goto out_release_irqs;
+        }
+    }
+
+    INIT_LIST_HEAD(&smmu->list);
+    list_add(&smmu->list, &arm_smmu_devices);
+
+    arm_smmu_device_reset(smmu);
+
+    iommu_set_ops(&arm_smmu_iommu_ops);
+
+    /* sids field can be freed... */
+    xfree(smmu->sids);
+    smmu->sids = NULL;
+
+    return 0;
+
+out_release_irqs:
+    while (i--)
+        release_irq(smmu->irqs[i], smmu);
+
+out_free_masters:
+    for ( node = rb_first(&smmu->masters); node; node = rb_next(node) )
+    {
+        struct arm_smmu_master *master;
+
+        master = container_of(node, struct arm_smmu_master, node);
+        xfree(master);
+    }
+
+    xfree(smmu->sids);
+
+out_free_irqs:
+    xfree(smmu->irqs);
+
+out_unmap:
+    iounmap(smmu->base);
+
+out_err:
+    xfree(smmu);
+
+    return -ENODEV;
+}
+
+static const char * const smmu_dt_compat[] __initconst =
+{
+    "arm,mmu-400",
+    NULL
+};
+
+DT_DEVICE_START(smmu, "ARM SMMU", DEVICE_IOMMU)
+    .compatible = smmu_dt_compat,
+    .init = smmu_init,
+DT_DEVICE_END
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:07 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFf-0002Ut-Hq; Thu, 19 Jun 2014 04:47:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFe-0002US-3l
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:06 +0000
Received: from [85.158.137.68:25981] by server-6.bemta-3.messagelabs.com id
	10/4C-00470-94B62A35; Thu, 19 Jun 2014 04:47:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1403153223!11044068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21532 invoked from network); 19 Jun 2014 04:47:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFa-0002eO-UN
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFa-00083e-So
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:02 +0000
Date: Thu, 19 Jun 2014 04:47:02 +0000
Message-Id: <E1WxUFa-00083e-So@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: implement XEN_DOMCTL_{get,
	set}_vcpu_msrs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c3c9eee0c1129b0c5789ded48ee85007fa74b02
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 16:57:16 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 16:57:16 2014 +0200

    x86/domctl: implement XEN_DOMCTL_{get,set}_vcpu_msrs
    
    Despite my 'Reviewed-by' tag on c/s 65e3554908 "x86/PV: support data
    breakpoint extension registers", I have re-evaluated my position as far as the
    hypercall interface is concerned.
    
    Previously, for the sake of not modifying the migration code in libxc,
    XEN_DOMCTL_get_ext_vcpucontext would jump though hoops to return -ENOBUFS if
    and only if MSRs were in use and no buffer was present.
    
    This is fragile, and awkward from a toolstack point-of-view when actually
    sending MSR content in the migration stream.  It also complicates fixing a
    further race condition, between querying the number of MSRs for a vcpu, and
    the vcpu touching a new one.
    
    As this code is still only in unstable, take this opportunity to redesign the
    interface.  This patch introduces the brand new XEN_DOMCTL_{get,set}_vcpu_msrs
    subops.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c       |  127 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/public/domctl.h |   38 +++++++++++++
 2 files changed, 165 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index d927b59..78be83c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1344,6 +1344,133 @@ long arch_do_domctl(
     }
     break;
 
+    case XEN_DOMCTL_get_vcpu_msrs:
+    case XEN_DOMCTL_set_vcpu_msrs:
+    {
+        struct xen_domctl_vcpu_msrs *vmsrs = &domctl->u.vcpu_msrs;
+        struct xen_domctl_vcpu_msr msr;
+        struct vcpu *v;
+        uint32_t nr_msrs = 0;
+
+        ret = -ESRCH;
+        if ( (vmsrs->vcpu >= d->max_vcpus) ||
+             ((v = d->vcpu[vmsrs->vcpu]) == NULL) )
+            break;
+
+        ret = -EINVAL;
+        if ( (v == current) || /* no vcpu_pause() */
+             !is_pv_domain(d) )
+            break;
+
+        /* Count maximum number of optional msrs. */
+        if ( boot_cpu_has(X86_FEATURE_DBEXT) )
+            nr_msrs += 4;
+
+        if ( domctl->cmd == XEN_DOMCTL_get_vcpu_msrs )
+        {
+            ret = 0; copyback = 1;
+
+            /* NULL guest handle is a request for max size. */
+            if ( guest_handle_is_null(vmsrs->msrs) )
+                vmsrs->msr_count = nr_msrs;
+            else
+            {
+                i = 0;
+
+                vcpu_pause(v);
+
+                if ( boot_cpu_has(X86_FEATURE_DBEXT) )
+                {
+                    unsigned int j;
+
+                    if ( v->arch.pv_vcpu.dr_mask[0] )
+                    {
+                        if ( i < vmsrs->msr_count && !ret )
+                        {
+                            msr.index = MSR_AMD64_DR0_ADDRESS_MASK;
+                            msr.reserved = 0;
+                            msr.value = v->arch.pv_vcpu.dr_mask[0];
+                            if ( copy_to_guest_offset(vmsrs->msrs, i, &msr, 1) )
+                                ret = -EFAULT;
+                        }
+                        ++i;
+                    }
+
+                    for ( j = 0; j < 3; ++j )
+                    {
+                        if ( !v->arch.pv_vcpu.dr_mask[1 + j] )
+                            continue;
+                        if ( i < vmsrs->msr_count && !ret )
+                        {
+                            msr.index = MSR_AMD64_DR1_ADDRESS_MASK + j;
+                            msr.reserved = 0;
+                            msr.value = v->arch.pv_vcpu.dr_mask[1 + j];
+                            if ( copy_to_guest_offset(vmsrs->msrs, i, &msr, 1) )
+                                ret = -EFAULT;
+                        }
+                        ++i;
+                    }
+                }
+
+                vcpu_unpause(v);
+
+                if ( i > vmsrs->msr_count && !ret )
+                    ret = -ENOBUFS;
+                vmsrs->msr_count = i;
+            }
+        }
+        else
+        {
+            ret = -EINVAL;
+            if ( vmsrs->msr_count > nr_msrs )
+                break;
+
+            vcpu_pause(v);
+
+            for ( i = 0; i < vmsrs->msr_count; ++i )
+            {
+                ret = -EFAULT;
+                if ( copy_from_guest_offset(&msr, vmsrs->msrs, i, 1) )
+                    break;
+
+                ret = -EINVAL;
+                if ( msr.reserved )
+                    break;
+
+                switch ( msr.index )
+                {
+                case MSR_AMD64_DR0_ADDRESS_MASK:
+                    if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
+                         (msr.value >> 32) )
+                        break;
+                    v->arch.pv_vcpu.dr_mask[0] = msr.value;
+                    continue;
+
+                case MSR_AMD64_DR1_ADDRESS_MASK ...
+                    MSR_AMD64_DR3_ADDRESS_MASK:
+                    if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
+                         (msr.value >> 32) )
+                        break;
+                    msr.index -= MSR_AMD64_DR1_ADDRESS_MASK - 1;
+                    v->arch.pv_vcpu.dr_mask[msr.index] = msr.value;
+                    continue;
+                }
+                break;
+            }
+
+            vcpu_unpause(v);
+
+            if ( i == vmsrs->msr_count )
+                ret = 0;
+            else
+            {
+                vmsrs->msr_count = i;
+                copyback = 1;
+            }
+        }
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 385b053..0ddffaa 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -895,6 +895,41 @@ struct xen_domctl_cacheflush {
 typedef struct xen_domctl_cacheflush xen_domctl_cacheflush_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_cacheflush_t);
 
+#if defined(__i386__) || defined(__x86_64__)
+struct xen_domctl_vcpu_msr {
+    uint32_t         index;
+    uint32_t         reserved;
+    uint64_aligned_t value;
+};
+typedef struct xen_domctl_vcpu_msr xen_domctl_vcpu_msr_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msr_t);
+
+/*
+ * XEN_DOMCTL_set_vcpu_msrs / XEN_DOMCTL_get_vcpu_msrs.
+ *
+ * Input:
+ * - A NULL 'msrs' guest handle is a request for the maximum 'msr_count'.
+ * - Otherwise, 'msr_count' is the number of entries in 'msrs'.
+ *
+ * Output for get:
+ * - If 'msr_count' is less than the number Xen needs to write, -ENOBUFS shall
+ *   be returned and 'msr_count' updated to reflect the intended number.
+ * - On success, 'msr_count' shall indicate the number of MSRs written, which
+ *   may be less than the maximum if some are not currently used by the vcpu.
+ *
+ * Output for set:
+ * - If Xen encounters an error with a specific MSR, -EINVAL shall be returned
+ *   and 'msr_count' shall be set to the offending index, to aid debugging.
+ */
+struct xen_domctl_vcpu_msrs {
+    uint32_t vcpu;                                   /* IN     */
+    uint32_t msr_count;                              /* IN/OUT */
+    XEN_GUEST_HANDLE_64(xen_domctl_vcpu_msr_t) msrs; /* IN/OUT */
+};
+typedef struct xen_domctl_vcpu_msrs xen_domctl_vcpu_msrs_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msrs_t);
+#endif
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -965,6 +1000,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_getnodeaffinity               69
 #define XEN_DOMCTL_set_max_evtchn                70
 #define XEN_DOMCTL_cacheflush                    71
+#define XEN_DOMCTL_get_vcpu_msrs                 72
+#define XEN_DOMCTL_set_vcpu_msrs                 73
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -1014,6 +1051,7 @@ struct xen_domctl {
 #if defined(__i386__) || defined(__x86_64__)
         struct xen_domctl_cpuid             cpuid;
         struct xen_domctl_vcpuextstate      vcpuextstate;
+        struct xen_domctl_vcpu_msrs         vcpu_msrs;
 #endif
         struct xen_domctl_set_access_required access_required;
         struct xen_domctl_audit_p2m         audit_p2m;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:07 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:07 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFf-0002Ut-Hq; Thu, 19 Jun 2014 04:47:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFe-0002US-3l
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:06 +0000
Received: from [85.158.137.68:25981] by server-6.bemta-3.messagelabs.com id
	10/4C-00470-94B62A35; Thu, 19 Jun 2014 04:47:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-31.messagelabs.com!1403153223!11044068!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21532 invoked from network); 19 Jun 2014 04:47:04 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFa-0002eO-UN
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFa-00083e-So
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:02 +0000
Date: Thu, 19 Jun 2014 04:47:02 +0000
Message-Id: <E1WxUFa-00083e-So@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: implement XEN_DOMCTL_{get,
	set}_vcpu_msrs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8c3c9eee0c1129b0c5789ded48ee85007fa74b02
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 16:57:16 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 16:57:16 2014 +0200

    x86/domctl: implement XEN_DOMCTL_{get,set}_vcpu_msrs
    
    Despite my 'Reviewed-by' tag on c/s 65e3554908 "x86/PV: support data
    breakpoint extension registers", I have re-evaluated my position as far as the
    hypercall interface is concerned.
    
    Previously, for the sake of not modifying the migration code in libxc,
    XEN_DOMCTL_get_ext_vcpucontext would jump though hoops to return -ENOBUFS if
    and only if MSRs were in use and no buffer was present.
    
    This is fragile, and awkward from a toolstack point-of-view when actually
    sending MSR content in the migration stream.  It also complicates fixing a
    further race condition, between querying the number of MSRs for a vcpu, and
    the vcpu touching a new one.
    
    As this code is still only in unstable, take this opportunity to redesign the
    interface.  This patch introduces the brand new XEN_DOMCTL_{get,set}_vcpu_msrs
    subops.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c       |  127 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/public/domctl.h |   38 +++++++++++++
 2 files changed, 165 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index d927b59..78be83c 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1344,6 +1344,133 @@ long arch_do_domctl(
     }
     break;
 
+    case XEN_DOMCTL_get_vcpu_msrs:
+    case XEN_DOMCTL_set_vcpu_msrs:
+    {
+        struct xen_domctl_vcpu_msrs *vmsrs = &domctl->u.vcpu_msrs;
+        struct xen_domctl_vcpu_msr msr;
+        struct vcpu *v;
+        uint32_t nr_msrs = 0;
+
+        ret = -ESRCH;
+        if ( (vmsrs->vcpu >= d->max_vcpus) ||
+             ((v = d->vcpu[vmsrs->vcpu]) == NULL) )
+            break;
+
+        ret = -EINVAL;
+        if ( (v == current) || /* no vcpu_pause() */
+             !is_pv_domain(d) )
+            break;
+
+        /* Count maximum number of optional msrs. */
+        if ( boot_cpu_has(X86_FEATURE_DBEXT) )
+            nr_msrs += 4;
+
+        if ( domctl->cmd == XEN_DOMCTL_get_vcpu_msrs )
+        {
+            ret = 0; copyback = 1;
+
+            /* NULL guest handle is a request for max size. */
+            if ( guest_handle_is_null(vmsrs->msrs) )
+                vmsrs->msr_count = nr_msrs;
+            else
+            {
+                i = 0;
+
+                vcpu_pause(v);
+
+                if ( boot_cpu_has(X86_FEATURE_DBEXT) )
+                {
+                    unsigned int j;
+
+                    if ( v->arch.pv_vcpu.dr_mask[0] )
+                    {
+                        if ( i < vmsrs->msr_count && !ret )
+                        {
+                            msr.index = MSR_AMD64_DR0_ADDRESS_MASK;
+                            msr.reserved = 0;
+                            msr.value = v->arch.pv_vcpu.dr_mask[0];
+                            if ( copy_to_guest_offset(vmsrs->msrs, i, &msr, 1) )
+                                ret = -EFAULT;
+                        }
+                        ++i;
+                    }
+
+                    for ( j = 0; j < 3; ++j )
+                    {
+                        if ( !v->arch.pv_vcpu.dr_mask[1 + j] )
+                            continue;
+                        if ( i < vmsrs->msr_count && !ret )
+                        {
+                            msr.index = MSR_AMD64_DR1_ADDRESS_MASK + j;
+                            msr.reserved = 0;
+                            msr.value = v->arch.pv_vcpu.dr_mask[1 + j];
+                            if ( copy_to_guest_offset(vmsrs->msrs, i, &msr, 1) )
+                                ret = -EFAULT;
+                        }
+                        ++i;
+                    }
+                }
+
+                vcpu_unpause(v);
+
+                if ( i > vmsrs->msr_count && !ret )
+                    ret = -ENOBUFS;
+                vmsrs->msr_count = i;
+            }
+        }
+        else
+        {
+            ret = -EINVAL;
+            if ( vmsrs->msr_count > nr_msrs )
+                break;
+
+            vcpu_pause(v);
+
+            for ( i = 0; i < vmsrs->msr_count; ++i )
+            {
+                ret = -EFAULT;
+                if ( copy_from_guest_offset(&msr, vmsrs->msrs, i, 1) )
+                    break;
+
+                ret = -EINVAL;
+                if ( msr.reserved )
+                    break;
+
+                switch ( msr.index )
+                {
+                case MSR_AMD64_DR0_ADDRESS_MASK:
+                    if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
+                         (msr.value >> 32) )
+                        break;
+                    v->arch.pv_vcpu.dr_mask[0] = msr.value;
+                    continue;
+
+                case MSR_AMD64_DR1_ADDRESS_MASK ...
+                    MSR_AMD64_DR3_ADDRESS_MASK:
+                    if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
+                         (msr.value >> 32) )
+                        break;
+                    msr.index -= MSR_AMD64_DR1_ADDRESS_MASK - 1;
+                    v->arch.pv_vcpu.dr_mask[msr.index] = msr.value;
+                    continue;
+                }
+                break;
+            }
+
+            vcpu_unpause(v);
+
+            if ( i == vmsrs->msr_count )
+                ret = 0;
+            else
+            {
+                vmsrs->msr_count = i;
+                copyback = 1;
+            }
+        }
+    }
+    break;
+
     default:
         ret = iommu_do_domctl(domctl, d, u_domctl);
         break;
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 385b053..0ddffaa 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -895,6 +895,41 @@ struct xen_domctl_cacheflush {
 typedef struct xen_domctl_cacheflush xen_domctl_cacheflush_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_cacheflush_t);
 
+#if defined(__i386__) || defined(__x86_64__)
+struct xen_domctl_vcpu_msr {
+    uint32_t         index;
+    uint32_t         reserved;
+    uint64_aligned_t value;
+};
+typedef struct xen_domctl_vcpu_msr xen_domctl_vcpu_msr_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msr_t);
+
+/*
+ * XEN_DOMCTL_set_vcpu_msrs / XEN_DOMCTL_get_vcpu_msrs.
+ *
+ * Input:
+ * - A NULL 'msrs' guest handle is a request for the maximum 'msr_count'.
+ * - Otherwise, 'msr_count' is the number of entries in 'msrs'.
+ *
+ * Output for get:
+ * - If 'msr_count' is less than the number Xen needs to write, -ENOBUFS shall
+ *   be returned and 'msr_count' updated to reflect the intended number.
+ * - On success, 'msr_count' shall indicate the number of MSRs written, which
+ *   may be less than the maximum if some are not currently used by the vcpu.
+ *
+ * Output for set:
+ * - If Xen encounters an error with a specific MSR, -EINVAL shall be returned
+ *   and 'msr_count' shall be set to the offending index, to aid debugging.
+ */
+struct xen_domctl_vcpu_msrs {
+    uint32_t vcpu;                                   /* IN     */
+    uint32_t msr_count;                              /* IN/OUT */
+    XEN_GUEST_HANDLE_64(xen_domctl_vcpu_msr_t) msrs; /* IN/OUT */
+};
+typedef struct xen_domctl_vcpu_msrs xen_domctl_vcpu_msrs_t;
+DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpu_msrs_t);
+#endif
+
 struct xen_domctl {
     uint32_t cmd;
 #define XEN_DOMCTL_createdomain                   1
@@ -965,6 +1000,8 @@ struct xen_domctl {
 #define XEN_DOMCTL_getnodeaffinity               69
 #define XEN_DOMCTL_set_max_evtchn                70
 #define XEN_DOMCTL_cacheflush                    71
+#define XEN_DOMCTL_get_vcpu_msrs                 72
+#define XEN_DOMCTL_set_vcpu_msrs                 73
 #define XEN_DOMCTL_gdbsx_guestmemio            1000
 #define XEN_DOMCTL_gdbsx_pausevcpu             1001
 #define XEN_DOMCTL_gdbsx_unpausevcpu           1002
@@ -1014,6 +1051,7 @@ struct xen_domctl {
 #if defined(__i386__) || defined(__x86_64__)
         struct xen_domctl_cpuid             cpuid;
         struct xen_domctl_vcpuextstate      vcpuextstate;
+        struct xen_domctl_vcpu_msrs         vcpu_msrs;
 #endif
         struct xen_domctl_set_access_required access_required;
         struct xen_domctl_audit_p2m         audit_p2m;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFp-0002Wg-Kj; Thu, 19 Jun 2014 04:47:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFn-0002WG-I8
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:15 +0000
Received: from [85.158.143.35:26796] by server-3.bemta-4.messagelabs.com id
	70/D0-16194-25B62A35; Thu, 19 Jun 2014 04:47:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1403153233!8913412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28976 invoked from network); 19 Jun 2014 04:47:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFl-0002eW-3v
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFl-000840-2b
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:13 +0000
Date: Thu, 19 Jun 2014 04:47:13 +0000
Message-Id: <E1WxUFl-000840-2b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: use an explicit check for PV
	MSRs in xc_domain_save()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db24f7f0123c3103e0d7860a7dc3be84463d1814
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 16:58:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 16:58:47 2014 +0200

    libxc: use an explicit check for PV MSRs in xc_domain_save()
    
    Migrating PV domains using MSRs is not supported.  This uses the new
    XEN_DOMCTL_get_vcpu_msrs and will fail the migration with an explicit error.
    
    This is an improvement upon the current failure of
      "No extended context for VCPUxx (ENOBUFS)"
    
    Support for migrating PV domains which are using MSRs will be included in the
    migration v2 work.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxc/xc_domain_save.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index acf3685..778cbde 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1995,6 +1995,26 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             goto out;
         }
 
+        /* Check there are no PV MSRs in use. */
+        domctl.cmd = XEN_DOMCTL_get_vcpu_msrs;
+        domctl.domain = dom;
+        memset(&domctl.u, 0, sizeof(domctl.u));
+        domctl.u.vcpu_msrs.vcpu = i;
+        domctl.u.vcpu_msrs.msr_count = 0;
+        set_xen_guest_handle_raw(domctl.u.vcpu_msrs.msrs, (void*)1);
+
+        if ( xc_domctl(xch, &domctl) < 0 )
+        {
+            if ( errno == ENOBUFS )
+            {
+                errno = EOPNOTSUPP;
+                PERROR("Unable to migrate PV guest using MSRs (yet)");
+            }
+            else
+                PERROR("Error querying maximum number of MSRs for VCPU%d", i);
+            goto out;
+        }
+
         /* Start to fetch CPU eXtended States */
         /* Get buffer size first */
         domctl.cmd = XEN_DOMCTL_getvcpuextstate;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFp-0002Wg-Kj; Thu, 19 Jun 2014 04:47:17 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFn-0002WG-I8
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:15 +0000
Received: from [85.158.143.35:26796] by server-3.bemta-4.messagelabs.com id
	70/D0-16194-25B62A35; Thu, 19 Jun 2014 04:47:14 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1403153233!8913412!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28976 invoked from network); 19 Jun 2014 04:47:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFl-0002eW-3v
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFl-000840-2b
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:13 +0000
Date: Thu, 19 Jun 2014 04:47:13 +0000
Message-Id: <E1WxUFl-000840-2b@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: use an explicit check for PV
	MSRs in xc_domain_save()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db24f7f0123c3103e0d7860a7dc3be84463d1814
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 16:58:47 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 16:58:47 2014 +0200

    libxc: use an explicit check for PV MSRs in xc_domain_save()
    
    Migrating PV domains using MSRs is not supported.  This uses the new
    XEN_DOMCTL_get_vcpu_msrs and will fail the migration with an explicit error.
    
    This is an improvement upon the current failure of
      "No extended context for VCPUxx (ENOBUFS)"
    
    Support for migrating PV domains which are using MSRs will be included in the
    migration v2 work.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
---
 tools/libxc/xc_domain_save.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index acf3685..778cbde 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1995,6 +1995,26 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
             goto out;
         }
 
+        /* Check there are no PV MSRs in use. */
+        domctl.cmd = XEN_DOMCTL_get_vcpu_msrs;
+        domctl.domain = dom;
+        memset(&domctl.u, 0, sizeof(domctl.u));
+        domctl.u.vcpu_msrs.vcpu = i;
+        domctl.u.vcpu_msrs.msr_count = 0;
+        set_xen_guest_handle_raw(domctl.u.vcpu_msrs.msrs, (void*)1);
+
+        if ( xc_domctl(xch, &domctl) < 0 )
+        {
+            if ( errno == ENOBUFS )
+            {
+                errno = EOPNOTSUPP;
+                PERROR("Unable to migrate PV guest using MSRs (yet)");
+            }
+            else
+                PERROR("Error querying maximum number of MSRs for VCPU%d", i);
+            goto out;
+        }
+
         /* Start to fetch CPU eXtended States */
         /* Get buffer size first */
         domctl.cmd = XEN_DOMCTL_getvcpuextstate;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFz-0002YX-Nf; Thu, 19 Jun 2014 04:47:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFx-0002Y7-TV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:26 +0000
Received: from [193.109.254.147:55578] by server-9.bemta-14.messagelabs.com id
	24/62-03644-D5B62A35; Thu, 19 Jun 2014 04:47:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1403153243!12259422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8043 invoked from network); 19 Jun 2014 04:47:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFv-0002ec-C9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFv-000855-8M
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:23 +0000
Date: Thu, 19 Jun 2014 04:47:23 +0000
Message-Id: <E1WxUFv-000855-8M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: remove PV MSR parts of
	XEN_DOMCTL_[gs]et_ext_vcpucontext
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18e762ac4dfa4b2c19a5191bc6de4fcaffd44ba1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 16:59:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 16:59:11 2014 +0200

    x86/domctl: remove PV MSR parts of XEN_DOMCTL_[gs]et_ext_vcpucontext
    
    The PV MSR functionality is now implemented as a separate set of domctls.
    
    This is a revert of parts of c/s65e3554908
      "x86/PV: support data breakpoint extension registers"
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c       |   78 +------------------------------------------
 xen/include/public/domctl.h |   19 ----------
 2 files changed, 1 insertions(+), 96 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 78be83c..a4effc3 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -818,7 +818,6 @@ long arch_do_domctl(
     {
         struct xen_domctl_ext_vcpucontext *evc;
         struct vcpu *v;
-        struct xen_domctl_ext_vcpu_msr msr;
 
         evc = &domctl->u.ext_vcpucontext;
 
@@ -864,42 +863,7 @@ long arch_do_domctl(
             evc->vmce.mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2;
             evc->vmce.mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2;
 
-            i = ret = 0;
-            if ( boot_cpu_has(X86_FEATURE_DBEXT) )
-            {
-                unsigned int j;
-
-                if ( v->arch.pv_vcpu.dr_mask[0] )
-                {
-                    if ( i < evc->msr_count && !ret )
-                    {
-                        msr.index = MSR_AMD64_DR0_ADDRESS_MASK;
-                        msr.reserved = 0;
-                        msr.value = v->arch.pv_vcpu.dr_mask[0];
-                        if ( copy_to_guest_offset(evc->msrs, i, &msr, 1) )
-                            ret = -EFAULT;
-                    }
-                    ++i;
-                }
-                for ( j = 0; j < 3; ++j )
-                {
-                    if ( !v->arch.pv_vcpu.dr_mask[1 + j] )
-                        continue;
-                    if ( i < evc->msr_count && !ret )
-                    {
-                        msr.index = MSR_AMD64_DR1_ADDRESS_MASK + j;
-                        msr.reserved = 0;
-                        msr.value = v->arch.pv_vcpu.dr_mask[1 + j];
-                        if ( copy_to_guest_offset(evc->msrs, i, &msr, 1) )
-                            ret = -EFAULT;
-                    }
-                    ++i;
-                }
-            }
-            if ( i > evc->msr_count && !ret )
-                ret = -ENOBUFS;
-            evc->msr_count = i;
-
+            ret = 0;
             vcpu_unpause(v);
             copyback = 1;
         }
@@ -954,49 +918,9 @@ long arch_do_domctl(
 
                 ret = vmce_restore_vcpu(v, &vmce);
             }
-            else if ( evc->size > offsetof(typeof(*evc), vmce) )
-                ret = -EINVAL;
             else
                 ret = 0;
 
-            if ( ret || evc->size <= offsetof(typeof(*evc), msrs) )
-                /* nothing */;
-            else if ( evc->size < offsetof(typeof(*evc), msrs) +
-                                  sizeof(evc->msrs) )
-                ret = -EINVAL;
-            else
-            {
-                for ( i = 0; i < evc->msr_count; ++i )
-                {
-                    ret = -EFAULT;
-                    if ( copy_from_guest_offset(&msr, evc->msrs, i, 1) )
-                        break;
-                    ret = -EINVAL;
-                    if ( msr.reserved )
-                        break;
-                    switch ( msr.index )
-                    {
-                    case MSR_AMD64_DR0_ADDRESS_MASK:
-                        if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
-                             (msr.value >> 32) )
-                            break;
-                        v->arch.pv_vcpu.dr_mask[0] = msr.value;
-                        continue;
-                    case MSR_AMD64_DR1_ADDRESS_MASK ...
-                         MSR_AMD64_DR3_ADDRESS_MASK:
-                        if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
-                             (msr.value >> 32) )
-                            break;
-                        msr.index -= MSR_AMD64_DR1_ADDRESS_MASK - 1;
-                        v->arch.pv_vcpu.dr_mask[msr.index] = msr.value;
-                        continue;
-                    }
-                    break;
-                }
-                if ( i == evc->msr_count )
-                    ret = 0;
-            }
-
             domain_unpause(d);
         }
     }
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 0ddffaa..2967133 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -543,16 +543,6 @@ typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t);
 
 
-#if defined(__i386__) || defined(__x86_64__)
-struct xen_domctl_ext_vcpu_msr {
-    uint32_t         index;
-    uint32_t         reserved;
-    uint64_aligned_t value;
-};
-typedef struct xen_domctl_ext_vcpu_msr xen_domctl_ext_vcpu_msr_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpu_msr_t);
-#endif
-
 /* XEN_DOMCTL_set_ext_vcpucontext */
 /* XEN_DOMCTL_get_ext_vcpucontext */
 struct xen_domctl_ext_vcpucontext {
@@ -572,14 +562,6 @@ struct xen_domctl_ext_vcpucontext {
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
-    /*
-     * When, for the "get" version, msr_count is too small to cover all MSRs
-     * the hypervisor needs to be saved, the call will return -ENOBUFS and
-     * set msr_count to the required (minimum) value. Furthermore, for both
-     * "get" and "set", that field as well as the msrs one only get looked at
-     * if the size field above covers the structure up to the entire msrs one.
-     */
-    uint16_t         msr_count;
 #if defined(__GNUC__)
     union {
         uint64_aligned_t mcg_cap;
@@ -588,7 +570,6 @@ struct xen_domctl_ext_vcpucontext {
 #else
     struct hvm_vmce_vcpu vmce;
 #endif
-    XEN_GUEST_HANDLE_64(xen_domctl_ext_vcpu_msr_t) msrs;
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUFz-0002YX-Nf; Thu, 19 Jun 2014 04:47:27 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFx-0002Y7-TV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:26 +0000
Received: from [193.109.254.147:55578] by server-9.bemta-14.messagelabs.com id
	24/62-03644-D5B62A35; Thu, 19 Jun 2014 04:47:25 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1403153243!12259422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8043 invoked from network); 19 Jun 2014 04:47:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFv-0002ec-C9
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUFv-000855-8M
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:23 +0000
Date: Thu, 19 Jun 2014 04:47:23 +0000
Message-Id: <E1WxUFv-000855-8M@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/domctl: remove PV MSR parts of
	XEN_DOMCTL_[gs]et_ext_vcpucontext
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 18e762ac4dfa4b2c19a5191bc6de4fcaffd44ba1
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 16:59:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 16:59:11 2014 +0200

    x86/domctl: remove PV MSR parts of XEN_DOMCTL_[gs]et_ext_vcpucontext
    
    The PV MSR functionality is now implemented as a separate set of domctls.
    
    This is a revert of parts of c/s65e3554908
      "x86/PV: support data breakpoint extension registers"
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/domctl.c       |   78 +------------------------------------------
 xen/include/public/domctl.h |   19 ----------
 2 files changed, 1 insertions(+), 96 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 78be83c..a4effc3 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -818,7 +818,6 @@ long arch_do_domctl(
     {
         struct xen_domctl_ext_vcpucontext *evc;
         struct vcpu *v;
-        struct xen_domctl_ext_vcpu_msr msr;
 
         evc = &domctl->u.ext_vcpucontext;
 
@@ -864,42 +863,7 @@ long arch_do_domctl(
             evc->vmce.mci_ctl2_bank0 = v->arch.vmce.bank[0].mci_ctl2;
             evc->vmce.mci_ctl2_bank1 = v->arch.vmce.bank[1].mci_ctl2;
 
-            i = ret = 0;
-            if ( boot_cpu_has(X86_FEATURE_DBEXT) )
-            {
-                unsigned int j;
-
-                if ( v->arch.pv_vcpu.dr_mask[0] )
-                {
-                    if ( i < evc->msr_count && !ret )
-                    {
-                        msr.index = MSR_AMD64_DR0_ADDRESS_MASK;
-                        msr.reserved = 0;
-                        msr.value = v->arch.pv_vcpu.dr_mask[0];
-                        if ( copy_to_guest_offset(evc->msrs, i, &msr, 1) )
-                            ret = -EFAULT;
-                    }
-                    ++i;
-                }
-                for ( j = 0; j < 3; ++j )
-                {
-                    if ( !v->arch.pv_vcpu.dr_mask[1 + j] )
-                        continue;
-                    if ( i < evc->msr_count && !ret )
-                    {
-                        msr.index = MSR_AMD64_DR1_ADDRESS_MASK + j;
-                        msr.reserved = 0;
-                        msr.value = v->arch.pv_vcpu.dr_mask[1 + j];
-                        if ( copy_to_guest_offset(evc->msrs, i, &msr, 1) )
-                            ret = -EFAULT;
-                    }
-                    ++i;
-                }
-            }
-            if ( i > evc->msr_count && !ret )
-                ret = -ENOBUFS;
-            evc->msr_count = i;
-
+            ret = 0;
             vcpu_unpause(v);
             copyback = 1;
         }
@@ -954,49 +918,9 @@ long arch_do_domctl(
 
                 ret = vmce_restore_vcpu(v, &vmce);
             }
-            else if ( evc->size > offsetof(typeof(*evc), vmce) )
-                ret = -EINVAL;
             else
                 ret = 0;
 
-            if ( ret || evc->size <= offsetof(typeof(*evc), msrs) )
-                /* nothing */;
-            else if ( evc->size < offsetof(typeof(*evc), msrs) +
-                                  sizeof(evc->msrs) )
-                ret = -EINVAL;
-            else
-            {
-                for ( i = 0; i < evc->msr_count; ++i )
-                {
-                    ret = -EFAULT;
-                    if ( copy_from_guest_offset(&msr, evc->msrs, i, 1) )
-                        break;
-                    ret = -EINVAL;
-                    if ( msr.reserved )
-                        break;
-                    switch ( msr.index )
-                    {
-                    case MSR_AMD64_DR0_ADDRESS_MASK:
-                        if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
-                             (msr.value >> 32) )
-                            break;
-                        v->arch.pv_vcpu.dr_mask[0] = msr.value;
-                        continue;
-                    case MSR_AMD64_DR1_ADDRESS_MASK ...
-                         MSR_AMD64_DR3_ADDRESS_MASK:
-                        if ( !boot_cpu_has(X86_FEATURE_DBEXT) ||
-                             (msr.value >> 32) )
-                            break;
-                        msr.index -= MSR_AMD64_DR1_ADDRESS_MASK - 1;
-                        v->arch.pv_vcpu.dr_mask[msr.index] = msr.value;
-                        continue;
-                    }
-                    break;
-                }
-                if ( i == evc->msr_count )
-                    ret = 0;
-            }
-
             domain_unpause(d);
         }
     }
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 0ddffaa..2967133 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -543,16 +543,6 @@ typedef struct xen_domctl_pin_mem_cacheattr xen_domctl_pin_mem_cacheattr_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_pin_mem_cacheattr_t);
 
 
-#if defined(__i386__) || defined(__x86_64__)
-struct xen_domctl_ext_vcpu_msr {
-    uint32_t         index;
-    uint32_t         reserved;
-    uint64_aligned_t value;
-};
-typedef struct xen_domctl_ext_vcpu_msr xen_domctl_ext_vcpu_msr_t;
-DEFINE_XEN_GUEST_HANDLE(xen_domctl_ext_vcpu_msr_t);
-#endif
-
 /* XEN_DOMCTL_set_ext_vcpucontext */
 /* XEN_DOMCTL_get_ext_vcpucontext */
 struct xen_domctl_ext_vcpucontext {
@@ -572,14 +562,6 @@ struct xen_domctl_ext_vcpucontext {
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
-    /*
-     * When, for the "get" version, msr_count is too small to cover all MSRs
-     * the hypervisor needs to be saved, the call will return -ENOBUFS and
-     * set msr_count to the required (minimum) value. Furthermore, for both
-     * "get" and "set", that field as well as the msrs one only get looked at
-     * if the size field above covers the structure up to the entire msrs one.
-     */
-    uint16_t         msr_count;
 #if defined(__GNUC__)
     union {
         uint64_aligned_t mcg_cap;
@@ -588,7 +570,6 @@ struct xen_domctl_ext_vcpucontext {
 #else
     struct hvm_vmce_vcpu vmce;
 #endif
-    XEN_GUEST_HANDLE_64(xen_domctl_ext_vcpu_msr_t) msrs;
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUG9-0002a9-RQ; Thu, 19 Jun 2014 04:47:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUG8-0002Zm-3F
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:36 +0000
Received: from [193.109.254.147:11585] by server-12.bemta-14.messagelabs.com
	id 7E/AE-32179-76B62A35; Thu, 19 Jun 2014 04:47:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1403153253!12259448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8935 invoked from network); 19 Jun 2014 04:47:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUG5-0002ei-J6
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUG5-00085S-Gd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:33 +0000
Date: Thu, 19 Jun 2014 04:47:33 +0000
Message-Id: <E1WxUG5-00085S-Gd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91212466097ca12eeae078db70823f8717c9b534
Merge: 7528dcd02de1fa72acbc841a3608046549a163a2 18e762ac4dfa4b2c19a5191bc6de4fcaffd44ba1
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 10 16:04:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 16:04:12 2014 +0100

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

 tools/libxc/xc_domain_save.c |   20 ++++
 xen/arch/x86/domctl.c        |  205 ++++++++++++++++++++++++++----------------
 xen/include/public/domctl.h  |   57 ++++++++----
 3 files changed, 186 insertions(+), 96 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUG9-0002a9-RQ; Thu, 19 Jun 2014 04:47:37 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUG8-0002Zm-3F
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:36 +0000
Received: from [193.109.254.147:11585] by server-12.bemta-14.messagelabs.com
	id 7E/AE-32179-76B62A35; Thu, 19 Jun 2014 04:47:35 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-27.messagelabs.com!1403153253!12259448!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8935 invoked from network); 19 Jun 2014 04:47:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUG5-0002ei-J6
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUG5-00085S-Gd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:33 +0000
Date: Thu, 19 Jun 2014 04:47:33 +0000
Message-Id: <E1WxUG5-00085S-Gd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 91212466097ca12eeae078db70823f8717c9b534
Merge: 7528dcd02de1fa72acbc841a3608046549a163a2 18e762ac4dfa4b2c19a5191bc6de4fcaffd44ba1
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 10 16:04:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 16:04:12 2014 +0100

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

 tools/libxc/xc_domain_save.c |   20 ++++
 xen/arch/x86/domctl.c        |  205 ++++++++++++++++++++++++++----------------
 xen/include/public/domctl.h  |   57 ++++++++----
 3 files changed, 186 insertions(+), 96 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGJ-0002bZ-UE; Thu, 19 Jun 2014 04:47:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGI-0002bI-3Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:46 +0000
Received: from [85.158.143.35:35773] by server-3.bemta-4.messagelabs.com id
	F9/01-16194-17B62A35; Thu, 19 Jun 2014 04:47:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403153263!12383532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18133 invoked from network); 19 Jun 2014 04:47:44 -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;
	19 Jun 2014 04:47:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGF-0002eo-PZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGF-000863-Ns
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:43 +0000
Date: Thu, 19 Jun 2014 04:47:43 +0000
Message-Id: <E1WxUGF-000863-Ns@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/EFI: improve boot time
	diagnostics"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f7384ccdbebee118f7bc63c0f22a539970d6046
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 10 17:56:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 17:56:11 2014 +0200

    Revert "x86/EFI: improve boot time diagnostics"
    
    This reverts commit 9921387f0c14a3f0ed42f9112efb7260af13db35.
    It added an error check where none should be.
---
 xen/arch/x86/efi/boot.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 1966cc5..a772509 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -344,12 +344,11 @@ static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
         ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
                                      &fs_protocol, (void **)&fio);
         if ( EFI_ERROR(ret) )
-            PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
-                         ret);
+            blexit(L"Couldn't obtain the File System Protocol Interface");
         ret = fio->OpenVolume(fio, &dir_handle);
     } while ( ret == EFI_MEDIA_CHANGED );
     if ( ret != EFI_SUCCESS )
-        PrintErrMesg(L"OpenVolume failure", ret);
+        blexit(L"OpenVolume failure");
 
 #define buffer ((CHAR16 *)keyhandler_scratch)
 #define BUFFERSIZE sizeof(keyhandler_scratch)
@@ -968,8 +967,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
                     (void **)&shim_lock)) &&
-         (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
-        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
+         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
+        blexit(L"Dom0 kernel image could not be verified.");
 
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
@@ -1382,8 +1381,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
-    if ( EFI_ERROR(status) )
-        PrintErrMesg(L"Cannot size memory map", status);
     mbi.mem_upper -= efi_memmap_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
@@ -1392,7 +1389,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
     if ( EFI_ERROR(status) )
-        PrintErrMesg(L"Cannot obtain memory map", status);
+        blexit(L"Cannot obtain memory map");
 
     /* Populate E820 table and check trampoline area availability. */
     e = e820map - 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGJ-0002bZ-UE; Thu, 19 Jun 2014 04:47:47 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGI-0002bI-3Z
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:46 +0000
Received: from [85.158.143.35:35773] by server-3.bemta-4.messagelabs.com id
	F9/01-16194-17B62A35; Thu, 19 Jun 2014 04:47:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403153263!12383532!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18133 invoked from network); 19 Jun 2014 04:47:44 -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;
	19 Jun 2014 04:47:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGF-0002eo-PZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:43 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGF-000863-Ns
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:43 +0000
Date: Thu, 19 Jun 2014 04:47:43 +0000
Message-Id: <E1WxUGF-000863-Ns@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Revert "x86/EFI: improve boot time
	diagnostics"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f7384ccdbebee118f7bc63c0f22a539970d6046
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 10 17:56:11 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 10 17:56:11 2014 +0200

    Revert "x86/EFI: improve boot time diagnostics"
    
    This reverts commit 9921387f0c14a3f0ed42f9112efb7260af13db35.
    It added an error check where none should be.
---
 xen/arch/x86/efi/boot.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index 1966cc5..a772509 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -344,12 +344,11 @@ static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
         ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
                                      &fs_protocol, (void **)&fio);
         if ( EFI_ERROR(ret) )
-            PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
-                         ret);
+            blexit(L"Couldn't obtain the File System Protocol Interface");
         ret = fio->OpenVolume(fio, &dir_handle);
     } while ( ret == EFI_MEDIA_CHANGED );
     if ( ret != EFI_SUCCESS )
-        PrintErrMesg(L"OpenVolume failure", ret);
+        blexit(L"OpenVolume failure");
 
 #define buffer ((CHAR16 *)keyhandler_scratch)
 #define BUFFERSIZE sizeof(keyhandler_scratch)
@@ -968,8 +967,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
                     (void **)&shim_lock)) &&
-         (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
-        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
+         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
+        blexit(L"Dom0 kernel image could not be verified.");
 
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
@@ -1382,8 +1381,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
-    if ( EFI_ERROR(status) )
-        PrintErrMesg(L"Cannot size memory map", status);
     mbi.mem_upper -= efi_memmap_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
@@ -1392,7 +1389,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
     if ( EFI_ERROR(status) )
-        PrintErrMesg(L"Cannot obtain memory map", status);
+        blexit(L"Cannot obtain memory map");
 
     /* Populate E820 table and check trampoline area availability. */
     e = e820map - 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:57 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGT-0002dG-3I; Thu, 19 Jun 2014 04:47:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGS-0002cx-Eh
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:56 +0000
Received: from [85.158.139.211:44884] by server-7.bemta-5.messagelabs.com id
	05/F2-03657-B7B62A35; Thu, 19 Jun 2014 04:47:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1403153274!10745192!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13146 invoked from network); 19 Jun 2014 04:47:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGP-0002eu-Vd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGP-00086Y-UR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:53 +0000
Date: Thu, 19 Jun 2014 04:47:53 +0000
Message-Id: <E1WxUGP-00086Y-UR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: move some internal functions to
	libxl_internal.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e101ee667b55c8bcb2b4d87123fe82779451be90
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jun 10 22:21:40 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 11 09:25:23 2014 +0100

    libxl: move some internal functions to libxl_internal.h
    
    In 752f181f ("libxl_json: introduce parser functions for builtin types")
    a bunch of parser functions are added to libxl_json.h, which breaks
    GCC < 4.6.
    
    These functions are internal and libxl_json.h is public header, so move
    them to libxl_internal.h.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   32 ++++++++++++++++++++++++++++++++
 tools/libxl/libxl_json.h     |   35 -----------------------------------
 2 files changed, 32 insertions(+), 35 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 80ea883..a0d4f24 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3147,6 +3147,38 @@ void libxl__numa_candidate_put_nodemap(libxl__gc *gc,
  */
 #define CTYPE(isfoo,c) (isfoo((unsigned char)(c)))
 
+int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             libxl_defbool *p);
+int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           bool *p);
+int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                         libxl_mac *p);
+int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            libxl_bitmap *p);
+int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          libxl_uuid *p);
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p);
+int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                 libxl_string_list *p);
+int libxl_key_value_list_parse_json(libxl__gc *gc,
+                                    const libxl__json_object *o,
+                                    libxl_key_value_list *p);
+int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           libxl_hwcap *p);
+int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          void *p);
+int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            void *p);
+int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             char **p);
 
 #endif
 
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index b196c1c..e4c0f6c 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -22,52 +22,17 @@
 #  include <yajl/yajl_version.h>
 #endif
 
-typedef struct libxl__gc libxl__gc;
-typedef struct libxl__json_object libxl__json_object;
-
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
-int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             libxl_defbool *p);
-int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                           bool *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
-int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                          libxl_uuid *p);
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
-int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                         libxl_mac *p);
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand, libxl_bitmap *p);
-int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                            libxl_bitmap *p);
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                                  libxl_cpuid_policy_list *p);
-int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
-                                       const libxl__json_object *o,
-                                       libxl_cpuid_policy_list *p);
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
-int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                                 libxl_string_list *p);
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *p);
-int libxl_key_value_list_parse_json(libxl__gc *gc,
-                                    const libxl__json_object *o,
-                                    libxl_key_value_list *p);
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
-int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                           libxl_hwcap *p);
-int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                          void *p);
-int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                            void *p);
-int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             void *p);
-int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             void *p);
-int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             void *p);
-int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             char **p);
 
 #include <_libxl_types_json.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:47:57 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:47:57 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGT-0002dG-3I; Thu, 19 Jun 2014 04:47:57 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGS-0002cx-Eh
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:56 +0000
Received: from [85.158.139.211:44884] by server-7.bemta-5.messagelabs.com id
	05/F2-03657-B7B62A35; Thu, 19 Jun 2014 04:47:55 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1403153274!10745192!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13146 invoked from network); 19 Jun 2014 04:47:55 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:47:55 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGP-0002eu-Vd
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:53 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGP-00086Y-UR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:47:53 +0000
Date: Thu, 19 Jun 2014 04:47:53 +0000
Message-Id: <E1WxUGP-00086Y-UR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: move some internal functions to
	libxl_internal.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e101ee667b55c8bcb2b4d87123fe82779451be90
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jun 10 22:21:40 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 11 09:25:23 2014 +0100

    libxl: move some internal functions to libxl_internal.h
    
    In 752f181f ("libxl_json: introduce parser functions for builtin types")
    a bunch of parser functions are added to libxl_json.h, which breaks
    GCC < 4.6.
    
    These functions are internal and libxl_json.h is public header, so move
    them to libxl_internal.h.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_internal.h |   32 ++++++++++++++++++++++++++++++++
 tools/libxl/libxl_json.h     |   35 -----------------------------------
 2 files changed, 32 insertions(+), 35 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index 80ea883..a0d4f24 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -3147,6 +3147,38 @@ void libxl__numa_candidate_put_nodemap(libxl__gc *gc,
  */
 #define CTYPE(isfoo,c) (isfoo((unsigned char)(c)))
 
+int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             libxl_defbool *p);
+int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           bool *p);
+int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                         libxl_mac *p);
+int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            libxl_bitmap *p);
+int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          libxl_uuid *p);
+int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
+                                       const libxl__json_object *o,
+                                       libxl_cpuid_policy_list *p);
+int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                                 libxl_string_list *p);
+int libxl_key_value_list_parse_json(libxl__gc *gc,
+                                    const libxl__json_object *o,
+                                    libxl_key_value_list *p);
+int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                           libxl_hwcap *p);
+int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                          void *p);
+int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                            void *p);
+int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             void *p);
+int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
+                             char **p);
 
 #endif
 
diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index b196c1c..e4c0f6c 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -22,52 +22,17 @@
 #  include <yajl/yajl_version.h>
 #endif
 
-typedef struct libxl__gc libxl__gc;
-typedef struct libxl__json_object libxl__json_object;
-
 yajl_gen_status libxl__uint64_gen_json(yajl_gen hand, uint64_t val);
 yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
-int libxl_defbool_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             libxl_defbool *p);
-int libxl__bool_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                           bool *p);
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
-int libxl_uuid_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                          libxl_uuid *p);
 yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
-int libxl_mac_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                         libxl_mac *p);
 yajl_gen_status libxl_bitmap_gen_json(yajl_gen hand, libxl_bitmap *p);
-int libxl_bitmap_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                            libxl_bitmap *p);
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                                  libxl_cpuid_policy_list *p);
-int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
-                                       const libxl__json_object *o,
-                                       libxl_cpuid_policy_list *p);
 yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
-int libxl_string_list_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                                 libxl_string_list *p);
 yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
                                               libxl_key_value_list *p);
-int libxl_key_value_list_parse_json(libxl__gc *gc,
-                                    const libxl__json_object *o,
-                                    libxl_key_value_list *p);
 yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
-int libxl_hwcap_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                           libxl_hwcap *p);
-int libxl__int_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                          void *p);
-int libxl__uint8_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                            void *p);
-int libxl__uint16_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             void *p);
-int libxl__uint32_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             void *p);
-int libxl__uint64_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             void *p);
-int libxl__string_parse_json(libxl__gc *gc, const libxl__json_object *o,
-                             char **p);
 
 #include <_libxl_types_json.h>
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:08 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGe-0002ev-6G; Thu, 19 Jun 2014 04:48:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGc-0002ej-Px
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:06 +0000
Received: from [193.109.254.147:56710] by server-16.bemta-14.messagelabs.com
	id 1E/5B-16986-68B62A35; Thu, 19 Jun 2014 04:48:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403153284!12257664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8955 invoked from network); 19 Jun 2014 04:48:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGa-0002fT-6g
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGa-000874-4G
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:04 +0000
Date: Thu, 19 Jun 2014 04:48:04 +0000
Message-Id: <E1WxUGa-000874-4G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: mark context LOADED before
	registers are loaded
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 825c466dc85b3bc901935118626fa37403e65b0f
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Jun 11 10:55:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 11 10:55:43 2014 +0200

    x86/VPMU: mark context LOADED before registers are loaded
    
    Because a PMU interrupt may be generated as soon as PMU registers are
    loaded (or, more precisely, as soon as HW PMU is "armed") we don't want
    to delay marking context as LOADED until after registers are loaded.
    Otherwise during interrupt handling VPMU_CONTEXT_LOADED may not be set
    and this could be confusing.
    
    (Technically, only SVM needs this change right now since VMX will "arm"
    PMU later, during VMRUN when global control register is loaded from
    VMCS. However, both AMD and Intel code will require this patch when we
    introduce PV VPMU.)
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |    2 ++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    2 ++
 xen/arch/x86/hvm/vpmu.c           |    3 +--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 66a3815..3ac7d53 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -203,6 +203,8 @@ static void amd_vpmu_load(struct vcpu *v)
         return;
     }
 
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+
     context_load(v);
 }
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 3129ebd..ccd14d9 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -369,6 +369,8 @@ static void core2_vpmu_load(struct vcpu *v)
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
         return;
 
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+
     __core2_vpmu_load(v);
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 21fbaba..63765fa 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -211,10 +211,9 @@ void vpmu_load(struct vcpu *v)
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_load )
     {
         apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+        /* Arch code needs to set VPMU_CONTEXT_LOADED */
         vpmu->arch_vpmu_ops->arch_vpmu_load(v);
     }
-
-    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_initialise(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:08 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:08 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGe-0002ev-6G; Thu, 19 Jun 2014 04:48:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGc-0002ej-Px
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:06 +0000
Received: from [193.109.254.147:56710] by server-16.bemta-14.messagelabs.com
	id 1E/5B-16986-68B62A35; Thu, 19 Jun 2014 04:48:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-27.messagelabs.com!1403153284!12257664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8955 invoked from network); 19 Jun 2014 04:48:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGa-0002fT-6g
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGa-000874-4G
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:04 +0000
Date: Thu, 19 Jun 2014 04:48:04 +0000
Message-Id: <E1WxUGa-000874-4G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/VPMU: mark context LOADED before
	registers are loaded
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 825c466dc85b3bc901935118626fa37403e65b0f
Author:     Boris Ostrovsky <boris.ostrovsky@oracle.com>
AuthorDate: Wed Jun 11 10:55:43 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 11 10:55:43 2014 +0200

    x86/VPMU: mark context LOADED before registers are loaded
    
    Because a PMU interrupt may be generated as soon as PMU registers are
    loaded (or, more precisely, as soon as HW PMU is "armed") we don't want
    to delay marking context as LOADED until after registers are loaded.
    Otherwise during interrupt handling VPMU_CONTEXT_LOADED may not be set
    and this could be confusing.
    
    (Technically, only SVM needs this change right now since VMX will "arm"
    PMU later, during VMRUN when global control register is loaded from
    VMCS. However, both AMD and Intel code will require this patch when we
    introduce PV VPMU.)
    
    Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Tested-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/hvm/svm/vpmu.c       |    2 ++
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    2 ++
 xen/arch/x86/hvm/vpmu.c           |    3 +--
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vpmu.c b/xen/arch/x86/hvm/svm/vpmu.c
index 66a3815..3ac7d53 100644
--- a/xen/arch/x86/hvm/svm/vpmu.c
+++ b/xen/arch/x86/hvm/svm/vpmu.c
@@ -203,6 +203,8 @@ static void amd_vpmu_load(struct vcpu *v)
         return;
     }
 
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+
     context_load(v);
 }
 
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index 3129ebd..ccd14d9 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -369,6 +369,8 @@ static void core2_vpmu_load(struct vcpu *v)
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED) )
         return;
 
+    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
+
     __core2_vpmu_load(v);
 }
 
diff --git a/xen/arch/x86/hvm/vpmu.c b/xen/arch/x86/hvm/vpmu.c
index 21fbaba..63765fa 100644
--- a/xen/arch/x86/hvm/vpmu.c
+++ b/xen/arch/x86/hvm/vpmu.c
@@ -211,10 +211,9 @@ void vpmu_load(struct vcpu *v)
     if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->arch_vpmu_load )
     {
         apic_write_around(APIC_LVTPC, vpmu->hw_lapic_lvtpc);
+        /* Arch code needs to set VPMU_CONTEXT_LOADED */
         vpmu->arch_vpmu_ops->arch_vpmu_load(v);
     }
-
-    vpmu_set(vpmu, VPMU_CONTEXT_LOADED);
 }
 
 void vpmu_initialise(struct vcpu *v)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGo-0002gX-9H; Thu, 19 Jun 2014 04:48:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGm-0002gF-QJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:16 +0000
Received: from [85.158.139.211:18093] by server-16.bemta-5.messagelabs.com id
	41/14-18862-09B62A35; Thu, 19 Jun 2014 04:48:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403153294!10756485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17771 invoked from network); 19 Jun 2014 04:48:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGk-0002fZ-Ce
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGk-00087Q-Au
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:14 +0000
Date: Thu, 19 Jun 2014 04:48:14 +0000
Message-Id: <E1WxUGk-00087Q-Au@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Add Valgrind client
	requests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 171c6d7ac17e29e0f4dcf058aa6c4ee11088f6c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 15:41:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 10:04:44 2014 +0100

    tools/libxc: Add Valgrind client requests
    
    Valgrind client requests can be used by code to provide extra debugging
    information about memory ranges, or to request checks at specific points.
    
    Reference:
      http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs
    
    Client requests are safe to compile into code for running outside of
    valgrind.  Therefore, enable client requests whenever autoconf can find
    memcheck.h and debug builds are enabled.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran autogen.sh ]
---
 tools/config.h.in        |    3 +++
 tools/configure          |    2 +-
 tools/configure.ac       |    2 +-
 tools/libxc/Makefile     |    3 +++
 tools/libxc/xc_private.h |    7 +++++++
 5 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index 015f2a1..bb34f32 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -48,6 +48,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
+#undef HAVE_VALGRIND_MEMCHECK_H
+
 /* Define to 1 if you have the <yajl/yajl_version.h> header file. */
 #undef HAVE_YAJL_YAJL_VERSION_H
 
diff --git a/tools/configure b/tools/configure
index d4a7919..ea2ad80 100755
--- a/tools/configure
+++ b/tools/configure
@@ -8057,7 +8057,7 @@ fi
 esac
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h sys/eventfd.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/tools/configure.ac b/tools/configure.ac
index 25d7ca3..89f1ac7 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -245,7 +245,7 @@ AC_CHECK_LIB([fdt], [fdt_create], [], [AC_MSG_ERROR([Could not find libfdt])])
 esac
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h])
 
 AC_OUTPUT()
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a74b19e..215101d 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -104,6 +104,9 @@ GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
 OSDEP_LIB_OBJS := $(patsubst %.c,%.o,$(OSDEP_SRCS-y))
 OSDEP_PIC_OBJS := $(patsubst %.c,%.opic,$(OSDEP_SRCS-y))
 
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS) : CFLAGS += -include $(XEN_ROOT)/tools/config.h
+
 LIB := libxenctrl.a
 ifneq ($(stubdom),y)
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 4447cec..c7730f2 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -34,6 +34,13 @@
 
 #include <xen/sys/privcmd.h>
 
+#if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG)
+/* Compile in Valgrind client requests? */
+#include <valgrind/memcheck.h>
+#else
+#define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
+#endif
+
 #define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
 #define DECLARE_DOMCTL struct xen_domctl domctl
 #define DECLARE_SYSCTL struct xen_sysctl sysctl
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGo-0002gX-9H; Thu, 19 Jun 2014 04:48:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGm-0002gF-QJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:16 +0000
Received: from [85.158.139.211:18093] by server-16.bemta-5.messagelabs.com id
	41/14-18862-09B62A35; Thu, 19 Jun 2014 04:48:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403153294!10756485!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17771 invoked from network); 19 Jun 2014 04:48:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGk-0002fZ-Ce
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGk-00087Q-Au
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:14 +0000
Date: Thu, 19 Jun 2014 04:48:14 +0000
Message-Id: <E1WxUGk-00087Q-Au@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Add Valgrind client
	requests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 171c6d7ac17e29e0f4dcf058aa6c4ee11088f6c7
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 10 15:41:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 10:04:44 2014 +0100

    tools/libxc: Add Valgrind client requests
    
    Valgrind client requests can be used by code to provide extra debugging
    information about memory ranges, or to request checks at specific points.
    
    Reference:
      http://valgrind.org/docs/manual/mc-manual.html#mc-manual.clientreqs
    
    Client requests are safe to compile into code for running outside of
    valgrind.  Therefore, enable client requests whenever autoconf can find
    memcheck.h and debug builds are enabled.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- reran autogen.sh ]
---
 tools/config.h.in        |    3 +++
 tools/configure          |    2 +-
 tools/configure.ac       |    2 +-
 tools/libxc/Makefile     |    3 +++
 tools/libxc/xc_private.h |    7 +++++++
 5 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index 015f2a1..bb34f32 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -48,6 +48,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <valgrind/memcheck.h> header file. */
+#undef HAVE_VALGRIND_MEMCHECK_H
+
 /* Define to 1 if you have the <yajl/yajl_version.h> header file. */
 #undef HAVE_YAJL_YAJL_VERSION_H
 
diff --git a/tools/configure b/tools/configure
index d4a7919..ea2ad80 100755
--- a/tools/configure
+++ b/tools/configure
@@ -8057,7 +8057,7 @@ fi
 esac
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h sys/eventfd.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/tools/configure.ac b/tools/configure.ac
index 25d7ca3..89f1ac7 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -245,7 +245,7 @@ AC_CHECK_LIB([fdt], [fdt_create], [], [AC_MSG_ERROR([Could not find libfdt])])
 esac
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h])
 
 AC_OUTPUT()
 
diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index a74b19e..215101d 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -104,6 +104,9 @@ GUEST_PIC_OBJS := $(patsubst %.c,%.opic,$(GUEST_SRCS-y))
 OSDEP_LIB_OBJS := $(patsubst %.c,%.o,$(OSDEP_SRCS-y))
 OSDEP_PIC_OBJS := $(patsubst %.c,%.opic,$(OSDEP_SRCS-y))
 
+$(CTRL_LIB_OBJS) $(GUEST_LIB_OBJS) $(OSDEP_LIB_OBJS) \
+$(CTRL_PIC_OBJS) $(GUEST_PIC_OBJS) $(OSDEP_PIC_OBJS) : CFLAGS += -include $(XEN_ROOT)/tools/config.h
+
 LIB := libxenctrl.a
 ifneq ($(stubdom),y)
 LIB += libxenctrl.so libxenctrl.so.$(MAJOR) libxenctrl.so.$(MAJOR).$(MINOR)
diff --git a/tools/libxc/xc_private.h b/tools/libxc/xc_private.h
index 4447cec..c7730f2 100644
--- a/tools/libxc/xc_private.h
+++ b/tools/libxc/xc_private.h
@@ -34,6 +34,13 @@
 
 #include <xen/sys/privcmd.h>
 
+#if defined(HAVE_VALGRIND_MEMCHECK_H) && !defined(NDEBUG)
+/* Compile in Valgrind client requests? */
+#include <valgrind/memcheck.h>
+#else
+#define VALGRIND_MAKE_MEM_UNDEFINED(addr, len) /* addr, len */
+#endif
+
 #define DECLARE_HYPERCALL privcmd_hypercall_t hypercall
 #define DECLARE_DOMCTL struct xen_domctl domctl
 #define DECLARE_SYSCTL struct xen_sysctl sysctl
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGz-0002ht-CX; Thu, 19 Jun 2014 04:48:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGx-0002he-W0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:28 +0000
Received: from [85.158.137.68:44040] by server-6.bemta-3.messagelabs.com id
	B7/1D-00470-A9B62A35; Thu, 19 Jun 2014 04:48:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403153304!11009488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31605 invoked from network); 19 Jun 2014 04:48:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGu-0002ff-KL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGu-00088J-Gz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:24 +0000
Date: Thu, 19 Jun 2014 04:48:24 +0000
Message-Id: <E1WxUGu-00088J-Gz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: const-ify libxl_uuid_*() API
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e98cff2914e7ee9e494ceb9da685b931124bbce
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Jun 10 19:07:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    libxl: const-ify libxl_uuid_*() API
    
    Add const to parameters of libxl_uuid_*() calls where it does not
    change the API.
    
    Add libxl_uuid_byte_array_const() to return a const array.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_uuid.c |   18 ++++++++++++++----
 tools/libxl/libxl_uuid.h |    5 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl_uuid.c b/tools/libxl/libxl_uuid.c
index ecc29c7..6591cb7 100644
--- a/tools/libxl/libxl_uuid.c
+++ b/tools/libxl/libxl_uuid.c
@@ -20,7 +20,7 @@
 
 #if defined(__linux__)
 
-int libxl_uuid_is_nil(libxl_uuid *uuid)
+int libxl_uuid_is_nil(const libxl_uuid *uuid)
 {
      return uuid_is_null(uuid->uuid);
 }
@@ -45,11 +45,16 @@ void libxl_uuid_clear(libxl_uuid *uuid)
      uuid_clear(uuid->uuid);
 }
 
-int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2)
+int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2)
 {
      return uuid_compare(uuid1->uuid, uuid2->uuid);
 }
 
+const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid)
+{
+    return uuid->uuid;
+}
+
 uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
 {
     return uuid->uuid;
@@ -57,7 +62,7 @@ uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
 
 #elif defined(__NetBSD__)
 
-int libxl_uuid_is_nil(libxl_uuid *uuid)
+int libxl_uuid_is_nil(const libxl_uuid *uuid)
 {
     uint32_t status;
     return uuid_is_nil((uuid_t *)uuid->uuid, &status);
@@ -92,11 +97,16 @@ void libxl_uuid_clear(libxl_uuid *uuid)
      memset(uuid->uuid, 0, sizeof(uuid->uuid));
 }
 
-int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2)
+int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2)
 {
      return memcmp(uuid1->uuid, uuid2->uuid, sizeof(uuid1->uuid));
 }
 
+const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid)
+{
+    return uuid->uuid;
+}
+
 uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
 {
     return uuid->uuid;
diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index 93c65a7..fbde7b6 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -53,12 +53,13 @@ typedef struct {
 
 #endif
 
-int libxl_uuid_is_nil(libxl_uuid *uuid);
+int libxl_uuid_is_nil(const libxl_uuid *uuid);
 void libxl_uuid_generate(libxl_uuid *uuid);
 int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
 void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src);
 void libxl_uuid_clear(libxl_uuid *uuid);
-int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2);
+int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2);
+const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid);
 uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid);
 
 #endif /* __LIBXL_UUID_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUGz-0002ht-CX; Thu, 19 Jun 2014 04:48:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGx-0002he-W0
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:28 +0000
Received: from [85.158.137.68:44040] by server-6.bemta-3.messagelabs.com id
	B7/1D-00470-A9B62A35; Thu, 19 Jun 2014 04:48:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403153304!11009488!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31605 invoked from network); 19 Jun 2014 04:48:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGu-0002ff-KL
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUGu-00088J-Gz
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:24 +0000
Date: Thu, 19 Jun 2014 04:48:24 +0000
Message-Id: <E1WxUGu-00088J-Gz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: const-ify libxl_uuid_*() API
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4e98cff2914e7ee9e494ceb9da685b931124bbce
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Jun 10 19:07:30 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    libxl: const-ify libxl_uuid_*() API
    
    Add const to parameters of libxl_uuid_*() calls where it does not
    change the API.
    
    Add libxl_uuid_byte_array_const() to return a const array.
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl_uuid.c |   18 ++++++++++++++----
 tools/libxl/libxl_uuid.h |    5 +++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/tools/libxl/libxl_uuid.c b/tools/libxl/libxl_uuid.c
index ecc29c7..6591cb7 100644
--- a/tools/libxl/libxl_uuid.c
+++ b/tools/libxl/libxl_uuid.c
@@ -20,7 +20,7 @@
 
 #if defined(__linux__)
 
-int libxl_uuid_is_nil(libxl_uuid *uuid)
+int libxl_uuid_is_nil(const libxl_uuid *uuid)
 {
      return uuid_is_null(uuid->uuid);
 }
@@ -45,11 +45,16 @@ void libxl_uuid_clear(libxl_uuid *uuid)
      uuid_clear(uuid->uuid);
 }
 
-int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2)
+int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2)
 {
      return uuid_compare(uuid1->uuid, uuid2->uuid);
 }
 
+const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid)
+{
+    return uuid->uuid;
+}
+
 uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
 {
     return uuid->uuid;
@@ -57,7 +62,7 @@ uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
 
 #elif defined(__NetBSD__)
 
-int libxl_uuid_is_nil(libxl_uuid *uuid)
+int libxl_uuid_is_nil(const libxl_uuid *uuid)
 {
     uint32_t status;
     return uuid_is_nil((uuid_t *)uuid->uuid, &status);
@@ -92,11 +97,16 @@ void libxl_uuid_clear(libxl_uuid *uuid)
      memset(uuid->uuid, 0, sizeof(uuid->uuid));
 }
 
-int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2)
+int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2)
 {
      return memcmp(uuid1->uuid, uuid2->uuid, sizeof(uuid1->uuid));
 }
 
+const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid)
+{
+    return uuid->uuid;
+}
+
 uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid)
 {
     return uuid->uuid;
diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index 93c65a7..fbde7b6 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -53,12 +53,13 @@ typedef struct {
 
 #endif
 
-int libxl_uuid_is_nil(libxl_uuid *uuid);
+int libxl_uuid_is_nil(const libxl_uuid *uuid);
 void libxl_uuid_generate(libxl_uuid *uuid);
 int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
 void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src);
 void libxl_uuid_clear(libxl_uuid *uuid);
-int libxl_uuid_compare(libxl_uuid *uuid1, libxl_uuid *uuid2);
+int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2);
+const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid);
 uint8_t *libxl_uuid_bytearray(libxl_uuid *uuid);
 
 #endif /* __LIBXL_UUID_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUH9-0002jH-GI; Thu, 19 Jun 2014 04:48:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUH7-0002iy-JE
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:38 +0000
Received: from [85.158.137.68:44352] by server-6.bemta-3.messagelabs.com id
	91/3D-00470-4AB62A35; Thu, 19 Jun 2014 04:48:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403153315!11009506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31973 invoked from network); 19 Jun 2014 04:48:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUH4-0002fl-Qu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUH4-00088j-PI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:34 +0000
Date: Thu, 19 Jun 2014 04:48:34 +0000
Message-Id: <E1WxUH4-00088j-PI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: tidied up code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec0326f41f3efafc2c46c4c881051a3a31649556
Author:     Karim Raslan <karim.allah.ahmed@gmail.com>
AuthorDate: Wed Jun 11 11:30:14 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    mini-os: tidied up code
    
    Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
    [talex5@gmail.com: separated from big ARM commit]
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    [talex5@gmail.com: use __func__ in DEBUG macro]
    [talex5@gmail.com: drop text about "xm create"]
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
---
 extras/mini-os/README                      |    4 +-
 extras/mini-os/arch/x86/time.c             |    2 +-
 extras/mini-os/console/console.c           |    2 +-
 extras/mini-os/events.c                    |    3 +-
 extras/mini-os/gntmap.c                    |   35 ++++++++++++---------------
 extras/mini-os/include/x86/arch_spinlock.h |    2 +-
 extras/mini-os/sched.c                     |    3 ++
 extras/mini-os/xenbus/xenbus.c             |    2 +-
 8 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/extras/mini-os/README b/extras/mini-os/README
index 710a303..7960314 100644
--- a/extras/mini-os/README
+++ b/extras/mini-os/README
@@ -25,8 +25,8 @@ This includes:
 
 - to build it with much better libc support, see the stubdom/ directory
 
-- to start it do the following in domain0 (assuming xend is running)
-  # xm create domain_config
+- to start it do the following in domain0
+  # xl create -c domain_config
 
 This starts the kernel and prints out a bunch of stuff and then once every
 second the system time.
diff --git a/extras/mini-os/arch/x86/time.c b/extras/mini-os/arch/x86/time.c
index 89bc382..2c8d033 100644
--- a/extras/mini-os/arch/x86/time.c
+++ b/extras/mini-os/arch/x86/time.c
@@ -212,7 +212,7 @@ void block_domain(s_time_t until)
 
 
 /*
- * Just a dummy 
+ * Just a dummy
  */
 static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
 {
diff --git a/extras/mini-os/console/console.c b/extras/mini-os/console/console.c
index 380f53c..5538bd4 100644
--- a/extras/mini-os/console/console.c
+++ b/extras/mini-os/console/console.c
@@ -124,7 +124,7 @@ void print(int direct, const char *fmt, va_list args)
     static char   buf[1024];
     
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
- 
+
     if(direct)
     {
         (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index 036b84b..2da9b01 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -138,7 +138,8 @@ evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
 	op.virq = virq;
 	op.vcpu = smp_processor_id();
 
-	if ( (rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op)) != 0 )
+	rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op);
+	if (rc != 0)
 	{
 		printk("Failed to bind virtual IRQ %d with rc=%d\n", virq, rc);
 		return -1;
diff --git a/extras/mini-os/gntmap.c b/extras/mini-os/gntmap.c
index 22ed450..f6ab3ad 100644
--- a/extras/mini-os/gntmap.c
+++ b/extras/mini-os/gntmap.c
@@ -38,6 +38,15 @@
 #include <inttypes.h>
 #include <mini-os/gntmap.h>
 
+//#define GNTMAP_DEBUG
+#ifdef GNTMAP_DEBUG
+#define DEBUG(_f, _a...) \
+    printk("MINI_OS(gntmap.c:%d): %s" _f "\n", __LINE__, __func__, ## _a)
+#else
+#define DEBUG(_f, _a...)    ((void)0)
+#endif
+
+
 #define DEFAULT_MAX_GRANTS 128
 
 struct gntmap_entry {
@@ -61,10 +70,8 @@ gntmap_find_free_entry(struct gntmap *map)
             return &map->entries[i];
     }
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_find_free_entry(map=%p): all %d entries full\n",
+    DEBUG("(map=%p): all %d entries full",
            map, map->nentries);
-#endif
     return NULL;
 }
 
@@ -83,9 +90,7 @@ gntmap_find_entry(struct gntmap *map, unsigned long addr)
 int
 gntmap_set_max_grants(struct gntmap *map, int count)
 {
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_set_max_grants(map=%p, count=%d)\n", map, count);
-#endif
+    DEBUG("(map=%p, count=%d)", map, count);
 
     if (map->nentries != 0)
         return -EBUSY;
@@ -157,10 +162,8 @@ gntmap_munmap(struct gntmap *map, unsigned long start_address, int count)
     int i, rc;
     struct gntmap_entry *ent;
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_munmap(map=%p, start_address=%lx, count=%d)\n",
+    DEBUG("(map=%p, start_address=%lx, count=%d)",
            map, start_address, count);
-#endif
 
     for (i = 0; i < count; i++) {
         ent = gntmap_find_entry(map, start_address + PAGE_SIZE * i);
@@ -189,14 +192,12 @@ gntmap_map_grant_refs(struct gntmap *map,
     struct gntmap_entry *ent;
     int i;
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_map_grant_refs(map=%p, count=%" PRIu32 ", "
+    DEBUG("(map=%p, count=%" PRIu32 ", "
            "domids=%p [%" PRIu32 "...], domids_stride=%d, "
-           "refs=%p [%" PRIu32 "...], writable=%d)\n",
+           "refs=%p [%" PRIu32 "...], writable=%d)",
            map, count,
            domids, domids == NULL ? 0 : domids[0], domids_stride,
            refs, refs == NULL ? 0 : refs[0], writable);
-#endif
 
     (void) gntmap_set_max_grants(map, DEFAULT_MAX_GRANTS);
 
@@ -224,9 +225,7 @@ gntmap_map_grant_refs(struct gntmap *map,
 void
 gntmap_init(struct gntmap *map)
 {
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_init(map=%p)\n", map);
-#endif
+    DEBUG("(map=%p)", map);
     map->nentries = 0;
     map->entries = NULL;
 }
@@ -237,9 +236,7 @@ gntmap_fini(struct gntmap *map)
     struct gntmap_entry *ent;
     int i;
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_fini(map=%p)\n", map);
-#endif
+    DEBUG("(map=%p)", map);
 
     for (i = 0; i < map->nentries; i++) {
         ent = &map->entries[i];
diff --git a/extras/mini-os/include/x86/arch_spinlock.h b/extras/mini-os/include/x86/arch_spinlock.h
index c08b6f1..59f7b63 100644
--- a/extras/mini-os/include/x86/arch_spinlock.h
+++ b/extras/mini-os/include/x86/arch_spinlock.h
@@ -61,7 +61,7 @@
 
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
-	char oldval = 1;
+	char oldval = ARCH_SPIN_LOCK_UNLOCKED;
 	__asm__ __volatile__(
 		spin_unlock_string
 	);
diff --git a/extras/mini-os/sched.c b/extras/mini-os/sched.c
index 5ac5c1c..174945e 100644
--- a/extras/mini-os/sched.c
+++ b/extras/mini-os/sched.c
@@ -85,6 +85,7 @@ void schedule(void)
         printk("Must not call schedule() from a callback\n");
         BUG();
     }
+
     if (flags) {
         printk("Must not call schedule() with IRQs disabled\n");
         BUG();
@@ -188,6 +189,8 @@ struct _reent *__getreent(void)
 	}
     }
 #endif
+#else
+#error Not implemented yet
 #endif
     return _reent;
 }
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index c5d9b02..934f23b 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -276,7 +276,7 @@ static void xenbus_evtchn_handler(evtchn_port_t port, struct pt_regs *regs,
 }
 
 static int nr_live_reqs;
-static spinlock_t req_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(req_lock);
 static DECLARE_WAIT_QUEUE_HEAD(req_wq);
 
 /* Release a xenbus identifier */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:39 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUH9-0002jH-GI; Thu, 19 Jun 2014 04:48:39 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUH7-0002iy-JE
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:38 +0000
Received: from [85.158.137.68:44352] by server-6.bemta-3.messagelabs.com id
	91/3D-00470-4AB62A35; Thu, 19 Jun 2014 04:48:36 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403153315!11009506!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31973 invoked from network); 19 Jun 2014 04:48:35 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUH4-0002fl-Qu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUH4-00088j-PI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:34 +0000
Date: Thu, 19 Jun 2014 04:48:34 +0000
Message-Id: <E1WxUH4-00088j-PI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: tidied up code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ec0326f41f3efafc2c46c4c881051a3a31649556
Author:     Karim Raslan <karim.allah.ahmed@gmail.com>
AuthorDate: Wed Jun 11 11:30:14 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    mini-os: tidied up code
    
    Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
    [talex5@gmail.com: separated from big ARM commit]
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
    [talex5@gmail.com: use __func__ in DEBUG macro]
    [talex5@gmail.com: drop text about "xm create"]
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
---
 extras/mini-os/README                      |    4 +-
 extras/mini-os/arch/x86/time.c             |    2 +-
 extras/mini-os/console/console.c           |    2 +-
 extras/mini-os/events.c                    |    3 +-
 extras/mini-os/gntmap.c                    |   35 ++++++++++++---------------
 extras/mini-os/include/x86/arch_spinlock.h |    2 +-
 extras/mini-os/sched.c                     |    3 ++
 extras/mini-os/xenbus/xenbus.c             |    2 +-
 8 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/extras/mini-os/README b/extras/mini-os/README
index 710a303..7960314 100644
--- a/extras/mini-os/README
+++ b/extras/mini-os/README
@@ -25,8 +25,8 @@ This includes:
 
 - to build it with much better libc support, see the stubdom/ directory
 
-- to start it do the following in domain0 (assuming xend is running)
-  # xm create domain_config
+- to start it do the following in domain0
+  # xl create -c domain_config
 
 This starts the kernel and prints out a bunch of stuff and then once every
 second the system time.
diff --git a/extras/mini-os/arch/x86/time.c b/extras/mini-os/arch/x86/time.c
index 89bc382..2c8d033 100644
--- a/extras/mini-os/arch/x86/time.c
+++ b/extras/mini-os/arch/x86/time.c
@@ -212,7 +212,7 @@ void block_domain(s_time_t until)
 
 
 /*
- * Just a dummy 
+ * Just a dummy
  */
 static void timer_handler(evtchn_port_t ev, struct pt_regs *regs, void *ign)
 {
diff --git a/extras/mini-os/console/console.c b/extras/mini-os/console/console.c
index 380f53c..5538bd4 100644
--- a/extras/mini-os/console/console.c
+++ b/extras/mini-os/console/console.c
@@ -124,7 +124,7 @@ void print(int direct, const char *fmt, va_list args)
     static char   buf[1024];
     
     (void)vsnprintf(buf, sizeof(buf), fmt, args);
- 
+
     if(direct)
     {
         (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(buf), buf);
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index 036b84b..2da9b01 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -138,7 +138,8 @@ evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data)
 	op.virq = virq;
 	op.vcpu = smp_processor_id();
 
-	if ( (rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op)) != 0 )
+	rc = HYPERVISOR_event_channel_op(EVTCHNOP_bind_virq, &op);
+	if (rc != 0)
 	{
 		printk("Failed to bind virtual IRQ %d with rc=%d\n", virq, rc);
 		return -1;
diff --git a/extras/mini-os/gntmap.c b/extras/mini-os/gntmap.c
index 22ed450..f6ab3ad 100644
--- a/extras/mini-os/gntmap.c
+++ b/extras/mini-os/gntmap.c
@@ -38,6 +38,15 @@
 #include <inttypes.h>
 #include <mini-os/gntmap.h>
 
+//#define GNTMAP_DEBUG
+#ifdef GNTMAP_DEBUG
+#define DEBUG(_f, _a...) \
+    printk("MINI_OS(gntmap.c:%d): %s" _f "\n", __LINE__, __func__, ## _a)
+#else
+#define DEBUG(_f, _a...)    ((void)0)
+#endif
+
+
 #define DEFAULT_MAX_GRANTS 128
 
 struct gntmap_entry {
@@ -61,10 +70,8 @@ gntmap_find_free_entry(struct gntmap *map)
             return &map->entries[i];
     }
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_find_free_entry(map=%p): all %d entries full\n",
+    DEBUG("(map=%p): all %d entries full",
            map, map->nentries);
-#endif
     return NULL;
 }
 
@@ -83,9 +90,7 @@ gntmap_find_entry(struct gntmap *map, unsigned long addr)
 int
 gntmap_set_max_grants(struct gntmap *map, int count)
 {
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_set_max_grants(map=%p, count=%d)\n", map, count);
-#endif
+    DEBUG("(map=%p, count=%d)", map, count);
 
     if (map->nentries != 0)
         return -EBUSY;
@@ -157,10 +162,8 @@ gntmap_munmap(struct gntmap *map, unsigned long start_address, int count)
     int i, rc;
     struct gntmap_entry *ent;
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_munmap(map=%p, start_address=%lx, count=%d)\n",
+    DEBUG("(map=%p, start_address=%lx, count=%d)",
            map, start_address, count);
-#endif
 
     for (i = 0; i < count; i++) {
         ent = gntmap_find_entry(map, start_address + PAGE_SIZE * i);
@@ -189,14 +192,12 @@ gntmap_map_grant_refs(struct gntmap *map,
     struct gntmap_entry *ent;
     int i;
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_map_grant_refs(map=%p, count=%" PRIu32 ", "
+    DEBUG("(map=%p, count=%" PRIu32 ", "
            "domids=%p [%" PRIu32 "...], domids_stride=%d, "
-           "refs=%p [%" PRIu32 "...], writable=%d)\n",
+           "refs=%p [%" PRIu32 "...], writable=%d)",
            map, count,
            domids, domids == NULL ? 0 : domids[0], domids_stride,
            refs, refs == NULL ? 0 : refs[0], writable);
-#endif
 
     (void) gntmap_set_max_grants(map, DEFAULT_MAX_GRANTS);
 
@@ -224,9 +225,7 @@ gntmap_map_grant_refs(struct gntmap *map,
 void
 gntmap_init(struct gntmap *map)
 {
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_init(map=%p)\n", map);
-#endif
+    DEBUG("(map=%p)", map);
     map->nentries = 0;
     map->entries = NULL;
 }
@@ -237,9 +236,7 @@ gntmap_fini(struct gntmap *map)
     struct gntmap_entry *ent;
     int i;
 
-#ifdef GNTMAP_DEBUG
-    printk("gntmap_fini(map=%p)\n", map);
-#endif
+    DEBUG("(map=%p)", map);
 
     for (i = 0; i < map->nentries; i++) {
         ent = &map->entries[i];
diff --git a/extras/mini-os/include/x86/arch_spinlock.h b/extras/mini-os/include/x86/arch_spinlock.h
index c08b6f1..59f7b63 100644
--- a/extras/mini-os/include/x86/arch_spinlock.h
+++ b/extras/mini-os/include/x86/arch_spinlock.h
@@ -61,7 +61,7 @@
 
 static inline void _raw_spin_unlock(spinlock_t *lock)
 {
-	char oldval = 1;
+	char oldval = ARCH_SPIN_LOCK_UNLOCKED;
 	__asm__ __volatile__(
 		spin_unlock_string
 	);
diff --git a/extras/mini-os/sched.c b/extras/mini-os/sched.c
index 5ac5c1c..174945e 100644
--- a/extras/mini-os/sched.c
+++ b/extras/mini-os/sched.c
@@ -85,6 +85,7 @@ void schedule(void)
         printk("Must not call schedule() from a callback\n");
         BUG();
     }
+
     if (flags) {
         printk("Must not call schedule() with IRQs disabled\n");
         BUG();
@@ -188,6 +189,8 @@ struct _reent *__getreent(void)
 	}
     }
 #endif
+#else
+#error Not implemented yet
 #endif
     return _reent;
 }
diff --git a/extras/mini-os/xenbus/xenbus.c b/extras/mini-os/xenbus/xenbus.c
index c5d9b02..934f23b 100644
--- a/extras/mini-os/xenbus/xenbus.c
+++ b/extras/mini-os/xenbus/xenbus.c
@@ -276,7 +276,7 @@ static void xenbus_evtchn_handler(evtchn_port_t port, struct pt_regs *regs,
 }
 
 static int nr_live_reqs;
-static spinlock_t req_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(req_lock);
 static DECLARE_WAIT_QUEUE_HEAD(req_wq);
 
 /* Release a xenbus identifier */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHI-0002q2-S4; Thu, 19 Jun 2014 04:48:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHH-0002nQ-RH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:47 +0000
Received: from [85.158.137.68:35321] by server-1.bemta-3.messagelabs.com id
	D2/F2-13056-FAB62A35; Thu, 19 Jun 2014 04:48:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403153325!8568759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14213 invoked from network); 19 Jun 2014 04:48:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHF-0002fr-0j
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHE-000895-Vt
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:44 +0000
Date: Thu, 19 Jun 2014 04:48:44 +0000
Message-Id: <E1WxUHE-000895-Vt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: moved events code under arch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 573e501c6080372bd526be593d444ca3177dfdc3
Author:     Karim Raslan <karim.allah.ahmed@gmail.com>
AuthorDate: Wed Jun 11 11:30:15 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    mini-os: moved events code under arch
    
    This is all code motion, except that we now initialise
    the ev_actions array before calling the arch-specific code
    to make it more robust against future changes.
    
    Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
    [talex5@gmail.com: separated from big ARM commit]
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/events.c |   31 +++++++++++++++++++++++++++++++
 extras/mini-os/events.c          |   24 ++++--------------------
 extras/mini-os/include/events.h  |    3 +++
 3 files changed, 38 insertions(+), 20 deletions(-)

diff --git a/extras/mini-os/arch/x86/events.c b/extras/mini-os/arch/x86/events.c
new file mode 100644
index 0000000..e420a98
--- /dev/null
+++ b/extras/mini-os/arch/x86/events.c
@@ -0,0 +1,31 @@
+#include <mini-os/os.h>
+#include <mini-os/mm.h>
+#include <mini-os/events.h>
+
+#if defined(__x86_64__)
+char irqstack[2 * STACK_SIZE];
+
+static struct pda
+{
+    int irqcount;       /* offset 0 (used in x86_64.S) */
+    char *irqstackptr;  /*        8 */
+} cpu0_pda;
+#endif
+
+void arch_init_events(void)
+{
+#if defined(__x86_64__)
+    asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0));
+    wrmsrl(0xc0000101, &cpu0_pda); /* 0xc0000101 is MSR_GS_BASE */
+    cpu0_pda.irqcount = -1;
+    cpu0_pda.irqstackptr = (void*) (((unsigned long)irqstack + 2 * STACK_SIZE)
+                                    & ~(STACK_SIZE - 1));
+#endif
+}
+
+void arch_fini_events(void)
+{
+#if defined(__x86_64__)
+    wrmsrl(0xc0000101, NULL); /* 0xc0000101 is MSR_GS_BASE */
+#endif
+}
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index 2da9b01..d60630b 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -167,44 +167,28 @@ evtchn_port_t bind_pirq(uint32_t pirq, int will_share,
 	return op.port;
 }
 
-#if defined(__x86_64__)
-char irqstack[2 * STACK_SIZE];
-
-static struct pda
-{
-    int irqcount;       /* offset 0 (used in x86_64.S) */
-    char *irqstackptr;  /*        8 */
-} cpu0_pda;
-#endif
-
 /*
  * Initially all events are without a handler and disabled
  */
 void init_events(void)
 {
     int i;
-#if defined(__x86_64__)
-    asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0));
-    wrmsrl(0xc0000101, &cpu0_pda); /* 0xc0000101 is MSR_GS_BASE */
-    cpu0_pda.irqcount = -1;
-    cpu0_pda.irqstackptr = (void*) (((unsigned long)irqstack + 2 * STACK_SIZE)
-                                    & ~(STACK_SIZE - 1));
-#endif
+
     /* initialize event handler */
     for ( i = 0; i < NR_EVS; i++ )
 	{
         ev_actions[i].handler = default_handler;
         mask_evtchn(i);
     }
+
+    arch_init_events();
 }
 
 void fini_events(void)
 {
     /* Dealloc all events */
     unbind_all_ports();
-#if defined(__x86_64__)
-    wrmsrl(0xc0000101, NULL); /* 0xc0000101 is MSR_GS_BASE */
-#endif
+    arch_fini_events();
 }
 
 void default_handler(evtchn_port_t port, struct pt_regs *regs, void *ignore)
diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h
index 0e9d3a7..0452d21 100644
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -25,6 +25,9 @@
 typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *);
 
 /* prototypes */
+void arch_init_events(void);
+void arch_fini_events(void);
+
 int do_event(evtchn_port_t port, struct pt_regs *regs);
 evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
 evtchn_port_t bind_pirq(uint32_t pirq, int will_share, evtchn_handler_t handler, void *data);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:48 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:48 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHI-0002q2-S4; Thu, 19 Jun 2014 04:48:48 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHH-0002nQ-RH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:47 +0000
Received: from [85.158.137.68:35321] by server-1.bemta-3.messagelabs.com id
	D2/F2-13056-FAB62A35; Thu, 19 Jun 2014 04:48:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403153325!8568759!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14213 invoked from network); 19 Jun 2014 04:48:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:48:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHF-0002fr-0j
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHE-000895-Vt
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:44 +0000
Date: Thu, 19 Jun 2014 04:48:44 +0000
Message-Id: <E1WxUHE-000895-Vt@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: moved events code under arch
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 573e501c6080372bd526be593d444ca3177dfdc3
Author:     Karim Raslan <karim.allah.ahmed@gmail.com>
AuthorDate: Wed Jun 11 11:30:15 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    mini-os: moved events code under arch
    
    This is all code motion, except that we now initialise
    the ev_actions array before calling the arch-specific code
    to make it more robust against future changes.
    
    Signed-off-by: Karim Allah Ahmed <karim.allah.ahmed@gmail.com>
    [talex5@gmail.com: separated from big ARM commit]
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/arch/x86/events.c |   31 +++++++++++++++++++++++++++++++
 extras/mini-os/events.c          |   24 ++++--------------------
 extras/mini-os/include/events.h  |    3 +++
 3 files changed, 38 insertions(+), 20 deletions(-)

diff --git a/extras/mini-os/arch/x86/events.c b/extras/mini-os/arch/x86/events.c
new file mode 100644
index 0000000..e420a98
--- /dev/null
+++ b/extras/mini-os/arch/x86/events.c
@@ -0,0 +1,31 @@
+#include <mini-os/os.h>
+#include <mini-os/mm.h>
+#include <mini-os/events.h>
+
+#if defined(__x86_64__)
+char irqstack[2 * STACK_SIZE];
+
+static struct pda
+{
+    int irqcount;       /* offset 0 (used in x86_64.S) */
+    char *irqstackptr;  /*        8 */
+} cpu0_pda;
+#endif
+
+void arch_init_events(void)
+{
+#if defined(__x86_64__)
+    asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0));
+    wrmsrl(0xc0000101, &cpu0_pda); /* 0xc0000101 is MSR_GS_BASE */
+    cpu0_pda.irqcount = -1;
+    cpu0_pda.irqstackptr = (void*) (((unsigned long)irqstack + 2 * STACK_SIZE)
+                                    & ~(STACK_SIZE - 1));
+#endif
+}
+
+void arch_fini_events(void)
+{
+#if defined(__x86_64__)
+    wrmsrl(0xc0000101, NULL); /* 0xc0000101 is MSR_GS_BASE */
+#endif
+}
diff --git a/extras/mini-os/events.c b/extras/mini-os/events.c
index 2da9b01..d60630b 100644
--- a/extras/mini-os/events.c
+++ b/extras/mini-os/events.c
@@ -167,44 +167,28 @@ evtchn_port_t bind_pirq(uint32_t pirq, int will_share,
 	return op.port;
 }
 
-#if defined(__x86_64__)
-char irqstack[2 * STACK_SIZE];
-
-static struct pda
-{
-    int irqcount;       /* offset 0 (used in x86_64.S) */
-    char *irqstackptr;  /*        8 */
-} cpu0_pda;
-#endif
-
 /*
  * Initially all events are without a handler and disabled
  */
 void init_events(void)
 {
     int i;
-#if defined(__x86_64__)
-    asm volatile("movl %0,%%fs ; movl %0,%%gs" :: "r" (0));
-    wrmsrl(0xc0000101, &cpu0_pda); /* 0xc0000101 is MSR_GS_BASE */
-    cpu0_pda.irqcount = -1;
-    cpu0_pda.irqstackptr = (void*) (((unsigned long)irqstack + 2 * STACK_SIZE)
-                                    & ~(STACK_SIZE - 1));
-#endif
+
     /* initialize event handler */
     for ( i = 0; i < NR_EVS; i++ )
 	{
         ev_actions[i].handler = default_handler;
         mask_evtchn(i);
     }
+
+    arch_init_events();
 }
 
 void fini_events(void)
 {
     /* Dealloc all events */
     unbind_all_ports();
-#if defined(__x86_64__)
-    wrmsrl(0xc0000101, NULL); /* 0xc0000101 is MSR_GS_BASE */
-#endif
+    arch_fini_events();
 }
 
 void default_handler(evtchn_port_t port, struct pt_regs *regs, void *ignore)
diff --git a/extras/mini-os/include/events.h b/extras/mini-os/include/events.h
index 0e9d3a7..0452d21 100644
--- a/extras/mini-os/include/events.h
+++ b/extras/mini-os/include/events.h
@@ -25,6 +25,9 @@
 typedef void (*evtchn_handler_t)(evtchn_port_t, struct pt_regs *, void *);
 
 /* prototypes */
+void arch_init_events(void);
+void arch_fini_events(void);
+
 int do_event(evtchn_port_t port, struct pt_regs *regs);
 evtchn_port_t bind_virq(uint32_t virq, evtchn_handler_t handler, void *data);
 evtchn_port_t bind_pirq(uint32_t pirq, int will_share, evtchn_handler_t handler, void *data);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHS-0002uW-V1; Thu, 19 Jun 2014 04:48:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHR-0002uI-FG
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:57 +0000
Received: from [193.109.254.147:19837] by server-4.bemta-14.messagelabs.com id
	25/28-02781-8BB62A35; Thu, 19 Jun 2014 04:48:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403153335!12232828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23022 invoked from network); 19 Jun 2014 04:48:56 -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;
	19 Jun 2014 04:48:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHP-0002fx-7H
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHP-00089R-5a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:55 +0000
Date: Thu, 19 Jun 2014 04:48:55 +0000
Message-Id: <E1WxUHP-00089R-5a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: don't include queue.h if
	there's no libc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 12a5f2b892ef56bdce7e93f29e2312714c577f2d
Author:     Thomas Leonard <talex5@gmail.com>
AuthorDate: Wed Jun 11 11:30:17 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    mini-os: don't include queue.h if there's no libc
    
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/include/lib.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h
index 935bede..670c14f 100644
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -52,10 +52,10 @@
 #include <stddef.h>
 #include <xen/xen.h>
 #include <xen/event_channel.h>
-#include <sys/queue.h>
 #include "gntmap.h"
 
 #ifdef HAVE_LIBC
+#include <sys/queue.h>
 #include <stdio.h>
 #else
 #include <lib-gpl.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:48:58 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:48:58 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHS-0002uW-V1; Thu, 19 Jun 2014 04:48:58 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHR-0002uI-FG
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:57 +0000
Received: from [193.109.254.147:19837] by server-4.bemta-14.messagelabs.com id
	25/28-02781-8BB62A35; Thu, 19 Jun 2014 04:48:56 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403153335!12232828!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23022 invoked from network); 19 Jun 2014 04:48:56 -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;
	19 Jun 2014 04:48:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHP-0002fx-7H
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHP-00089R-5a
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:48:55 +0000
Date: Thu, 19 Jun 2014 04:48:55 +0000
Message-Id: <E1WxUHP-00089R-5a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mini-os: don't include queue.h if
	there's no libc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 12a5f2b892ef56bdce7e93f29e2312714c577f2d
Author:     Thomas Leonard <talex5@gmail.com>
AuthorDate: Wed Jun 11 11:30:17 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Thu Jun 12 11:01:18 2014 +0100

    mini-os: don't include queue.h if there's no libc
    
    Signed-off-by: Thomas Leonard <talex5@gmail.com>
    Acked-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
---
 extras/mini-os/include/lib.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/extras/mini-os/include/lib.h b/extras/mini-os/include/lib.h
index 935bede..670c14f 100644
--- a/extras/mini-os/include/lib.h
+++ b/extras/mini-os/include/lib.h
@@ -52,10 +52,10 @@
 #include <stddef.h>
 #include <xen/xen.h>
 #include <xen/event_channel.h>
-#include <sys/queue.h>
 #include "gntmap.h"
 
 #ifdef HAVE_LIBC
+#include <sys/queue.h>
 #include <stdio.h>
 #else
 #include <lib-gpl.h>
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHd-0002wA-1O; Thu, 19 Jun 2014 04:49:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHb-0002vv-QZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:08 +0000
Received: from [85.158.139.211:53215] by server-14.bemta-5.messagelabs.com id
	7B/64-27057-3CB62A35; Thu, 19 Jun 2014 04:49:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403153345!10756552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19299 invoked from network); 19 Jun 2014 04:49:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHZ-0002gW-Dr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHZ-00089x-CD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:05 +0000
Date: Thu, 19 Jun 2014 04:49:05 +0000
Message-Id: <E1WxUHZ-00089x-CD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Implement a dummy Performance
	Monitor for ARM32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa0d443718372b46c432af7cb6274050cda32fc6
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Apr 24 23:45:54 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jun 13 12:40:58 2014 +0100

    xen/arm: Implement a dummy Performance Monitor for ARM32
    
    XSA-93 (commit 0b18220 "xen/arm: Don't let guess access to Debug and Performance
    Monitor registers") disable Performance Monitor.
    
    When CONFIG_PERF_EVENTS is enabled in the Linux Kernel, regardless the
    ID_DFR0 (which tell if Perfomance Monitors Extension is implemented) the
    kernel will try to access to PMCR.
    
    Therefore we tell the guest we have 0 counters. Unfortunately we must always
    support PMCCNTR (the cycle counter): we just RAZ/WI for all PM register,
    which doesn't crash the kernel at least.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/traps.c         |   28 ++++++++++++++++++++++++++++
 xen/include/asm-arm/cpregs.h |   17 ++++++++++++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d89b75f..361e620 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1394,6 +1394,34 @@ static void do_cp15_32(struct cpu_user_regs *regs,
         if ( cp32.read )
            *r = v->arch.actlr;
         break;
+
+    /* We could trap ID_DFR0 and tell the guest we don't support
+     * performance monitoring, but Linux doesn't check the ID_DFR0.
+     * Therefore it will read PMCR.
+     *
+     * We tell the guest we have 0 counters. Unfortunately we must
+     * always support PMCCNTR (the cyle counter): we just RAZ/WI for all
+     * PM register, which doesn't crash the kernel at least
+     */
+    case HSR_CPREG32(PMCR):
+    case HSR_CPREG32(PMCNTENSET):
+    case HSR_CPREG32(PMCNTENCLR):
+    case HSR_CPREG32(PMOVSR):
+    case HSR_CPREG32(PMSWINC):
+    case HSR_CPREG32(PMSELR):
+    case HSR_CPREG32(PMCEID0):
+    case HSR_CPREG32(PMCEID1):
+    case HSR_CPREG32(PMCCNTR):
+    case HSR_CPREG32(PMXEVCNTR):
+    case HSR_CPREG32(PMXEVCNR):
+    case HSR_CPREG32(PMUSERENR):
+    case HSR_CPREG32(PMINTENSET):
+    case HSR_CPREG32(PMINTENCLR):
+    case HSR_CPREG32(PMOVSSET):
+        if ( cp32.read )
+            *r = 0;
+        break;
+
     default:
 #ifndef NDEBUG
         gdprintk(XENLOG_ERR,
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index bf8133e..f44e3b5 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -198,7 +198,22 @@
 #define TLBIMVAH        p15,4,c8,c7,1   /* Invalidate Unified Hyp. TLB by MVA */
 #define TLBIALLNSNH     p15,4,c8,c7,4   /* Invalidate Entire Non-Secure Non-Hyp. Unified TLB */
 
-/* CP15 CR9: */
+/* CP15 CR9: Performance monitors */
+#define PMCR            p15,0,c9,c12,0  /* Perf. Mon. Control Register */
+#define PMCNTENSET      p15,0,c9,c12,1  /* Perf. Mon. Count Enable Set register */
+#define PMCNTENCLR      p15,0,c9,c12,2  /* Perf. Mon. Count Enable Clear register */
+#define PMOVSR          p15,0,c9,c12,3  /* Perf. Mon. Overflow Flag Status Register */
+#define PMSWINC         p15,0,c9,c12,4  /* Perf. Mon. Software Increment register */
+#define PMSELR          p15,0,c9,c12,5  /* Perf. Mon. Event Counter Selection Register */
+#define PMCEID0         p15,0,c9,c12,6  /* Perf. Mon. Common Event Identification register 0 */
+#define PMCEID1         p15,0,c9,c12,7  /* Perf. Mon. Common Event Identification register 1 */
+#define PMCCNTR         p15,0,c9,c13,0  /* Perf. Mon. Cycle Count Register */
+#define PMXEVCNTR       p15,0,c9,c13,1  /* Perf. Mon. Event Type Select Register */
+#define PMXEVCNR        p15,0,c9,c13,2  /* Perf. Mon. Event Count Register */
+#define PMUSERENR       p15,0,c9,c14,0  /* Perf. Mon. User Enable Register */
+#define PMINTENSET      p15,0,c9,c14,1  /* Perf. Mon. Interrupt Enable Set Register */
+#define PMINTENCLR      p15,0,c9,c14,2  /* Perf. Mon. Interrupt Enable Clear Register */
+#define PMOVSSET        p15,0,c9,c14,3  /* Perf. Mon. Overflow Flag Status Set register */
 
 /* CP15 CR10: */
 #define MAIR0           p15,0,c10,c2,0  /* Memory Attribute Indirection Register 0 AKA PRRR */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHd-0002wA-1O; Thu, 19 Jun 2014 04:49:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHb-0002vv-QZ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:08 +0000
Received: from [85.158.139.211:53215] by server-14.bemta-5.messagelabs.com id
	7B/64-27057-3CB62A35; Thu, 19 Jun 2014 04:49:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403153345!10756552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19299 invoked from network); 19 Jun 2014 04:49:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHZ-0002gW-Dr
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHZ-00089x-CD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:05 +0000
Date: Thu, 19 Jun 2014 04:49:05 +0000
Message-Id: <E1WxUHZ-00089x-CD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Implement a dummy Performance
	Monitor for ARM32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit aa0d443718372b46c432af7cb6274050cda32fc6
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Apr 24 23:45:54 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jun 13 12:40:58 2014 +0100

    xen/arm: Implement a dummy Performance Monitor for ARM32
    
    XSA-93 (commit 0b18220 "xen/arm: Don't let guess access to Debug and Performance
    Monitor registers") disable Performance Monitor.
    
    When CONFIG_PERF_EVENTS is enabled in the Linux Kernel, regardless the
    ID_DFR0 (which tell if Perfomance Monitors Extension is implemented) the
    kernel will try to access to PMCR.
    
    Therefore we tell the guest we have 0 counters. Unfortunately we must always
    support PMCCNTR (the cycle counter): we just RAZ/WI for all PM register,
    which doesn't crash the kernel at least.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/traps.c         |   28 ++++++++++++++++++++++++++++
 xen/include/asm-arm/cpregs.h |   17 ++++++++++++++++-
 2 files changed, 44 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index d89b75f..361e620 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1394,6 +1394,34 @@ static void do_cp15_32(struct cpu_user_regs *regs,
         if ( cp32.read )
            *r = v->arch.actlr;
         break;
+
+    /* We could trap ID_DFR0 and tell the guest we don't support
+     * performance monitoring, but Linux doesn't check the ID_DFR0.
+     * Therefore it will read PMCR.
+     *
+     * We tell the guest we have 0 counters. Unfortunately we must
+     * always support PMCCNTR (the cyle counter): we just RAZ/WI for all
+     * PM register, which doesn't crash the kernel at least
+     */
+    case HSR_CPREG32(PMCR):
+    case HSR_CPREG32(PMCNTENSET):
+    case HSR_CPREG32(PMCNTENCLR):
+    case HSR_CPREG32(PMOVSR):
+    case HSR_CPREG32(PMSWINC):
+    case HSR_CPREG32(PMSELR):
+    case HSR_CPREG32(PMCEID0):
+    case HSR_CPREG32(PMCEID1):
+    case HSR_CPREG32(PMCCNTR):
+    case HSR_CPREG32(PMXEVCNTR):
+    case HSR_CPREG32(PMXEVCNR):
+    case HSR_CPREG32(PMUSERENR):
+    case HSR_CPREG32(PMINTENSET):
+    case HSR_CPREG32(PMINTENCLR):
+    case HSR_CPREG32(PMOVSSET):
+        if ( cp32.read )
+            *r = 0;
+        break;
+
     default:
 #ifndef NDEBUG
         gdprintk(XENLOG_ERR,
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index bf8133e..f44e3b5 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -198,7 +198,22 @@
 #define TLBIMVAH        p15,4,c8,c7,1   /* Invalidate Unified Hyp. TLB by MVA */
 #define TLBIALLNSNH     p15,4,c8,c7,4   /* Invalidate Entire Non-Secure Non-Hyp. Unified TLB */
 
-/* CP15 CR9: */
+/* CP15 CR9: Performance monitors */
+#define PMCR            p15,0,c9,c12,0  /* Perf. Mon. Control Register */
+#define PMCNTENSET      p15,0,c9,c12,1  /* Perf. Mon. Count Enable Set register */
+#define PMCNTENCLR      p15,0,c9,c12,2  /* Perf. Mon. Count Enable Clear register */
+#define PMOVSR          p15,0,c9,c12,3  /* Perf. Mon. Overflow Flag Status Register */
+#define PMSWINC         p15,0,c9,c12,4  /* Perf. Mon. Software Increment register */
+#define PMSELR          p15,0,c9,c12,5  /* Perf. Mon. Event Counter Selection Register */
+#define PMCEID0         p15,0,c9,c12,6  /* Perf. Mon. Common Event Identification register 0 */
+#define PMCEID1         p15,0,c9,c12,7  /* Perf. Mon. Common Event Identification register 1 */
+#define PMCCNTR         p15,0,c9,c13,0  /* Perf. Mon. Cycle Count Register */
+#define PMXEVCNTR       p15,0,c9,c13,1  /* Perf. Mon. Event Type Select Register */
+#define PMXEVCNR        p15,0,c9,c13,2  /* Perf. Mon. Event Count Register */
+#define PMUSERENR       p15,0,c9,c14,0  /* Perf. Mon. User Enable Register */
+#define PMINTENSET      p15,0,c9,c14,1  /* Perf. Mon. Interrupt Enable Set Register */
+#define PMINTENCLR      p15,0,c9,c14,2  /* Perf. Mon. Interrupt Enable Clear Register */
+#define PMOVSSET        p15,0,c9,c14,3  /* Perf. Mon. Overflow Flag Status Set register */
 
 /* CP15 CR10: */
 #define MAIR0           p15,0,c10,c2,0  /* Memory Attribute Indirection Register 0 AKA PRRR */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHo-0002xb-4E; Thu, 19 Jun 2014 04:49:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHm-0002xM-9D
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:18 +0000
Received: from [85.158.139.211:59575] by server-13.bemta-5.messagelabs.com id
	1B/78-02995-DCB62A35; Thu, 19 Jun 2014 04:49:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403153355!5473072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17347 invoked from network); 19 Jun 2014 04:49:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHj-0002gc-JM
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHj-0008AU-Ho
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:15 +0000
Date: Thu, 19 Jun 2014 04:49:15 +0000
Message-Id: <E1WxUHj-0008AU-Ho@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Implement a dummy debug
	monitor for ARM32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68c69978352adb5ab7c06598056f9eb88d7d6031
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Apr 24 23:45:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jun 13 12:40:59 2014 +0100

    xen/arm: Implement a dummy debug monitor for ARM32
    
    XSA-93 (commit 0b18220 "xen/arm: Don't let guess access to Debug and Performance
    Monitors registers") disable Debug Registers access.
    
    When CONFIG_PERF_EVENTS is enabled in the Linux Kernel, it will try to
    initialize the debug monitors. If an error occured Linux won't use this
    feature.
    
    The implementation made Xen expose a minimal set of registers which let think
    the guest (i.e.) thinks HW debug won't work.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    [ ijc -- s/DBGCR/DBGBCR/ to use correct register name ]
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/traps.c         |   77 ++++++++++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/cpregs.h |   14 ++++++++
 2 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 361e620..333d5c0 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1475,7 +1475,76 @@ static void do_cp15_64(struct cpu_user_regs *regs,
     advance_pc(regs, hsr);
 }
 
-static void do_cp14(struct cpu_user_regs *regs, union hsr hsr)
+static void do_cp14_32(struct cpu_user_regs *regs, union hsr hsr)
+{
+    struct hsr_cp32 cp32 = hsr.cp32;
+    uint32_t *r = (uint32_t *)select_user_reg(regs, cp32.reg);
+    struct domain *d = current->domain;
+
+    if ( !check_conditional_instr(regs, hsr) )
+    {
+        advance_pc(regs, hsr);
+        return;
+    }
+
+    switch ( hsr.bits & HSR_CP32_REGS_MASK )
+    {
+    case HSR_CPREG32(DBGDIDR):
+
+        /* Read-only register */
+        if ( !cp32.read )
+            goto bad_cp;
+
+        /* Implement the minimum requirements:
+         *  - Number of watchpoints: 1
+         *  - Number of breakpoints: 2
+         *  - Version: ARMv7 v7.1
+         *  - Variant and Revision bits match MDIR
+         */
+        *r = (1 << 24) | (5 << 16);
+        *r |= ((d->arch.vpidr >> 20) & 0xf) | (d->arch.vpidr & 0xf);
+        break;
+
+    case HSR_CPREG32(DBGDSCRINT):
+    case HSR_CPREG32(DBGDSCREXT):
+        /* Implement debug status and control register as RAZ/WI.
+         * The OS won't use Hardware debug if MDBGen not set
+         */
+        if ( cp32.read )
+           *r = 0;
+        break;
+    case HSR_CPREG32(DBGVCR):
+    case HSR_CPREG32(DBGOSLAR):
+    case HSR_CPREG32(DBGBVR0):
+    case HSR_CPREG32(DBGBCR0):
+    case HSR_CPREG32(DBGWVR0):
+    case HSR_CPREG32(DBGWCR0):
+    case HSR_CPREG32(DBGBVR1):
+    case HSR_CPREG32(DBGBCR1):
+    case HSR_CPREG32(DBGOSDLR):
+        /* RAZ/WI */
+        if ( cp32.read )
+            *r = 0;
+        break;
+
+    default:
+bad_cp:
+#ifndef NDEBUG
+        gdprintk(XENLOG_ERR,
+                 "%s p14, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
+                  cp32.read ? "mrc" : "mcr",
+                  cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
+        gdprintk(XENLOG_ERR, "unhandled 32-bit cp14 access %#x\n",
+                 hsr.bits & HSR_CP32_REGS_MASK);
+#endif
+        inject_undef32_exception(regs);
+        return;
+    }
+
+    advance_pc(regs, hsr);
+}
+
+static void do_cp14_dbg(struct cpu_user_regs *regs, union hsr hsr)
 {
     if ( !check_conditional_instr(regs, hsr) )
     {
@@ -1727,10 +1796,14 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
         do_cp15_64(regs, hsr);
         break;
     case HSR_EC_CP14_32:
+        if ( !is_32bit_domain(current->domain) )
+            goto bad_trap;
+        do_cp14_32(regs, hsr);
+        break;
     case HSR_EC_CP14_DBG:
         if ( !is_32bit_domain(current->domain) )
             goto bad_trap;
-        do_cp14(regs, hsr);
+        do_cp14_dbg(regs, hsr);
         break;
     case HSR_EC_CP:
         if ( !is_32bit_domain(current->domain) )
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index f44e3b5..f1100c8 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -71,6 +71,20 @@
 
 /* Coprocessor 14 */
 
+/* CP14 0: Debug Register interface */
+#define DBGDIDR         p14,0,c0,c0,0   /* Debug ID Register */
+#define DBGDSCRINT      p14,0,c0,c1,0   /* Debug Status and Control Internal */
+#define DBGDSCREXT      p14,0,c0,c2,2   /* Debug Status and Control External */
+#define DBGVCR          p14,0,c0,c7,0   /* Vector Catch */
+#define DBGBVR0         p14,0,c0,c0,4   /* Breakpoint Value 0 */
+#define DBGBCR0         p14,0,c0,c0,5   /* Breakpoint Control 0 */
+#define DBGWVR0         p14,0,c0,c0,6   /* Watchpoint Value 0 */
+#define DBGWCR0         p14,0,c0,c0,7   /* Watchpoint Control 0 */
+#define DBGBVR1         p14,0,c0,c1,4   /* Breakpoint Value 1 */
+#define DBGBCR1         p14,0,c0,c1,5   /* Breakpoint Control 1 */
+#define DBGOSLAR        p14,0,c1,c0,4   /* OS Lock Access */
+#define DBGOSDLR        p14,0,c1,c3,4   /* OS Double Lock */
+
 /* CP14 CR0: */
 #define TEECR           p14,6,c0,c0,0   /* ThumbEE Configuration Register */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHo-0002xb-4E; Thu, 19 Jun 2014 04:49:20 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHm-0002xM-9D
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:18 +0000
Received: from [85.158.139.211:59575] by server-13.bemta-5.messagelabs.com id
	1B/78-02995-DCB62A35; Thu, 19 Jun 2014 04:49:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403153355!5473072!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17347 invoked from network); 19 Jun 2014 04:49:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHj-0002gc-JM
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHj-0008AU-Ho
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:15 +0000
Date: Thu, 19 Jun 2014 04:49:15 +0000
Message-Id: <E1WxUHj-0008AU-Ho@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Implement a dummy debug
	monitor for ARM32
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68c69978352adb5ab7c06598056f9eb88d7d6031
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Thu Apr 24 23:45:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Fri Jun 13 12:40:59 2014 +0100

    xen/arm: Implement a dummy debug monitor for ARM32
    
    XSA-93 (commit 0b18220 "xen/arm: Don't let guess access to Debug and Performance
    Monitors registers") disable Debug Registers access.
    
    When CONFIG_PERF_EVENTS is enabled in the Linux Kernel, it will try to
    initialize the debug monitors. If an error occured Linux won't use this
    feature.
    
    The implementation made Xen expose a minimal set of registers which let think
    the guest (i.e.) thinks HW debug won't work.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    [ ijc -- s/DBGCR/DBGBCR/ to use correct register name ]
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/traps.c         |   77 ++++++++++++++++++++++++++++++++++++++++-
 xen/include/asm-arm/cpregs.h |   14 ++++++++
 2 files changed, 89 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 361e620..333d5c0 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1475,7 +1475,76 @@ static void do_cp15_64(struct cpu_user_regs *regs,
     advance_pc(regs, hsr);
 }
 
-static void do_cp14(struct cpu_user_regs *regs, union hsr hsr)
+static void do_cp14_32(struct cpu_user_regs *regs, union hsr hsr)
+{
+    struct hsr_cp32 cp32 = hsr.cp32;
+    uint32_t *r = (uint32_t *)select_user_reg(regs, cp32.reg);
+    struct domain *d = current->domain;
+
+    if ( !check_conditional_instr(regs, hsr) )
+    {
+        advance_pc(regs, hsr);
+        return;
+    }
+
+    switch ( hsr.bits & HSR_CP32_REGS_MASK )
+    {
+    case HSR_CPREG32(DBGDIDR):
+
+        /* Read-only register */
+        if ( !cp32.read )
+            goto bad_cp;
+
+        /* Implement the minimum requirements:
+         *  - Number of watchpoints: 1
+         *  - Number of breakpoints: 2
+         *  - Version: ARMv7 v7.1
+         *  - Variant and Revision bits match MDIR
+         */
+        *r = (1 << 24) | (5 << 16);
+        *r |= ((d->arch.vpidr >> 20) & 0xf) | (d->arch.vpidr & 0xf);
+        break;
+
+    case HSR_CPREG32(DBGDSCRINT):
+    case HSR_CPREG32(DBGDSCREXT):
+        /* Implement debug status and control register as RAZ/WI.
+         * The OS won't use Hardware debug if MDBGen not set
+         */
+        if ( cp32.read )
+           *r = 0;
+        break;
+    case HSR_CPREG32(DBGVCR):
+    case HSR_CPREG32(DBGOSLAR):
+    case HSR_CPREG32(DBGBVR0):
+    case HSR_CPREG32(DBGBCR0):
+    case HSR_CPREG32(DBGWVR0):
+    case HSR_CPREG32(DBGWCR0):
+    case HSR_CPREG32(DBGBVR1):
+    case HSR_CPREG32(DBGBCR1):
+    case HSR_CPREG32(DBGOSDLR):
+        /* RAZ/WI */
+        if ( cp32.read )
+            *r = 0;
+        break;
+
+    default:
+bad_cp:
+#ifndef NDEBUG
+        gdprintk(XENLOG_ERR,
+                 "%s p14, %d, r%d, cr%d, cr%d, %d @ 0x%"PRIregister"\n",
+                  cp32.read ? "mrc" : "mcr",
+                  cp32.op1, cp32.reg, cp32.crn, cp32.crm, cp32.op2, regs->pc);
+        gdprintk(XENLOG_ERR, "unhandled 32-bit cp14 access %#x\n",
+                 hsr.bits & HSR_CP32_REGS_MASK);
+#endif
+        inject_undef32_exception(regs);
+        return;
+    }
+
+    advance_pc(regs, hsr);
+}
+
+static void do_cp14_dbg(struct cpu_user_regs *regs, union hsr hsr)
 {
     if ( !check_conditional_instr(regs, hsr) )
     {
@@ -1727,10 +1796,14 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
         do_cp15_64(regs, hsr);
         break;
     case HSR_EC_CP14_32:
+        if ( !is_32bit_domain(current->domain) )
+            goto bad_trap;
+        do_cp14_32(regs, hsr);
+        break;
     case HSR_EC_CP14_DBG:
         if ( !is_32bit_domain(current->domain) )
             goto bad_trap;
-        do_cp14(regs, hsr);
+        do_cp14_dbg(regs, hsr);
         break;
     case HSR_EC_CP:
         if ( !is_32bit_domain(current->domain) )
diff --git a/xen/include/asm-arm/cpregs.h b/xen/include/asm-arm/cpregs.h
index f44e3b5..f1100c8 100644
--- a/xen/include/asm-arm/cpregs.h
+++ b/xen/include/asm-arm/cpregs.h
@@ -71,6 +71,20 @@
 
 /* Coprocessor 14 */
 
+/* CP14 0: Debug Register interface */
+#define DBGDIDR         p14,0,c0,c0,0   /* Debug ID Register */
+#define DBGDSCRINT      p14,0,c0,c1,0   /* Debug Status and Control Internal */
+#define DBGDSCREXT      p14,0,c0,c2,2   /* Debug Status and Control External */
+#define DBGVCR          p14,0,c0,c7,0   /* Vector Catch */
+#define DBGBVR0         p14,0,c0,c0,4   /* Breakpoint Value 0 */
+#define DBGBCR0         p14,0,c0,c0,5   /* Breakpoint Control 0 */
+#define DBGWVR0         p14,0,c0,c0,6   /* Watchpoint Value 0 */
+#define DBGWCR0         p14,0,c0,c0,7   /* Watchpoint Control 0 */
+#define DBGBVR1         p14,0,c0,c1,4   /* Breakpoint Value 1 */
+#define DBGBCR1         p14,0,c0,c1,5   /* Breakpoint Control 1 */
+#define DBGOSLAR        p14,0,c1,c0,4   /* OS Lock Access */
+#define DBGOSDLR        p14,0,c1,c3,4   /* OS Double Lock */
+
 /* CP14 CR0: */
 #define TEECR           p14,6,c0,c0,0   /* ThumbEE Configuration Register */
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHy-0002z4-70; Thu, 19 Jun 2014 04:49:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHw-0002yn-Aq
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:28 +0000
Received: from [85.158.139.211:63954] by server-15.bemta-5.messagelabs.com id
	B0/C7-19516-7DB62A35; Thu, 19 Jun 2014 04:49:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403153366!10786335!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2801 invoked from network); 19 Jun 2014 04:49:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHt-0002gi-Ta
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHt-0008BZ-OV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:25 +0000
Date: Thu, 19 Jun 2014 04:49:25 +0000
Message-Id: <E1WxUHt-0008BZ-OV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: properly set default of
	discard_enable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 364c9ee0076d66498c1ae2b2c65833cbe433ceba
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Jun 17 10:44:40 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 17 10:08:57 2014 +0100

    libxl: properly set default of discard_enable
    
    Initialze discard_enable properly. This avoids a crash if a
    libxl_device_disk with an uninitialized discard_enable is passed to
    device_disk_add. Up to now only xl initialized discard_enable in its
    config parser. External users of libxl, such as libvirt, do not need to
    provide a default value.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c       |    2 ++
 tools/libxl/libxlu_disk.c |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4b66afc..9054c3b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2025,6 +2025,8 @@ int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
     int rc;
 
+    libxl_defbool_setdefault(&disk->discard_enable, !!disk->readwrite);
+
     rc = libxl__resolve_domid(gc, disk->backend_domname, &disk->backend_domid);
     if (rc < 0) return rc;
 
diff --git a/tools/libxl/libxlu_disk.c b/tools/libxl/libxlu_disk.c
index 752a2c7..18fe386 100644
--- a/tools/libxl/libxlu_disk.c
+++ b/tools/libxl/libxlu_disk.c
@@ -79,7 +79,6 @@ int xlu_disk_parse(XLU_Config *cfg,
         if (!disk->pdev_path || !strcmp(disk->pdev_path, ""))
             disk->format = LIBXL_DISK_FORMAT_EMPTY;
     }
-    libxl_defbool_setdefault(&disk->discard_enable, !!disk->readwrite);
 
     if (!disk->vdev) {
         xlu__disk_err(&dpc,0, "no vdev specified");
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUHy-0002z4-70; Thu, 19 Jun 2014 04:49:30 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHw-0002yn-Aq
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:28 +0000
Received: from [85.158.139.211:63954] by server-15.bemta-5.messagelabs.com id
	B0/C7-19516-7DB62A35; Thu, 19 Jun 2014 04:49:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403153366!10786335!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2801 invoked from network); 19 Jun 2014 04:49:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHt-0002gi-Ta
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUHt-0008BZ-OV
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:25 +0000
Date: Thu, 19 Jun 2014 04:49:25 +0000
Message-Id: <E1WxUHt-0008BZ-OV@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: properly set default of
	discard_enable
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 364c9ee0076d66498c1ae2b2c65833cbe433ceba
Author:     Olaf Hering <olaf@aepfle.de>
AuthorDate: Tue Jun 17 10:44:40 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 17 10:08:57 2014 +0100

    libxl: properly set default of discard_enable
    
    Initialze discard_enable properly. This avoids a crash if a
    libxl_device_disk with an uninitialized discard_enable is passed to
    device_disk_add. Up to now only xl initialized discard_enable in its
    config parser. External users of libxl, such as libvirt, do not need to
    provide a default value.
    
    Signed-off-by: Olaf Hering <olaf@aepfle.de>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c       |    2 ++
 tools/libxl/libxlu_disk.c |    1 -
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 4b66afc..9054c3b 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2025,6 +2025,8 @@ int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
     int rc;
 
+    libxl_defbool_setdefault(&disk->discard_enable, !!disk->readwrite);
+
     rc = libxl__resolve_domid(gc, disk->backend_domname, &disk->backend_domid);
     if (rc < 0) return rc;
 
diff --git a/tools/libxl/libxlu_disk.c b/tools/libxl/libxlu_disk.c
index 752a2c7..18fe386 100644
--- a/tools/libxl/libxlu_disk.c
+++ b/tools/libxl/libxlu_disk.c
@@ -79,7 +79,6 @@ int xlu_disk_parse(XLU_Config *cfg,
         if (!disk->pdev_path || !strcmp(disk->pdev_path, ""))
             disk->format = LIBXL_DISK_FORMAT_EMPTY;
     }
-    libxl_defbool_setdefault(&disk->discard_enable, !!disk->readwrite);
 
     if (!disk->vdev) {
         xlu__disk_err(&dpc,0, "no vdev specified");
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIA-00031d-Ah; Thu, 19 Jun 2014 04:49:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUI9-00031V-Ev
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:41 +0000
Received: from [85.158.139.211:60360] by server-4.bemta-5.messagelabs.com id
	2C/17-07250-4EB62A35; Thu, 19 Jun 2014 04:49:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1403153376!10762721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21393 invoked from network); 19 Jun 2014 04:49:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUI4-0002go-IB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUI4-0008D2-GD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:36 +0000
Date: Thu, 19 Jun 2014 04:49:36 +0000
Message-Id: <E1WxUI4-0008D2-GD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pt-irq fixes and improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 568da4f8c43d2e5b614964c6aefd768de3e3af14
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jun 16 11:50:44 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:50:44 2014 +0200

    pt-irq fixes and improvements
    
    Tools side:
    - don't silently ignore unrecognized PT_IRQ_TYPE_* values
    - respect that the interface type contains a union, making the code at
      once no longer depend on the hypervisor ignoring the bus field of the
      PCI portion of the interface structure)
    
    Hypervisor side:
    - don't ignore the PCI bus number passed in
    - don't store values (gsi, link) calculated from other stored values
    - avoid calling xfree() with a spin lock held where easily possible
    - have pt_irq_destroy_bind() respect the passed in type
    - scope reduction and constification of various variables
    - use switch instead of if/else-if chains
    - formatting
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c               |   38 +++++--
 xen/arch/x86/physdev.c                |    7 +-
 xen/drivers/passthrough/io.c          |  185 ++++++++++++++++++---------------
 xen/drivers/passthrough/vtd/x86/vtd.c |    8 +-
 xen/include/asm-x86/hvm/io.h          |    2 +-
 xen/include/xen/hvm/irq.h             |    4 +-
 6 files changed, 142 insertions(+), 102 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 37ed141..9c8653e 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1702,16 +1702,21 @@ int xc_domain_bind_pt_irq(
     bind->hvm_domid = domid;
     bind->irq_type = irq_type;
     bind->machine_irq = machine_irq;
-    if ( irq_type == PT_IRQ_TYPE_PCI ||
-         irq_type == PT_IRQ_TYPE_MSI_TRANSLATE )
+    switch ( irq_type )
     {
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
         bind->u.pci.bus = bus;
-        bind->u.pci.device = device;    
+        bind->u.pci.device = device;
         bind->u.pci.intx = intx;
-    } 
-    else if ( irq_type == PT_IRQ_TYPE_ISA )
+    case PT_IRQ_TYPE_ISA:
         bind->u.isa.isa_irq = isa_irq;
-    
+        break;
+    default:
+        errno = EINVAL;
+        return -1;
+    }
+
     rc = do_domctl(xch, &domctl);
     return rc;
 }
@@ -1737,11 +1742,22 @@ int xc_domain_unbind_pt_irq(
     bind->hvm_domid = domid;
     bind->irq_type = irq_type;
     bind->machine_irq = machine_irq;
-    bind->u.pci.bus = bus;
-    bind->u.pci.device = device;    
-    bind->u.pci.intx = intx;
-    bind->u.isa.isa_irq = isa_irq;
-    
+    switch ( irq_type )
+    {
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
+        bind->u.pci.bus = bus;
+        bind->u.pci.device = device;
+        bind->u.pci.intx = intx;
+        break;
+    case PT_IRQ_TYPE_ISA:
+        bind->u.isa.isa_irq = isa_irq;
+        break;
+    default:
+        errno = EINVAL;
+        return -1;
+    }
+
     rc = do_domctl(xch, &domctl);
     return rc;
 }
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index f178315..6b3201b 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -37,9 +37,8 @@ static int physdev_hvm_map_pirq(
     switch ( type )
     {
     case MAP_PIRQ_TYPE_GSI: {
-        struct hvm_irq_dpci *hvm_irq_dpci;
-        struct hvm_girq_dpci_mapping *girq;
-        uint32_t machine_gsi = 0;
+        const struct hvm_irq_dpci *hvm_irq_dpci;
+        unsigned int machine_gsi = 0;
 
         if ( *index < 0 || *index >= NR_HVM_IRQS )
         {
@@ -52,6 +51,8 @@ static int physdev_hvm_map_pirq(
         hvm_irq_dpci = domain_get_irq_dpci(d);
         if ( hvm_irq_dpci )
         {
+            const struct hvm_girq_dpci_mapping *girq;
+
             BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_IRQS);
             list_for_each_entry ( girq,
                                   &hvm_irq_dpci->girq[*index],
diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index f64e4ac..a380c9c 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -51,11 +51,8 @@ static int pt_irq_guest_eoi(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
 static void pt_irq_time_out(void *data)
 {
     struct hvm_pirq_dpci *irq_map = data;
-    unsigned int guest_gsi;
-    struct hvm_irq_dpci *dpci = NULL;
-    struct dev_intx_gsi_link *digl;
-    struct hvm_girq_dpci_mapping *girq;
-    uint32_t device, intx;
+    const struct hvm_irq_dpci *dpci;
+    const struct dev_intx_gsi_link *digl;
 
     spin_lock(&irq_map->dom->event_lock);
 
@@ -63,16 +60,16 @@ static void pt_irq_time_out(void *data)
     ASSERT(dpci);
     list_for_each_entry ( digl, &irq_map->digl_list, list )
     {
-        guest_gsi = digl->gsi;
+        unsigned int guest_gsi = hvm_pci_intx_gsi(digl->device, digl->intx);
+        const struct hvm_girq_dpci_mapping *girq;
+
         list_for_each_entry ( girq, &dpci->girq[guest_gsi], list )
         {
             struct pirq *pirq = pirq_info(irq_map->dom, girq->machine_gsi);
 
             pirq_dpci(pirq)->flags |= HVM_IRQ_DPCI_EOI_LATCH;
         }
-        device = digl->device;
-        intx = digl->intx;
-        hvm_pci_intx_deassert(irq_map->dom, device, intx);
+        hvm_pci_intx_deassert(irq_map->dom, digl->device, digl->intx);
     }
 
     pt_pirq_iterate(irq_map->dom, pt_irq_guest_eoi, NULL);
@@ -96,13 +93,9 @@ void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci)
 int pt_irq_create_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
-    struct hvm_irq_dpci *hvm_irq_dpci = NULL;
+    struct hvm_irq_dpci *hvm_irq_dpci;
     struct hvm_pirq_dpci *pirq_dpci;
     struct pirq *info;
-    uint32_t guest_gsi;
-    uint32_t device, intx, link;
-    struct dev_intx_gsi_link *digl;
-    struct hvm_girq_dpci_mapping *girq;
     int rc, pirq = pt_irq_bind->machine_irq;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs )
@@ -113,6 +106,8 @@ int pt_irq_create_bind(
     hvm_irq_dpci = domain_get_irq_dpci(d);
     if ( hvm_irq_dpci == NULL )
     {
+        unsigned int i;
+
         hvm_irq_dpci = xzalloc(struct hvm_irq_dpci);
         if ( hvm_irq_dpci == NULL )
         {
@@ -122,7 +117,7 @@ int pt_irq_create_bind(
         softirq_tasklet_init(
             &hvm_irq_dpci->dirq_tasklet,
             hvm_dirq_assist, (unsigned long)d);
-        for ( int i = 0; i < NR_HVM_IRQS; i++ )
+        for ( i = 0; i < NR_HVM_IRQS; i++ )
             INIT_LIST_HEAD(&hvm_irq_dpci->girq[i]);
 
         d->arch.hvm_domain.irq.dpci = hvm_irq_dpci;
@@ -136,7 +131,9 @@ int pt_irq_create_bind(
     }
     pirq_dpci = pirq_dpci(info);
 
-    if ( pt_irq_bind->irq_type == PT_IRQ_TYPE_MSI )
+    switch ( pt_irq_bind->irq_type )
+    {
+    case PT_IRQ_TYPE_MSI:
     {
         uint8_t dest, dest_mode;
         int dest_vcpu_id;
@@ -169,15 +166,16 @@ int pt_irq_create_bind(
         {
             uint32_t mask = HVM_IRQ_DPCI_MACH_MSI | HVM_IRQ_DPCI_GUEST_MSI;
 
-            if ( (pirq_dpci->flags & mask) != mask)
+            if ( (pirq_dpci->flags & mask) != mask )
             {
-	            spin_unlock(&d->event_lock);
-        	    return -EBUSY;
+                spin_unlock(&d->event_lock);
+                return -EBUSY;
             }
 
-            /* if pirq is already mapped as vmsi, update the guest data/addr */
+            /* If pirq is already mapped as vmsi, update guest data/addr. */
             if ( pirq_dpci->gmsi.gvec != pt_irq_bind->u.msi.gvec ||
-                 pirq_dpci->gmsi.gflags != pt_irq_bind->u.msi.gflags) {
+                 pirq_dpci->gmsi.gflags != pt_irq_bind->u.msi.gflags )
+            {
                 /* Directly clear pending EOIs before enabling new MSI info. */
                 pirq_guest_eoi(info);
 
@@ -185,7 +183,7 @@ int pt_irq_create_bind(
                 pirq_dpci->gmsi.gflags = pt_irq_bind->u.msi.gflags;
             }
         }
-        /* Caculate dest_vcpu_id for MSI-type pirq migration */
+        /* Calculate dest_vcpu_id for MSI-type pirq migration. */
         dest = pirq_dpci->gmsi.gflags & VMSI_DEST_ID_MASK;
         dest_mode = !!(pirq_dpci->gmsi.gflags & VMSI_DM_MASK);
         dest_vcpu_id = hvm_girq_dest_2_vcpu_id(d, dest, dest_mode);
@@ -193,36 +191,37 @@ int pt_irq_create_bind(
         spin_unlock(&d->event_lock);
         if ( dest_vcpu_id >= 0 )
             hvm_migrate_pirqs(d->vcpu[dest_vcpu_id]);
+        break;
     }
-    else
-    {
-        device = pt_irq_bind->u.pci.device;
-        intx = pt_irq_bind->u.pci.intx;
-        guest_gsi = hvm_pci_intx_gsi(device, intx);
-        link = hvm_pci_intx_link(device, intx);
-        hvm_irq_dpci->link_cnt[link]++;
 
-        digl = xmalloc(struct dev_intx_gsi_link);
-        if ( !digl )
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
+    {
+        unsigned int bus = pt_irq_bind->u.pci.bus;
+        unsigned int device = pt_irq_bind->u.pci.device;
+        unsigned int intx = pt_irq_bind->u.pci.intx;
+        unsigned int guest_gsi = hvm_pci_intx_gsi(device, intx);
+        unsigned int link = hvm_pci_intx_link(device, intx);
+        struct dev_intx_gsi_link *digl = xmalloc(struct dev_intx_gsi_link);
+        struct hvm_girq_dpci_mapping *girq =
+            xmalloc(struct hvm_girq_dpci_mapping);
+
+        if ( !digl || !girq )
         {
             spin_unlock(&d->event_lock);
-            return -ENOMEM;
-        }
-
-        girq = xmalloc(struct hvm_girq_dpci_mapping);
-        if ( !girq )
-        {
+            xfree(girq);
             xfree(digl);
-            spin_unlock(&d->event_lock);
             return -ENOMEM;
         }
 
+        hvm_irq_dpci->link_cnt[link]++;
+
+        digl->bus = bus;
         digl->device = device;
         digl->intx = intx;
-        digl->gsi = guest_gsi;
-        digl->link = link;
         list_add_tail(&digl->list, &pirq_dpci->digl_list);
 
+        girq->bus = bus;
         girq->device = device;
         girq->intx = intx;
         girq->machine_gsi = pirq;
@@ -261,12 +260,12 @@ int pt_irq_create_bind(
                     kill_timer(&pirq_dpci->timer);
                 pirq_dpci->dom = NULL;
                 list_del(&girq->list);
-                xfree(girq);
                 list_del(&digl->list);
                 hvm_irq_dpci->link_cnt[link]--;
                 pirq_dpci->flags = 0;
                 pirq_cleanup_check(info, d);
                 spin_unlock(&d->event_lock);
+                xfree(girq);
                 xfree(digl);
                 return rc;
             }
@@ -276,33 +275,51 @@ int pt_irq_create_bind(
 
         if ( iommu_verbose )
             dprintk(XENLOG_G_INFO,
-                    "d%d: bind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
-                    d->domain_id, pirq, guest_gsi, device, intx);
+                    "d%d: bind: m_gsi=%u g_gsi=%u dev=%02x.%02x.%u intx=%u\n",
+                    d->domain_id, pirq, guest_gsi, bus,
+                    PCI_SLOT(device), PCI_FUNC(device), intx);
+        break;
+    }
+
+    default:
+        spin_unlock(&d->event_lock);
+        return -EOPNOTSUPP;
     }
+
     return 0;
 }
 
 int pt_irq_destroy_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
-    struct hvm_irq_dpci *hvm_irq_dpci = NULL;
+    struct hvm_irq_dpci *hvm_irq_dpci;
     struct hvm_pirq_dpci *pirq_dpci;
-    uint32_t machine_gsi, guest_gsi;
-    uint32_t device, intx, link;
+    unsigned int machine_gsi = pt_irq_bind->machine_irq;
+    unsigned int bus = pt_irq_bind->u.pci.bus;
+    unsigned int device = pt_irq_bind->u.pci.device;
+    unsigned int intx = pt_irq_bind->u.pci.intx;
+    unsigned int guest_gsi = hvm_pci_intx_gsi(device, intx);
+    unsigned int link = hvm_pci_intx_link(device, intx);
     struct dev_intx_gsi_link *digl, *tmp;
     struct hvm_girq_dpci_mapping *girq;
     struct pirq *pirq;
 
-    machine_gsi = pt_irq_bind->machine_irq;
-    device = pt_irq_bind->u.pci.device;
-    intx = pt_irq_bind->u.pci.intx;
-    guest_gsi = hvm_pci_intx_gsi(device, intx);
-    link = hvm_pci_intx_link(device, intx);
+    switch ( pt_irq_bind->irq_type )
+    {
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
+        break;
+    case PT_IRQ_TYPE_MSI:
+        return 0;
+    default:
+        return -EOPNOTSUPP;
+    }
 
     if ( iommu_verbose )
         dprintk(XENLOG_G_INFO,
-                "d%d: unbind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
-                d->domain_id, machine_gsi, guest_gsi, device, intx);
+                "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
+                d->domain_id, machine_gsi, guest_gsi, bus,
+                PCI_SLOT(device), PCI_FUNC(device), intx);
 
     spin_lock(&d->event_lock);
 
@@ -314,18 +331,28 @@ int pt_irq_destroy_bind(
         return -EINVAL;
     }
 
-    hvm_irq_dpci->link_cnt[link]--;
-
     list_for_each_entry ( girq, &hvm_irq_dpci->girq[guest_gsi], list )
     {
-        if ( girq->machine_gsi == machine_gsi )
+        if ( girq->bus         == bus &&
+             girq->device      == device &&
+             girq->intx        == intx &&
+             girq->machine_gsi == machine_gsi )
         {
-                list_del(&girq->list);
-                xfree(girq);
-                break;
+            list_del(&girq->list);
+            xfree(girq);
+            girq = NULL;
+            break;
         }
     }
 
+    if ( girq )
+    {
+        spin_unlock(&d->event_lock);
+        return -EINVAL;
+    }
+
+    hvm_irq_dpci->link_cnt[link]--;
+
     pirq = pirq_info(d, machine_gsi);
     pirq_dpci = pirq_dpci(pirq);
 
@@ -334,10 +361,9 @@ int pt_irq_destroy_bind(
     {
         list_for_each_entry_safe ( digl, tmp, &pirq_dpci->digl_list, list )
         {
-            if ( digl->device == device &&
-                 digl->intx   == intx &&
-                 digl->link   == link &&
-                 digl->gsi    == guest_gsi )
+            if ( digl->bus    == bus &&
+                 digl->device == device &&
+                 digl->intx   == intx )
             {
                 list_del(&digl->list);
                 xfree(digl);
@@ -359,8 +385,9 @@ int pt_irq_destroy_bind(
 
     if ( iommu_verbose )
         dprintk(XENLOG_G_INFO,
-                "d%d unmap: m_irq=%u device=%u intx=%u\n",
-                d->domain_id, machine_gsi, device, intx);
+                "d%d unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
+                d->domain_id, machine_gsi, bus,
+                PCI_SLOT(device), PCI_FUNC(device), intx);
 
     return 0;
 }
@@ -481,11 +508,10 @@ static void hvm_pci_msi_assert(
 static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
                             void *arg)
 {
-    uint32_t device, intx;
-    struct dev_intx_gsi_link *digl;
-
     if ( test_and_clear_bool(pirq_dpci->masked) )
     {
+        const struct dev_intx_gsi_link *digl;
+
         if ( pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI )
         {
             hvm_pci_msi_assert(d, pirq_dpci);
@@ -496,12 +522,10 @@ static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
         {
             struct pirq *info = dpci_pirq(pirq_dpci);
 
-            device = digl->device;
-            intx = digl->intx;
             if ( hvm_domain_use_pirq(d, info) )
                 send_guest_pirq(d, info);
             else
-                hvm_pci_intx_assert(d, device, intx);
+                hvm_pci_intx_assert(d, digl->device, digl->intx);
             pirq_dpci->pending++;
 
             if ( pirq_dpci->flags & HVM_IRQ_DPCI_TRANSLATE )
@@ -537,16 +561,13 @@ static void hvm_dirq_assist(unsigned long _d)
 }
 
 static void __hvm_dpci_eoi(struct domain *d,
-                           struct hvm_girq_dpci_mapping *girq,
-                           union vioapic_redir_entry *ent)
+                           const struct hvm_girq_dpci_mapping *girq,
+                           const union vioapic_redir_entry *ent)
 {
-    uint32_t device, intx;
     struct pirq *pirq;
     struct hvm_pirq_dpci *pirq_dpci;
 
-    device = girq->device;
-    intx = girq->intx;
-    hvm_pci_intx_deassert(d, device, intx);
+    hvm_pci_intx_deassert(d, girq->device, girq->intx);
 
     pirq = pirq_info(d, girq->machine_gsi);
     pirq_dpci = pirq_dpci(pirq);
@@ -556,8 +577,8 @@ static void __hvm_dpci_eoi(struct domain *d,
      * since interrupt is still not EOIed
      */
     if ( --pirq_dpci->pending ||
-         ( ent && ent->fields.mask ) ||
-         ! pt_irq_need_timer(pirq_dpci->flags) )
+         (ent && ent->fields.mask) ||
+         !pt_irq_need_timer(pirq_dpci->flags) )
         return;
 
     stop_timer(&pirq_dpci->timer);
@@ -565,10 +586,10 @@ static void __hvm_dpci_eoi(struct domain *d,
 }
 
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi,
-                  union vioapic_redir_entry *ent)
+                  const union vioapic_redir_entry *ent)
 {
-    struct hvm_irq_dpci *hvm_irq_dpci;
-    struct hvm_girq_dpci_mapping *girq;
+    const struct hvm_irq_dpci *hvm_irq_dpci;
+    const struct hvm_girq_dpci_mapping *girq;
 
     if ( !iommu_enabled )
         return;
diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c
index 9a458eb..109234e 100644
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -69,11 +69,13 @@ static int _hvm_dpci_isairq_eoi(struct domain *d,
 {
     struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
     unsigned int isairq = (long)arg;
-    struct dev_intx_gsi_link *digl, *tmp;
+    const struct dev_intx_gsi_link *digl;
 
-    list_for_each_entry_safe ( digl, tmp, &pirq_dpci->digl_list, list )
+    list_for_each_entry ( digl, &pirq_dpci->digl_list, list )
     {
-        if ( hvm_irq->pci_link.route[digl->link] == isairq )
+        unsigned int link = hvm_pci_intx_link(digl->device, digl->intx);
+
+        if ( hvm_irq->pci_link.route[link] == isairq )
         {
             hvm_pci_intx_deassert(d, digl->device, digl->intx);
             if ( --pirq_dpci->pending == 0 )
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 86db58d..8228ab8 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -123,7 +123,7 @@ int handle_pio(uint16_t port, unsigned int size, int dir);
 void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(ioreq_t *p);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
-                  union vioapic_redir_entry *ent);
+                  const union vioapic_redir_entry *ent);
 void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
diff --git a/xen/include/xen/hvm/irq.h b/xen/include/xen/hvm/irq.h
index a8710df..c89f4b1 100644
--- a/xen/include/xen/hvm/irq.h
+++ b/xen/include/xen/hvm/irq.h
@@ -30,10 +30,9 @@
 
 struct dev_intx_gsi_link {
     struct list_head list;
+    uint8_t bus;
     uint8_t device;
     uint8_t intx;
-    uint8_t gsi;
-    uint8_t link;
 };
 
 #define _HVM_IRQ_DPCI_MACH_PCI_SHIFT            0
@@ -69,6 +68,7 @@ struct hvm_gmsi_info {
 
 struct hvm_girq_dpci_mapping {
     struct list_head list;
+    uint8_t bus;
     uint8_t device;
     uint8_t intx;
     uint8_t machine_gsi;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIA-00031d-Ah; Thu, 19 Jun 2014 04:49:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUI9-00031V-Ev
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:41 +0000
Received: from [85.158.139.211:60360] by server-4.bemta-5.messagelabs.com id
	2C/17-07250-4EB62A35; Thu, 19 Jun 2014 04:49:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1403153376!10762721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21393 invoked from network); 19 Jun 2014 04:49:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUI4-0002go-IB
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUI4-0008D2-GD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:36 +0000
Date: Thu, 19 Jun 2014 04:49:36 +0000
Message-Id: <E1WxUI4-0008D2-GD@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] pt-irq fixes and improvements
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 568da4f8c43d2e5b614964c6aefd768de3e3af14
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jun 16 11:50:44 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:50:44 2014 +0200

    pt-irq fixes and improvements
    
    Tools side:
    - don't silently ignore unrecognized PT_IRQ_TYPE_* values
    - respect that the interface type contains a union, making the code at
      once no longer depend on the hypervisor ignoring the bus field of the
      PCI portion of the interface structure)
    
    Hypervisor side:
    - don't ignore the PCI bus number passed in
    - don't store values (gsi, link) calculated from other stored values
    - avoid calling xfree() with a spin lock held where easily possible
    - have pt_irq_destroy_bind() respect the passed in type
    - scope reduction and constification of various variables
    - use switch instead of if/else-if chains
    - formatting
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c               |   38 +++++--
 xen/arch/x86/physdev.c                |    7 +-
 xen/drivers/passthrough/io.c          |  185 ++++++++++++++++++---------------
 xen/drivers/passthrough/vtd/x86/vtd.c |    8 +-
 xen/include/asm-x86/hvm/io.h          |    2 +-
 xen/include/xen/hvm/irq.h             |    4 +-
 6 files changed, 142 insertions(+), 102 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 37ed141..9c8653e 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1702,16 +1702,21 @@ int xc_domain_bind_pt_irq(
     bind->hvm_domid = domid;
     bind->irq_type = irq_type;
     bind->machine_irq = machine_irq;
-    if ( irq_type == PT_IRQ_TYPE_PCI ||
-         irq_type == PT_IRQ_TYPE_MSI_TRANSLATE )
+    switch ( irq_type )
     {
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
         bind->u.pci.bus = bus;
-        bind->u.pci.device = device;    
+        bind->u.pci.device = device;
         bind->u.pci.intx = intx;
-    } 
-    else if ( irq_type == PT_IRQ_TYPE_ISA )
+    case PT_IRQ_TYPE_ISA:
         bind->u.isa.isa_irq = isa_irq;
-    
+        break;
+    default:
+        errno = EINVAL;
+        return -1;
+    }
+
     rc = do_domctl(xch, &domctl);
     return rc;
 }
@@ -1737,11 +1742,22 @@ int xc_domain_unbind_pt_irq(
     bind->hvm_domid = domid;
     bind->irq_type = irq_type;
     bind->machine_irq = machine_irq;
-    bind->u.pci.bus = bus;
-    bind->u.pci.device = device;    
-    bind->u.pci.intx = intx;
-    bind->u.isa.isa_irq = isa_irq;
-    
+    switch ( irq_type )
+    {
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
+        bind->u.pci.bus = bus;
+        bind->u.pci.device = device;
+        bind->u.pci.intx = intx;
+        break;
+    case PT_IRQ_TYPE_ISA:
+        bind->u.isa.isa_irq = isa_irq;
+        break;
+    default:
+        errno = EINVAL;
+        return -1;
+    }
+
     rc = do_domctl(xch, &domctl);
     return rc;
 }
diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c
index f178315..6b3201b 100644
--- a/xen/arch/x86/physdev.c
+++ b/xen/arch/x86/physdev.c
@@ -37,9 +37,8 @@ static int physdev_hvm_map_pirq(
     switch ( type )
     {
     case MAP_PIRQ_TYPE_GSI: {
-        struct hvm_irq_dpci *hvm_irq_dpci;
-        struct hvm_girq_dpci_mapping *girq;
-        uint32_t machine_gsi = 0;
+        const struct hvm_irq_dpci *hvm_irq_dpci;
+        unsigned int machine_gsi = 0;
 
         if ( *index < 0 || *index >= NR_HVM_IRQS )
         {
@@ -52,6 +51,8 @@ static int physdev_hvm_map_pirq(
         hvm_irq_dpci = domain_get_irq_dpci(d);
         if ( hvm_irq_dpci )
         {
+            const struct hvm_girq_dpci_mapping *girq;
+
             BUILD_BUG_ON(ARRAY_SIZE(hvm_irq_dpci->girq) < NR_HVM_IRQS);
             list_for_each_entry ( girq,
                                   &hvm_irq_dpci->girq[*index],
diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c
index f64e4ac..a380c9c 100644
--- a/xen/drivers/passthrough/io.c
+++ b/xen/drivers/passthrough/io.c
@@ -51,11 +51,8 @@ static int pt_irq_guest_eoi(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
 static void pt_irq_time_out(void *data)
 {
     struct hvm_pirq_dpci *irq_map = data;
-    unsigned int guest_gsi;
-    struct hvm_irq_dpci *dpci = NULL;
-    struct dev_intx_gsi_link *digl;
-    struct hvm_girq_dpci_mapping *girq;
-    uint32_t device, intx;
+    const struct hvm_irq_dpci *dpci;
+    const struct dev_intx_gsi_link *digl;
 
     spin_lock(&irq_map->dom->event_lock);
 
@@ -63,16 +60,16 @@ static void pt_irq_time_out(void *data)
     ASSERT(dpci);
     list_for_each_entry ( digl, &irq_map->digl_list, list )
     {
-        guest_gsi = digl->gsi;
+        unsigned int guest_gsi = hvm_pci_intx_gsi(digl->device, digl->intx);
+        const struct hvm_girq_dpci_mapping *girq;
+
         list_for_each_entry ( girq, &dpci->girq[guest_gsi], list )
         {
             struct pirq *pirq = pirq_info(irq_map->dom, girq->machine_gsi);
 
             pirq_dpci(pirq)->flags |= HVM_IRQ_DPCI_EOI_LATCH;
         }
-        device = digl->device;
-        intx = digl->intx;
-        hvm_pci_intx_deassert(irq_map->dom, device, intx);
+        hvm_pci_intx_deassert(irq_map->dom, digl->device, digl->intx);
     }
 
     pt_pirq_iterate(irq_map->dom, pt_irq_guest_eoi, NULL);
@@ -96,13 +93,9 @@ void free_hvm_irq_dpci(struct hvm_irq_dpci *dpci)
 int pt_irq_create_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
-    struct hvm_irq_dpci *hvm_irq_dpci = NULL;
+    struct hvm_irq_dpci *hvm_irq_dpci;
     struct hvm_pirq_dpci *pirq_dpci;
     struct pirq *info;
-    uint32_t guest_gsi;
-    uint32_t device, intx, link;
-    struct dev_intx_gsi_link *digl;
-    struct hvm_girq_dpci_mapping *girq;
     int rc, pirq = pt_irq_bind->machine_irq;
 
     if ( pirq < 0 || pirq >= d->nr_pirqs )
@@ -113,6 +106,8 @@ int pt_irq_create_bind(
     hvm_irq_dpci = domain_get_irq_dpci(d);
     if ( hvm_irq_dpci == NULL )
     {
+        unsigned int i;
+
         hvm_irq_dpci = xzalloc(struct hvm_irq_dpci);
         if ( hvm_irq_dpci == NULL )
         {
@@ -122,7 +117,7 @@ int pt_irq_create_bind(
         softirq_tasklet_init(
             &hvm_irq_dpci->dirq_tasklet,
             hvm_dirq_assist, (unsigned long)d);
-        for ( int i = 0; i < NR_HVM_IRQS; i++ )
+        for ( i = 0; i < NR_HVM_IRQS; i++ )
             INIT_LIST_HEAD(&hvm_irq_dpci->girq[i]);
 
         d->arch.hvm_domain.irq.dpci = hvm_irq_dpci;
@@ -136,7 +131,9 @@ int pt_irq_create_bind(
     }
     pirq_dpci = pirq_dpci(info);
 
-    if ( pt_irq_bind->irq_type == PT_IRQ_TYPE_MSI )
+    switch ( pt_irq_bind->irq_type )
+    {
+    case PT_IRQ_TYPE_MSI:
     {
         uint8_t dest, dest_mode;
         int dest_vcpu_id;
@@ -169,15 +166,16 @@ int pt_irq_create_bind(
         {
             uint32_t mask = HVM_IRQ_DPCI_MACH_MSI | HVM_IRQ_DPCI_GUEST_MSI;
 
-            if ( (pirq_dpci->flags & mask) != mask)
+            if ( (pirq_dpci->flags & mask) != mask )
             {
-	            spin_unlock(&d->event_lock);
-        	    return -EBUSY;
+                spin_unlock(&d->event_lock);
+                return -EBUSY;
             }
 
-            /* if pirq is already mapped as vmsi, update the guest data/addr */
+            /* If pirq is already mapped as vmsi, update guest data/addr. */
             if ( pirq_dpci->gmsi.gvec != pt_irq_bind->u.msi.gvec ||
-                 pirq_dpci->gmsi.gflags != pt_irq_bind->u.msi.gflags) {
+                 pirq_dpci->gmsi.gflags != pt_irq_bind->u.msi.gflags )
+            {
                 /* Directly clear pending EOIs before enabling new MSI info. */
                 pirq_guest_eoi(info);
 
@@ -185,7 +183,7 @@ int pt_irq_create_bind(
                 pirq_dpci->gmsi.gflags = pt_irq_bind->u.msi.gflags;
             }
         }
-        /* Caculate dest_vcpu_id for MSI-type pirq migration */
+        /* Calculate dest_vcpu_id for MSI-type pirq migration. */
         dest = pirq_dpci->gmsi.gflags & VMSI_DEST_ID_MASK;
         dest_mode = !!(pirq_dpci->gmsi.gflags & VMSI_DM_MASK);
         dest_vcpu_id = hvm_girq_dest_2_vcpu_id(d, dest, dest_mode);
@@ -193,36 +191,37 @@ int pt_irq_create_bind(
         spin_unlock(&d->event_lock);
         if ( dest_vcpu_id >= 0 )
             hvm_migrate_pirqs(d->vcpu[dest_vcpu_id]);
+        break;
     }
-    else
-    {
-        device = pt_irq_bind->u.pci.device;
-        intx = pt_irq_bind->u.pci.intx;
-        guest_gsi = hvm_pci_intx_gsi(device, intx);
-        link = hvm_pci_intx_link(device, intx);
-        hvm_irq_dpci->link_cnt[link]++;
 
-        digl = xmalloc(struct dev_intx_gsi_link);
-        if ( !digl )
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
+    {
+        unsigned int bus = pt_irq_bind->u.pci.bus;
+        unsigned int device = pt_irq_bind->u.pci.device;
+        unsigned int intx = pt_irq_bind->u.pci.intx;
+        unsigned int guest_gsi = hvm_pci_intx_gsi(device, intx);
+        unsigned int link = hvm_pci_intx_link(device, intx);
+        struct dev_intx_gsi_link *digl = xmalloc(struct dev_intx_gsi_link);
+        struct hvm_girq_dpci_mapping *girq =
+            xmalloc(struct hvm_girq_dpci_mapping);
+
+        if ( !digl || !girq )
         {
             spin_unlock(&d->event_lock);
-            return -ENOMEM;
-        }
-
-        girq = xmalloc(struct hvm_girq_dpci_mapping);
-        if ( !girq )
-        {
+            xfree(girq);
             xfree(digl);
-            spin_unlock(&d->event_lock);
             return -ENOMEM;
         }
 
+        hvm_irq_dpci->link_cnt[link]++;
+
+        digl->bus = bus;
         digl->device = device;
         digl->intx = intx;
-        digl->gsi = guest_gsi;
-        digl->link = link;
         list_add_tail(&digl->list, &pirq_dpci->digl_list);
 
+        girq->bus = bus;
         girq->device = device;
         girq->intx = intx;
         girq->machine_gsi = pirq;
@@ -261,12 +260,12 @@ int pt_irq_create_bind(
                     kill_timer(&pirq_dpci->timer);
                 pirq_dpci->dom = NULL;
                 list_del(&girq->list);
-                xfree(girq);
                 list_del(&digl->list);
                 hvm_irq_dpci->link_cnt[link]--;
                 pirq_dpci->flags = 0;
                 pirq_cleanup_check(info, d);
                 spin_unlock(&d->event_lock);
+                xfree(girq);
                 xfree(digl);
                 return rc;
             }
@@ -276,33 +275,51 @@ int pt_irq_create_bind(
 
         if ( iommu_verbose )
             dprintk(XENLOG_G_INFO,
-                    "d%d: bind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
-                    d->domain_id, pirq, guest_gsi, device, intx);
+                    "d%d: bind: m_gsi=%u g_gsi=%u dev=%02x.%02x.%u intx=%u\n",
+                    d->domain_id, pirq, guest_gsi, bus,
+                    PCI_SLOT(device), PCI_FUNC(device), intx);
+        break;
+    }
+
+    default:
+        spin_unlock(&d->event_lock);
+        return -EOPNOTSUPP;
     }
+
     return 0;
 }
 
 int pt_irq_destroy_bind(
     struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
 {
-    struct hvm_irq_dpci *hvm_irq_dpci = NULL;
+    struct hvm_irq_dpci *hvm_irq_dpci;
     struct hvm_pirq_dpci *pirq_dpci;
-    uint32_t machine_gsi, guest_gsi;
-    uint32_t device, intx, link;
+    unsigned int machine_gsi = pt_irq_bind->machine_irq;
+    unsigned int bus = pt_irq_bind->u.pci.bus;
+    unsigned int device = pt_irq_bind->u.pci.device;
+    unsigned int intx = pt_irq_bind->u.pci.intx;
+    unsigned int guest_gsi = hvm_pci_intx_gsi(device, intx);
+    unsigned int link = hvm_pci_intx_link(device, intx);
     struct dev_intx_gsi_link *digl, *tmp;
     struct hvm_girq_dpci_mapping *girq;
     struct pirq *pirq;
 
-    machine_gsi = pt_irq_bind->machine_irq;
-    device = pt_irq_bind->u.pci.device;
-    intx = pt_irq_bind->u.pci.intx;
-    guest_gsi = hvm_pci_intx_gsi(device, intx);
-    link = hvm_pci_intx_link(device, intx);
+    switch ( pt_irq_bind->irq_type )
+    {
+    case PT_IRQ_TYPE_PCI:
+    case PT_IRQ_TYPE_MSI_TRANSLATE:
+        break;
+    case PT_IRQ_TYPE_MSI:
+        return 0;
+    default:
+        return -EOPNOTSUPP;
+    }
 
     if ( iommu_verbose )
         dprintk(XENLOG_G_INFO,
-                "d%d: unbind: m_gsi=%u g_gsi=%u device=%u intx=%u\n",
-                d->domain_id, machine_gsi, guest_gsi, device, intx);
+                "d%d: unbind: m_gsi=%u g_gsi=%u dev=%02x:%02x.%u intx=%u\n",
+                d->domain_id, machine_gsi, guest_gsi, bus,
+                PCI_SLOT(device), PCI_FUNC(device), intx);
 
     spin_lock(&d->event_lock);
 
@@ -314,18 +331,28 @@ int pt_irq_destroy_bind(
         return -EINVAL;
     }
 
-    hvm_irq_dpci->link_cnt[link]--;
-
     list_for_each_entry ( girq, &hvm_irq_dpci->girq[guest_gsi], list )
     {
-        if ( girq->machine_gsi == machine_gsi )
+        if ( girq->bus         == bus &&
+             girq->device      == device &&
+             girq->intx        == intx &&
+             girq->machine_gsi == machine_gsi )
         {
-                list_del(&girq->list);
-                xfree(girq);
-                break;
+            list_del(&girq->list);
+            xfree(girq);
+            girq = NULL;
+            break;
         }
     }
 
+    if ( girq )
+    {
+        spin_unlock(&d->event_lock);
+        return -EINVAL;
+    }
+
+    hvm_irq_dpci->link_cnt[link]--;
+
     pirq = pirq_info(d, machine_gsi);
     pirq_dpci = pirq_dpci(pirq);
 
@@ -334,10 +361,9 @@ int pt_irq_destroy_bind(
     {
         list_for_each_entry_safe ( digl, tmp, &pirq_dpci->digl_list, list )
         {
-            if ( digl->device == device &&
-                 digl->intx   == intx &&
-                 digl->link   == link &&
-                 digl->gsi    == guest_gsi )
+            if ( digl->bus    == bus &&
+                 digl->device == device &&
+                 digl->intx   == intx )
             {
                 list_del(&digl->list);
                 xfree(digl);
@@ -359,8 +385,9 @@ int pt_irq_destroy_bind(
 
     if ( iommu_verbose )
         dprintk(XENLOG_G_INFO,
-                "d%d unmap: m_irq=%u device=%u intx=%u\n",
-                d->domain_id, machine_gsi, device, intx);
+                "d%d unmap: m_irq=%u dev=%02x:%02x.%u intx=%u\n",
+                d->domain_id, machine_gsi, bus,
+                PCI_SLOT(device), PCI_FUNC(device), intx);
 
     return 0;
 }
@@ -481,11 +508,10 @@ static void hvm_pci_msi_assert(
 static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
                             void *arg)
 {
-    uint32_t device, intx;
-    struct dev_intx_gsi_link *digl;
-
     if ( test_and_clear_bool(pirq_dpci->masked) )
     {
+        const struct dev_intx_gsi_link *digl;
+
         if ( pirq_dpci->flags & HVM_IRQ_DPCI_GUEST_MSI )
         {
             hvm_pci_msi_assert(d, pirq_dpci);
@@ -496,12 +522,10 @@ static int _hvm_dirq_assist(struct domain *d, struct hvm_pirq_dpci *pirq_dpci,
         {
             struct pirq *info = dpci_pirq(pirq_dpci);
 
-            device = digl->device;
-            intx = digl->intx;
             if ( hvm_domain_use_pirq(d, info) )
                 send_guest_pirq(d, info);
             else
-                hvm_pci_intx_assert(d, device, intx);
+                hvm_pci_intx_assert(d, digl->device, digl->intx);
             pirq_dpci->pending++;
 
             if ( pirq_dpci->flags & HVM_IRQ_DPCI_TRANSLATE )
@@ -537,16 +561,13 @@ static void hvm_dirq_assist(unsigned long _d)
 }
 
 static void __hvm_dpci_eoi(struct domain *d,
-                           struct hvm_girq_dpci_mapping *girq,
-                           union vioapic_redir_entry *ent)
+                           const struct hvm_girq_dpci_mapping *girq,
+                           const union vioapic_redir_entry *ent)
 {
-    uint32_t device, intx;
     struct pirq *pirq;
     struct hvm_pirq_dpci *pirq_dpci;
 
-    device = girq->device;
-    intx = girq->intx;
-    hvm_pci_intx_deassert(d, device, intx);
+    hvm_pci_intx_deassert(d, girq->device, girq->intx);
 
     pirq = pirq_info(d, girq->machine_gsi);
     pirq_dpci = pirq_dpci(pirq);
@@ -556,8 +577,8 @@ static void __hvm_dpci_eoi(struct domain *d,
      * since interrupt is still not EOIed
      */
     if ( --pirq_dpci->pending ||
-         ( ent && ent->fields.mask ) ||
-         ! pt_irq_need_timer(pirq_dpci->flags) )
+         (ent && ent->fields.mask) ||
+         !pt_irq_need_timer(pirq_dpci->flags) )
         return;
 
     stop_timer(&pirq_dpci->timer);
@@ -565,10 +586,10 @@ static void __hvm_dpci_eoi(struct domain *d,
 }
 
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi,
-                  union vioapic_redir_entry *ent)
+                  const union vioapic_redir_entry *ent)
 {
-    struct hvm_irq_dpci *hvm_irq_dpci;
-    struct hvm_girq_dpci_mapping *girq;
+    const struct hvm_irq_dpci *hvm_irq_dpci;
+    const struct hvm_girq_dpci_mapping *girq;
 
     if ( !iommu_enabled )
         return;
diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c
index 9a458eb..109234e 100644
--- a/xen/drivers/passthrough/vtd/x86/vtd.c
+++ b/xen/drivers/passthrough/vtd/x86/vtd.c
@@ -69,11 +69,13 @@ static int _hvm_dpci_isairq_eoi(struct domain *d,
 {
     struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
     unsigned int isairq = (long)arg;
-    struct dev_intx_gsi_link *digl, *tmp;
+    const struct dev_intx_gsi_link *digl;
 
-    list_for_each_entry_safe ( digl, tmp, &pirq_dpci->digl_list, list )
+    list_for_each_entry ( digl, &pirq_dpci->digl_list, list )
     {
-        if ( hvm_irq->pci_link.route[digl->link] == isairq )
+        unsigned int link = hvm_pci_intx_link(digl->device, digl->intx);
+
+        if ( hvm_irq->pci_link.route[link] == isairq )
         {
             hvm_pci_intx_deassert(d, digl->device, digl->intx);
             if ( --pirq_dpci->pending == 0 )
diff --git a/xen/include/asm-x86/hvm/io.h b/xen/include/asm-x86/hvm/io.h
index 86db58d..8228ab8 100644
--- a/xen/include/asm-x86/hvm/io.h
+++ b/xen/include/asm-x86/hvm/io.h
@@ -123,7 +123,7 @@ int handle_pio(uint16_t port, unsigned int size, int dir);
 void hvm_interrupt_post(struct vcpu *v, int vector, int type);
 void hvm_io_assist(ioreq_t *p);
 void hvm_dpci_eoi(struct domain *d, unsigned int guest_irq,
-                  union vioapic_redir_entry *ent);
+                  const union vioapic_redir_entry *ent);
 void msix_write_completion(struct vcpu *);
 
 struct hvm_hw_stdvga {
diff --git a/xen/include/xen/hvm/irq.h b/xen/include/xen/hvm/irq.h
index a8710df..c89f4b1 100644
--- a/xen/include/xen/hvm/irq.h
+++ b/xen/include/xen/hvm/irq.h
@@ -30,10 +30,9 @@
 
 struct dev_intx_gsi_link {
     struct list_head list;
+    uint8_t bus;
     uint8_t device;
     uint8_t intx;
-    uint8_t gsi;
-    uint8_t link;
 };
 
 #define _HVM_IRQ_DPCI_MACH_PCI_SHIFT            0
@@ -69,6 +68,7 @@ struct hvm_gmsi_info {
 
 struct hvm_girq_dpci_mapping {
     struct list_head list;
+    uint8_t bus;
     uint8_t device;
     uint8_t intx;
     uint8_t machine_gsi;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIL-00033G-FG; Thu, 19 Jun 2014 04:49:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUII-00032r-C3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:51 +0000
Received: from [85.158.137.68:43113] by server-5.bemta-3.messagelabs.com id
	4C/CC-18761-CEB62A35; Thu, 19 Jun 2014 04:49:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403153386!6571986!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22163 invoked from network); 19 Jun 2014 04:49:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIE-0002gu-Oy
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIE-0008DP-N3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:46 +0000
Date: Thu, 19 Jun 2014 04:49:46 +0000
Message-Id: <E1WxUIE-0008DP-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: improve boot time diagnostics
	(try 2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebbb51dc8c1790e5187442a808003298b6796762
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jun 16 11:52:34 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:52:34 2014 +0200

    x86/EFI: improve boot time diagnostics (try 2)
    
    To aid analysis of eventual errors, print EFI status codes with error
    messages where available. Also remove a case where the status gets
    stored into a local variable without being used examined (which mis-
    guided me to add an error check there in try 1 of this patch).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/boot.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index a772509..2b515f2 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -344,11 +344,12 @@ static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
         ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
                                      &fs_protocol, (void **)&fio);
         if ( EFI_ERROR(ret) )
-            blexit(L"Couldn't obtain the File System Protocol Interface");
+            PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
+                         ret);
         ret = fio->OpenVolume(fio, &dir_handle);
     } while ( ret == EFI_MEDIA_CHANGED );
     if ( ret != EFI_SUCCESS )
-        blexit(L"OpenVolume failure");
+        PrintErrMesg(L"OpenVolume failure", ret);
 
 #define buffer ((CHAR16 *)keyhandler_scratch)
 #define BUFFERSIZE sizeof(keyhandler_scratch)
@@ -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
                     (void **)&shim_lock)) &&
-         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
-        blexit(L"Dom0 kernel image could not be verified.");
+         (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
+        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
 
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
@@ -1379,8 +1380,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         }
     }
 
-    status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
-                                  &efi_mdesc_size, &mdesc_ver);
+    efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
+                         &efi_mdesc_size, &mdesc_ver);
     mbi.mem_upper -= efi_memmap_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
@@ -1389,7 +1390,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
     if ( EFI_ERROR(status) )
-        blexit(L"Cannot obtain memory map");
+        PrintErrMesg(L"Cannot obtain memory map", status);
 
     /* Populate E820 table and check trampoline area availability. */
     e = e820map - 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:49:53 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:49:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIL-00033G-FG; Thu, 19 Jun 2014 04:49:53 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUII-00032r-C3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:51 +0000
Received: from [85.158.137.68:43113] by server-5.bemta-3.messagelabs.com id
	4C/CC-18761-CEB62A35; Thu, 19 Jun 2014 04:49:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403153386!6571986!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22163 invoked from network); 19 Jun 2014 04:49:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIE-0002gu-Oy
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIE-0008DP-N3
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:46 +0000
Date: Thu, 19 Jun 2014 04:49:46 +0000
Message-Id: <E1WxUIE-0008DP-N3@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: improve boot time diagnostics
	(try 2)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ebbb51dc8c1790e5187442a808003298b6796762
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Mon Jun 16 11:52:34 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:52:34 2014 +0200

    x86/EFI: improve boot time diagnostics (try 2)
    
    To aid analysis of eventual errors, print EFI status codes with error
    messages where available. Also remove a case where the status gets
    stored into a local variable without being used examined (which mis-
    guided me to add an error check there in try 1 of this patch).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/boot.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/xen/arch/x86/efi/boot.c b/xen/arch/x86/efi/boot.c
index a772509..2b515f2 100644
--- a/xen/arch/x86/efi/boot.c
+++ b/xen/arch/x86/efi/boot.c
@@ -344,11 +344,12 @@ static EFI_FILE_HANDLE __init get_parent_handle(EFI_LOADED_IMAGE *loaded_image,
         ret = efi_bs->HandleProtocol(loaded_image->DeviceHandle,
                                      &fs_protocol, (void **)&fio);
         if ( EFI_ERROR(ret) )
-            blexit(L"Couldn't obtain the File System Protocol Interface");
+            PrintErrMesg(L"Couldn't obtain the File System Protocol Interface",
+                         ret);
         ret = fio->OpenVolume(fio, &dir_handle);
     } while ( ret == EFI_MEDIA_CHANGED );
     if ( ret != EFI_SUCCESS )
-        blexit(L"OpenVolume failure");
+        PrintErrMesg(L"OpenVolume failure", ret);
 
 #define buffer ((CHAR16 *)keyhandler_scratch)
 #define BUFFERSIZE sizeof(keyhandler_scratch)
@@ -967,8 +968,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
 
     if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL,
                     (void **)&shim_lock)) &&
-         shim_lock->Verify(kernel.ptr, kernel.size) != EFI_SUCCESS )
-        blexit(L"Dom0 kernel image could not be verified.");
+         (status = shim_lock->Verify(kernel.ptr, kernel.size)) != EFI_SUCCESS )
+        PrintErrMesg(L"Dom0 kernel image could not be verified", status);
 
     name.s = get_value(&cfg, section.s, "ramdisk");
     if ( name.s )
@@ -1379,8 +1380,8 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
         }
     }
 
-    status = efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
-                                  &efi_mdesc_size, &mdesc_ver);
+    efi_bs->GetMemoryMap(&efi_memmap_size, NULL, &map_key,
+                         &efi_mdesc_size, &mdesc_ver);
     mbi.mem_upper -= efi_memmap_size;
     mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR);
     if ( mbi.mem_upper < xen_phys_start )
@@ -1389,7 +1390,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)
     status = efi_bs->GetMemoryMap(&efi_memmap_size, efi_memmap, &map_key,
                                   &efi_mdesc_size, &mdesc_ver);
     if ( EFI_ERROR(status) )
-        blexit(L"Cannot obtain memory map");
+        PrintErrMesg(L"Cannot obtain memory map", status);
 
     /* Populate E820 table and check trampoline area availability. */
     e = e820map - 1;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIT-00034W-Hs; Thu, 19 Jun 2014 04:50:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIR-00034E-PU
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:00 +0000
Received: from [85.158.137.68:39334] by server-10.bemta-3.messagelabs.com id
	87/37-09305-7FB62A35; Thu, 19 Jun 2014 04:49:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403153397!11009630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1897 invoked from network); 19 Jun 2014 04:49:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIO-0002h0-Um
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIO-0008Dl-T4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:56 +0000
Date: Thu, 19 Jun 2014 04:49:56 +0000
Message-Id: <E1WxUIO-0008Dl-T4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpuidle: improve perf for certain
	workloads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 775c681db114672088e506b52c851db7456913f2
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Jun 16 11:59:05 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:59:05 2014 +0200

    cpuidle: improve perf for certain workloads
    
    The existing mechanism of using interrupt frequency as a heuristic does
    not work well for certain workloads.  As an example, synchronous dd on a
    small block size uses deep C-states because much of the time is spent
    doing processing so the interrupt frequency is not too high, but when an
    IOP is submitted, the interrupt occurs soon after going idle.  This
    causes exit latency to be a significant factor.
    
    To fix this, add a new factor which limits the exit latency to be no
    more than 10% of the decaying measured idle time.  This improves
    performance for workloads with a medium interrupt frequency but a short
    idle duration.
    
    In the workload given previously, throughput improves by 20% with this
    patch.
    
    This is not ported from the Linux menu governor since that uses load
    average and number of IO wait processes to satisfy latency constraints.
    If a process is in IO wait state, it compares the exit latency with the
    predicted residency reduced by a factor of 10, which is somewhat similar
    to what this patch does.
    
    A side effect of this patch is to correctly limit the maximum idle time
    used in the correction factor calculation. Previously data->measured_us
    was used, and it was never set.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/acpi/cpuidle_menu.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/acpi/cpuidle_menu.c b/xen/arch/x86/acpi/cpuidle_menu.c
index 6952776..4afaa8d 100644
--- a/xen/arch/x86/acpi/cpuidle_menu.c
+++ b/xen/arch/x86/acpi/cpuidle_menu.c
@@ -36,6 +36,7 @@
 #define RESOLUTION 1024
 #define DECAY 4
 #define MAX_INTERESTING 50000
+#define LATENCY_MULTIPLIER 10
 
 /*
  * Concepts and ideas behind the menu governor
@@ -88,6 +89,9 @@
  * the average interrupt interval is, the smaller C state latency should be
  * and thus the less likely a busy CPU will hit such a deep C state.
  *
+ * As an additional rule to reduce the performance impact, menu tries to
+ * limit the exit latency duration to be no more than 10% of the decaying
+ * measured idle time.
  */
 
 struct perf_factor{
@@ -102,6 +106,7 @@ struct menu_device
     int             last_state_idx;
     unsigned int    expected_us;
     u64             predicted_us;
+    u64             latency_factor;
     unsigned int    measured_us;
     unsigned int    exit_us;
     unsigned int    bucket;
@@ -199,6 +204,10 @@ static int menu_select(struct acpi_processor_power *power)
 
     io_interval = avg_intr_interval_us();
 
+    data->latency_factor = DIV_ROUND(
+            data->latency_factor * (DECAY - 1) + data->measured_us,
+            DECAY);
+
     /*
      * if the correction factor is 0 (eg first time init or cpu hotplug
      * etc), we actually want to start out with a unity factor.
@@ -220,6 +229,8 @@ static int menu_select(struct acpi_processor_power *power)
             break;
         if (s->latency * IO_MULTIPLIER > io_interval)
             break;
+        if (s->latency * LATENCY_MULTIPLIER > data->latency_factor)
+            break;
         /* TBD: we need to check the QoS requirment in future */
         data->exit_us = s->latency;
         data->last_state_idx = i;
@@ -231,18 +242,16 @@ static int menu_select(struct acpi_processor_power *power)
 static void menu_reflect(struct acpi_processor_power *power)
 {
     struct menu_device *data = &__get_cpu_var(menu_devices);
-    unsigned int last_idle_us = power->last_residency;
-    unsigned int measured_us;
     u64 new_factor;
 
-    measured_us = last_idle_us;
+    data->measured_us = power->last_residency;
 
     /*
      * We correct for the exit latency; we are assuming here that the
      * exit latency happens after the event that we're interested in.
      */
-    if (measured_us > data->exit_us)
-        measured_us -= data->exit_us;
+    if (data->measured_us > data->exit_us)
+        data->measured_us -= data->exit_us;
 
     /* update our correction ratio */
 
@@ -250,7 +259,7 @@ static void menu_reflect(struct acpi_processor_power *power)
         * (DECAY - 1) / DECAY;
 
     if (data->expected_us > 0 && data->measured_us < MAX_INTERESTING)
-        new_factor += RESOLUTION * measured_us / data->expected_us;
+        new_factor += RESOLUTION * data->measured_us / data->expected_us;
     else
         /*
          * we were idle so long that we count it as a perfect
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIT-00034W-Hs; Thu, 19 Jun 2014 04:50:01 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIR-00034E-PU
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:00 +0000
Received: from [85.158.137.68:39334] by server-10.bemta-3.messagelabs.com id
	87/37-09305-7FB62A35; Thu, 19 Jun 2014 04:49:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403153397!11009630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1897 invoked from network); 19 Jun 2014 04:49:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:49:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIO-0002h0-Um
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIO-0008Dl-T4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:49:56 +0000
Date: Thu, 19 Jun 2014 04:49:56 +0000
Message-Id: <E1WxUIO-0008Dl-T4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] cpuidle: improve perf for certain
	workloads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 775c681db114672088e506b52c851db7456913f2
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Mon Jun 16 11:59:05 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:59:05 2014 +0200

    cpuidle: improve perf for certain workloads
    
    The existing mechanism of using interrupt frequency as a heuristic does
    not work well for certain workloads.  As an example, synchronous dd on a
    small block size uses deep C-states because much of the time is spent
    doing processing so the interrupt frequency is not too high, but when an
    IOP is submitted, the interrupt occurs soon after going idle.  This
    causes exit latency to be a significant factor.
    
    To fix this, add a new factor which limits the exit latency to be no
    more than 10% of the decaying measured idle time.  This improves
    performance for workloads with a medium interrupt frequency but a short
    idle duration.
    
    In the workload given previously, throughput improves by 20% with this
    patch.
    
    This is not ported from the Linux menu governor since that uses load
    average and number of IO wait processes to satisfy latency constraints.
    If a process is in IO wait state, it compares the exit latency with the
    predicted residency reduced by a factor of 10, which is somewhat similar
    to what this patch does.
    
    A side effect of this patch is to correctly limit the maximum idle time
    used in the correction factor calculation. Previously data->measured_us
    was used, and it was never set.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/acpi/cpuidle_menu.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/acpi/cpuidle_menu.c b/xen/arch/x86/acpi/cpuidle_menu.c
index 6952776..4afaa8d 100644
--- a/xen/arch/x86/acpi/cpuidle_menu.c
+++ b/xen/arch/x86/acpi/cpuidle_menu.c
@@ -36,6 +36,7 @@
 #define RESOLUTION 1024
 #define DECAY 4
 #define MAX_INTERESTING 50000
+#define LATENCY_MULTIPLIER 10
 
 /*
  * Concepts and ideas behind the menu governor
@@ -88,6 +89,9 @@
  * the average interrupt interval is, the smaller C state latency should be
  * and thus the less likely a busy CPU will hit such a deep C state.
  *
+ * As an additional rule to reduce the performance impact, menu tries to
+ * limit the exit latency duration to be no more than 10% of the decaying
+ * measured idle time.
  */
 
 struct perf_factor{
@@ -102,6 +106,7 @@ struct menu_device
     int             last_state_idx;
     unsigned int    expected_us;
     u64             predicted_us;
+    u64             latency_factor;
     unsigned int    measured_us;
     unsigned int    exit_us;
     unsigned int    bucket;
@@ -199,6 +204,10 @@ static int menu_select(struct acpi_processor_power *power)
 
     io_interval = avg_intr_interval_us();
 
+    data->latency_factor = DIV_ROUND(
+            data->latency_factor * (DECAY - 1) + data->measured_us,
+            DECAY);
+
     /*
      * if the correction factor is 0 (eg first time init or cpu hotplug
      * etc), we actually want to start out with a unity factor.
@@ -220,6 +229,8 @@ static int menu_select(struct acpi_processor_power *power)
             break;
         if (s->latency * IO_MULTIPLIER > io_interval)
             break;
+        if (s->latency * LATENCY_MULTIPLIER > data->latency_factor)
+            break;
         /* TBD: we need to check the QoS requirment in future */
         data->exit_us = s->latency;
         data->last_state_idx = i;
@@ -231,18 +242,16 @@ static int menu_select(struct acpi_processor_power *power)
 static void menu_reflect(struct acpi_processor_power *power)
 {
     struct menu_device *data = &__get_cpu_var(menu_devices);
-    unsigned int last_idle_us = power->last_residency;
-    unsigned int measured_us;
     u64 new_factor;
 
-    measured_us = last_idle_us;
+    data->measured_us = power->last_residency;
 
     /*
      * We correct for the exit latency; we are assuming here that the
      * exit latency happens after the event that we're interested in.
      */
-    if (measured_us > data->exit_us)
-        measured_us -= data->exit_us;
+    if (data->measured_us > data->exit_us)
+        data->measured_us -= data->exit_us;
 
     /* update our correction ratio */
 
@@ -250,7 +259,7 @@ static void menu_reflect(struct acpi_processor_power *power)
         * (DECAY - 1) / DECAY;
 
     if (data->expected_us > 0 && data->measured_us < MAX_INTERESTING)
-        new_factor += RESOLUTION * measured_us / data->expected_us;
+        new_factor += RESOLUTION * data->measured_us / data->expected_us;
     else
         /*
          * we were idle so long that we count it as a perfect
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIf-00036L-L2; Thu, 19 Jun 2014 04:50:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIe-000361-4C
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:12 +0000
Received: from [193.109.254.147:28532] by server-5.bemta-14.messagelabs.com id
	B0/13-26413-30C62A35; Thu, 19 Jun 2014 04:50:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403153409!12232975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28394 invoked from network); 19 Jun 2014 04:50:10 -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;
	19 Jun 2014 04:50:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIZ-0002hW-Cu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIZ-0008EP-2d
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:07 +0000
Date: Thu, 19 Jun 2014 04:50:07 +0000
Message-Id: <E1WxUIZ-0008EP-2d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mce: don't spam the console with
	"CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 323338f86fb6cd6f6dba4f59a84eed71b3552d21
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon Jun 16 11:59:32 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:59:32 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index ad06efc..bb4ce47 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -49,11 +49,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -62,13 +66,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -802,6 +810,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
 
     per_cpu(no_cmci_banks, cpu) = cmci;
     per_cpu(mce_banks_owned, cpu) = owned;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIf-00036L-L2; Thu, 19 Jun 2014 04:50:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIe-000361-4C
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:12 +0000
Received: from [193.109.254.147:28532] by server-5.bemta-14.messagelabs.com id
	B0/13-26413-30C62A35; Thu, 19 Jun 2014 04:50:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403153409!12232975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28394 invoked from network); 19 Jun 2014 04:50:10 -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;
	19 Jun 2014 04:50:10 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIZ-0002hW-Cu
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIZ-0008EP-2d
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:07 +0000
Date: Thu, 19 Jun 2014 04:50:07 +0000
Message-Id: <E1WxUIZ-0008EP-2d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mce: don't spam the console with
	"CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 323338f86fb6cd6f6dba4f59a84eed71b3552d21
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Mon Jun 16 11:59:32 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 11:59:32 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index ad06efc..bb4ce47 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -49,11 +49,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -62,13 +66,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -802,6 +810,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
 
     per_cpu(no_cmci_banks, cpu) = cmci;
     per_cpu(mce_banks_owned, cpu) = owned;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIq-00037f-Ny; Thu, 19 Jun 2014 04:50:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIp-00037U-0m
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:23 +0000
Received: from [85.158.143.35:46147] by server-2.bemta-4.messagelabs.com id
	FC/C4-06539-E0C62A35; Thu, 19 Jun 2014 04:50:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1403153420!12329597!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29088 invoked from network); 19 Jun 2014 04:50:20 -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;
	19 Jun 2014 04:50:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIl-0002hc-SJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIl-0008FT-Nc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:19 +0000
Date: Thu, 19 Jun 2014 04:50:19 +0000
Message-Id: <E1WxUIl-0008FT-Nc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] spread boot time page scrubbing across
	all available CPU's
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7430a86de0c9bd126b441570e459f6e06413cbf6
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Mon Jun 16 12:02:00 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:02:00 2014 +0200

    spread boot time page scrubbing across all available CPU's
    
    The page scrubbing is done in 128MB chunks in lockstep across all the
    non-SMT CPU's. This allows for the boot CPU to hold the heap_lock whilst each
    chunk is being scrubbed and then release the heap_lock when the CPU's are
    finished scrubing their individual chunk. This allows for the heap_lock to
    not be held continously and for pending softirqs are to be serviced
    periodically across the CPU's.
    
    The page scrub memory chunks are allocated to the CPU's in a NUMA aware
    fashion to reduce socket interconnect overhead and improve performance.
    Specifically in the first phase we scrub at the same time on all the
    NUMA nodes that have CPUs - we also weed out the SMT threads so that
    we only use cores (that gives a 50% boost). The second phase is for NUMA
    nodes that have no CPUs - for that we use the closest NUMA node's CPUs
    (non-SMT again) to do the job.
    
    This patch reduces the boot page scrub time on a 128GB 64 core AMD Opteron
    6386 machine from 49 seconds to 3 seconds.
    On a IvyBridge-EX 8 socket box with 1.5TB it cuts it down from 15 minutes
    to 63 seconds.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |   10 ++
 xen/common/page_alloc.c             |  214 ++++++++++++++++++++++++++++++++---
 xen/include/asm-arm/numa.h          |    1 +
 3 files changed, 207 insertions(+), 18 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 25829fe..94f04bd 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -198,6 +198,16 @@ Scrub free RAM during boot.  This is a safety feature to prevent
 accidentally leaking sensitive VM data into other VMs if Xen crashes
 and reboots.
 
+### `bootscrub_chunk`
+> `= <size>`
+
+> Default: `128M`
+
+Maximum RAM block size chunks to be scrubbed whilst holding the page heap lock
+and not running softirqs. Reduce this if softirqs are not being run frequently
+enough. Setting this to a high value may cause boot failure, particularly if
+the NMI watchdog is also enabled.
+
 ### cachesize
 > `= <size>`
 
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 601319c..1b2d541 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -65,6 +65,13 @@ static bool_t opt_bootscrub __initdata = 1;
 boolean_param("bootscrub", opt_bootscrub);
 
 /*
+ * bootscrub_chunk -> Amount of bytes to scrub lockstep on non-SMT CPUs
+ * on all NUMA nodes.
+ */
+static unsigned long __initdata opt_bootscrub_chunk = MB(128);
+size_param("bootscrub_chunk", opt_bootscrub_chunk);
+
+/*
  * Bit width of the DMA heap -- used to override NUMA-node-first.
  * allocation strategy, which can otherwise exhaust low memory.
  */
@@ -90,6 +97,16 @@ static struct bootmem_region {
 } *__initdata bootmem_region_list;
 static unsigned int __initdata nr_bootmem_regions;
 
+struct scrub_region {
+    unsigned long offset;
+    unsigned long start;
+    unsigned long per_cpu_sz;
+    unsigned long rem;
+    cpumask_t cpus;
+};
+static struct scrub_region __initdata region[MAX_NUMNODES];
+static unsigned long __initdata chunk_size;
+
 static void __init boot_bug(int line)
 {
     panic("Boot BUG at %s:%d", __FILE__, line);
@@ -1256,42 +1273,203 @@ void __init end_boot_allocator(void)
     printk("\n");
 }
 
+static void __init smp_scrub_heap_pages(void *data)
+{
+    unsigned long mfn, start, end;
+    struct page_info *pg;
+    struct scrub_region *r;
+    unsigned int temp_cpu, node, cpu_idx = 0;
+    unsigned int cpu = smp_processor_id();
+
+    if ( data )
+        r = data;
+    else
+    {
+        node = cpu_to_node(cpu);
+        if ( node == NUMA_NO_NODE )
+            return;
+        r = &region[node];
+    }
+
+    /* Determine the current CPU's index into CPU's linked to this node. */
+    for_each_cpu ( temp_cpu, &r->cpus )
+    {
+        if ( cpu == temp_cpu )
+            break;
+        cpu_idx++;
+    }
+
+    /* Calculate the starting mfn for this CPU's memory block. */
+    start = r->start + (r->per_cpu_sz * cpu_idx) + r->offset;
+
+    /* Calculate the end mfn into this CPU's memory block for this iteration. */
+    if ( r->offset + chunk_size >= r->per_cpu_sz )
+    {
+        end = r->start + (r->per_cpu_sz * cpu_idx) + r->per_cpu_sz;
+
+        if ( r->rem && (cpumask_weight(&r->cpus) - 1 == cpu_idx) )
+            end += r->rem;
+    }
+    else
+        end = start + chunk_size;
+
+    for ( mfn = start; mfn < end; mfn++ )
+    {
+        pg = mfn_to_page(mfn);
+
+        /* Check the mfn is valid and page is free. */
+        if ( !mfn_valid(mfn) || !page_state_is(pg, free) )
+            continue;
+
+        scrub_one_page(pg);
+    }
+}
+
+static int __init find_non_smt(unsigned int node, cpumask_t *dest)
+{
+    cpumask_t node_cpus;
+    unsigned int i, cpu;
+
+    cpumask_and(&node_cpus, &node_to_cpumask(node), &cpu_online_map);
+    cpumask_clear(dest);
+    for_each_cpu ( i, &node_cpus )
+    {
+        if ( cpumask_intersects(dest, per_cpu(cpu_sibling_mask, i)) )
+            continue;
+        cpu = cpumask_first(per_cpu(cpu_sibling_mask, i));
+        cpumask_set_cpu(cpu, dest);
+    }
+    return cpumask_weight(dest);
+}
+
 /*
- * Scrub all unallocated pages in all heap zones. This function is more
- * convoluted than appears necessary because we do not want to continuously
- * hold the lock while scrubbing very large memory areas.
+ * Scrub all unallocated pages in all heap zones. This function uses all
+ * online cpu's to scrub the memory in parallel.
  */
 void __init scrub_heap_pages(void)
 {
-    unsigned long mfn;
-    struct page_info *pg;
+    cpumask_t node_cpus, all_worker_cpus;
+    unsigned int i, j;
+    unsigned long offset, max_per_cpu_sz = 0;
+    unsigned long start, end;
+    unsigned long rem = 0;
+    int last_distance, best_node;
+    int cpus;
 
     if ( !opt_bootscrub )
         return;
 
-    printk("Scrubbing Free RAM: ");
+    cpumask_clear(&all_worker_cpus);
+    /* Scrub block size. */
+    chunk_size = opt_bootscrub_chunk >> PAGE_SHIFT;
+    if ( chunk_size == 0 )
+        chunk_size = MB(128) >> PAGE_SHIFT;
 
-    for ( mfn = first_valid_mfn; mfn < max_page; mfn++ )
+    /* Round #0 - figure out amounts and which CPUs to use. */
+    for_each_online_node ( i )
     {
+        if ( !node_spanned_pages(i) )
+            continue;
+        /* Calculate Node memory start and end address. */
+        start = max(node_start_pfn(i), first_valid_mfn);
+        end = min(node_start_pfn(i) + node_spanned_pages(i), max_page);
+        /* Just in case NODE has 1 page and starts below first_valid_mfn. */
+        end = max(end, start);
+        /* CPUs that are online and on this node (if none, that it is OK). */
+        cpus = find_non_smt(i, &node_cpus);
+        cpumask_or(&all_worker_cpus, &all_worker_cpus, &node_cpus);
+        if ( cpus <= 0 )
+        {
+            /* No CPUs on this node. Round #2 will take of it. */
+            rem = 0;
+            region[i].per_cpu_sz = (end - start);
+        }
+        else
+        {
+            rem = (end - start) % cpus;
+            region[i].per_cpu_sz = (end - start) / cpus;
+            if ( region[i].per_cpu_sz > max_per_cpu_sz )
+                max_per_cpu_sz = region[i].per_cpu_sz;
+        }
+        region[i].start = start;
+        region[i].rem = rem;
+        cpumask_copy(&region[i].cpus, &node_cpus);
+    }
+
+    printk("Scrubbing Free RAM on %d nodes using %d CPUs\n", num_online_nodes(),
+           cpumask_weight(&all_worker_cpus));
+
+    /* Round: #1 - do NUMA nodes with CPUs. */
+    for ( offset = 0; offset < max_per_cpu_sz; offset += chunk_size )
+    {
+        for_each_online_node ( i )
+            region[i].offset = offset;
+
         process_pending_softirqs();
 
-        pg = mfn_to_page(mfn);
+        spin_lock(&heap_lock);
+        on_selected_cpus(&all_worker_cpus, smp_scrub_heap_pages, NULL, 1);
+        spin_unlock(&heap_lock);
 
-        /* Quick lock-free check. */
-        if ( !mfn_valid(mfn) || !page_state_is(pg, free) )
+        printk(".");
+    }
+
+    /*
+     * Round #2: NUMA nodes with no CPUs get scrubbed with CPUs on the node
+     * closest to us and with CPUs.
+     */
+    for_each_online_node ( i )
+    {
+        node_cpus = node_to_cpumask(i);
+
+        if ( !cpumask_empty(&node_cpus) )
             continue;
 
-        /* Every 100MB, print a progress dot. */
-        if ( (mfn % ((100*1024*1024)/PAGE_SIZE)) == 0 )
-            printk(".");
+        last_distance = INT_MAX;
+        best_node = first_node(node_online_map);
+        /* Figure out which NODE CPUs are close. */
+        for_each_online_node ( j )
+        {
+            int distance;
 
-        spin_lock(&heap_lock);
+            if ( cpumask_empty(&node_to_cpumask(j)) )
+                continue;
 
-        /* Re-check page status with lock held. */
-        if ( page_state_is(pg, free) )
-            scrub_one_page(pg);
+            distance = __node_distance(i, j);
+            if ( distance < last_distance )
+            {
+                last_distance = distance;
+                best_node = j;
+            }
+        }
+        /*
+         * Use CPUs from best node, and if there are no CPUs on the
+         * first node (the default) use the BSP.
+         */
+        cpus = find_non_smt(best_node, &node_cpus);
+        if ( cpus == 0 )
+        {
+            cpumask_set_cpu(smp_processor_id(), &node_cpus);
+            cpus = 1;
+        }
+        /* We already have the node information from round #0. */
+        region[i].rem = region[i].per_cpu_sz % cpus;
+        region[i].per_cpu_sz /= cpus;
+        max_per_cpu_sz = region[i].per_cpu_sz;
+        cpumask_copy(&region[i].cpus, &node_cpus);
 
-        spin_unlock(&heap_lock);
+        for ( offset = 0; offset < max_per_cpu_sz; offset += chunk_size )
+        {
+            region[i].offset = offset;
+
+            process_pending_softirqs();
+
+            spin_lock(&heap_lock);
+            on_selected_cpus(&node_cpus, smp_scrub_heap_pages, &region[i], 1);
+            spin_unlock(&heap_lock);
+
+            printk(".");
+        }
     }
 
     printk("done.\n");
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index cb8f2ba..2c019d7 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -12,6 +12,7 @@ static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
 
 /* XXX: implement NUMA support */
 #define node_spanned_pages(nid) (total_pages)
+#define node_start_pfn(nid) (frametable_base_mfn)
 #define __node_distance(a, b) (20)
 
 #endif /* __ARCH_ARM_NUMA_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUIq-00037f-Ny; Thu, 19 Jun 2014 04:50:24 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIp-00037U-0m
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:23 +0000
Received: from [85.158.143.35:46147] by server-2.bemta-4.messagelabs.com id
	FC/C4-06539-E0C62A35; Thu, 19 Jun 2014 04:50:22 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1403153420!12329597!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29088 invoked from network); 19 Jun 2014 04:50:20 -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;
	19 Jun 2014 04:50:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIl-0002hc-SJ
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIl-0008FT-Nc
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:19 +0000
Date: Thu, 19 Jun 2014 04:50:19 +0000
Message-Id: <E1WxUIl-0008FT-Nc@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] spread boot time page scrubbing across
	all available CPU's
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7430a86de0c9bd126b441570e459f6e06413cbf6
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Mon Jun 16 12:02:00 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:02:00 2014 +0200

    spread boot time page scrubbing across all available CPU's
    
    The page scrubbing is done in 128MB chunks in lockstep across all the
    non-SMT CPU's. This allows for the boot CPU to hold the heap_lock whilst each
    chunk is being scrubbed and then release the heap_lock when the CPU's are
    finished scrubing their individual chunk. This allows for the heap_lock to
    not be held continously and for pending softirqs are to be serviced
    periodically across the CPU's.
    
    The page scrub memory chunks are allocated to the CPU's in a NUMA aware
    fashion to reduce socket interconnect overhead and improve performance.
    Specifically in the first phase we scrub at the same time on all the
    NUMA nodes that have CPUs - we also weed out the SMT threads so that
    we only use cores (that gives a 50% boost). The second phase is for NUMA
    nodes that have no CPUs - for that we use the closest NUMA node's CPUs
    (non-SMT again) to do the job.
    
    This patch reduces the boot page scrub time on a 128GB 64 core AMD Opteron
    6386 machine from 49 seconds to 3 seconds.
    On a IvyBridge-EX 8 socket box with 1.5TB it cuts it down from 15 minutes
    to 63 seconds.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 docs/misc/xen-command-line.markdown |   10 ++
 xen/common/page_alloc.c             |  214 ++++++++++++++++++++++++++++++++---
 xen/include/asm-arm/numa.h          |    1 +
 3 files changed, 207 insertions(+), 18 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown b/docs/misc/xen-command-line.markdown
index 25829fe..94f04bd 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -198,6 +198,16 @@ Scrub free RAM during boot.  This is a safety feature to prevent
 accidentally leaking sensitive VM data into other VMs if Xen crashes
 and reboots.
 
+### `bootscrub_chunk`
+> `= <size>`
+
+> Default: `128M`
+
+Maximum RAM block size chunks to be scrubbed whilst holding the page heap lock
+and not running softirqs. Reduce this if softirqs are not being run frequently
+enough. Setting this to a high value may cause boot failure, particularly if
+the NMI watchdog is also enabled.
+
 ### cachesize
 > `= <size>`
 
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 601319c..1b2d541 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -65,6 +65,13 @@ static bool_t opt_bootscrub __initdata = 1;
 boolean_param("bootscrub", opt_bootscrub);
 
 /*
+ * bootscrub_chunk -> Amount of bytes to scrub lockstep on non-SMT CPUs
+ * on all NUMA nodes.
+ */
+static unsigned long __initdata opt_bootscrub_chunk = MB(128);
+size_param("bootscrub_chunk", opt_bootscrub_chunk);
+
+/*
  * Bit width of the DMA heap -- used to override NUMA-node-first.
  * allocation strategy, which can otherwise exhaust low memory.
  */
@@ -90,6 +97,16 @@ static struct bootmem_region {
 } *__initdata bootmem_region_list;
 static unsigned int __initdata nr_bootmem_regions;
 
+struct scrub_region {
+    unsigned long offset;
+    unsigned long start;
+    unsigned long per_cpu_sz;
+    unsigned long rem;
+    cpumask_t cpus;
+};
+static struct scrub_region __initdata region[MAX_NUMNODES];
+static unsigned long __initdata chunk_size;
+
 static void __init boot_bug(int line)
 {
     panic("Boot BUG at %s:%d", __FILE__, line);
@@ -1256,42 +1273,203 @@ void __init end_boot_allocator(void)
     printk("\n");
 }
 
+static void __init smp_scrub_heap_pages(void *data)
+{
+    unsigned long mfn, start, end;
+    struct page_info *pg;
+    struct scrub_region *r;
+    unsigned int temp_cpu, node, cpu_idx = 0;
+    unsigned int cpu = smp_processor_id();
+
+    if ( data )
+        r = data;
+    else
+    {
+        node = cpu_to_node(cpu);
+        if ( node == NUMA_NO_NODE )
+            return;
+        r = &region[node];
+    }
+
+    /* Determine the current CPU's index into CPU's linked to this node. */
+    for_each_cpu ( temp_cpu, &r->cpus )
+    {
+        if ( cpu == temp_cpu )
+            break;
+        cpu_idx++;
+    }
+
+    /* Calculate the starting mfn for this CPU's memory block. */
+    start = r->start + (r->per_cpu_sz * cpu_idx) + r->offset;
+
+    /* Calculate the end mfn into this CPU's memory block for this iteration. */
+    if ( r->offset + chunk_size >= r->per_cpu_sz )
+    {
+        end = r->start + (r->per_cpu_sz * cpu_idx) + r->per_cpu_sz;
+
+        if ( r->rem && (cpumask_weight(&r->cpus) - 1 == cpu_idx) )
+            end += r->rem;
+    }
+    else
+        end = start + chunk_size;
+
+    for ( mfn = start; mfn < end; mfn++ )
+    {
+        pg = mfn_to_page(mfn);
+
+        /* Check the mfn is valid and page is free. */
+        if ( !mfn_valid(mfn) || !page_state_is(pg, free) )
+            continue;
+
+        scrub_one_page(pg);
+    }
+}
+
+static int __init find_non_smt(unsigned int node, cpumask_t *dest)
+{
+    cpumask_t node_cpus;
+    unsigned int i, cpu;
+
+    cpumask_and(&node_cpus, &node_to_cpumask(node), &cpu_online_map);
+    cpumask_clear(dest);
+    for_each_cpu ( i, &node_cpus )
+    {
+        if ( cpumask_intersects(dest, per_cpu(cpu_sibling_mask, i)) )
+            continue;
+        cpu = cpumask_first(per_cpu(cpu_sibling_mask, i));
+        cpumask_set_cpu(cpu, dest);
+    }
+    return cpumask_weight(dest);
+}
+
 /*
- * Scrub all unallocated pages in all heap zones. This function is more
- * convoluted than appears necessary because we do not want to continuously
- * hold the lock while scrubbing very large memory areas.
+ * Scrub all unallocated pages in all heap zones. This function uses all
+ * online cpu's to scrub the memory in parallel.
  */
 void __init scrub_heap_pages(void)
 {
-    unsigned long mfn;
-    struct page_info *pg;
+    cpumask_t node_cpus, all_worker_cpus;
+    unsigned int i, j;
+    unsigned long offset, max_per_cpu_sz = 0;
+    unsigned long start, end;
+    unsigned long rem = 0;
+    int last_distance, best_node;
+    int cpus;
 
     if ( !opt_bootscrub )
         return;
 
-    printk("Scrubbing Free RAM: ");
+    cpumask_clear(&all_worker_cpus);
+    /* Scrub block size. */
+    chunk_size = opt_bootscrub_chunk >> PAGE_SHIFT;
+    if ( chunk_size == 0 )
+        chunk_size = MB(128) >> PAGE_SHIFT;
 
-    for ( mfn = first_valid_mfn; mfn < max_page; mfn++ )
+    /* Round #0 - figure out amounts and which CPUs to use. */
+    for_each_online_node ( i )
     {
+        if ( !node_spanned_pages(i) )
+            continue;
+        /* Calculate Node memory start and end address. */
+        start = max(node_start_pfn(i), first_valid_mfn);
+        end = min(node_start_pfn(i) + node_spanned_pages(i), max_page);
+        /* Just in case NODE has 1 page and starts below first_valid_mfn. */
+        end = max(end, start);
+        /* CPUs that are online and on this node (if none, that it is OK). */
+        cpus = find_non_smt(i, &node_cpus);
+        cpumask_or(&all_worker_cpus, &all_worker_cpus, &node_cpus);
+        if ( cpus <= 0 )
+        {
+            /* No CPUs on this node. Round #2 will take of it. */
+            rem = 0;
+            region[i].per_cpu_sz = (end - start);
+        }
+        else
+        {
+            rem = (end - start) % cpus;
+            region[i].per_cpu_sz = (end - start) / cpus;
+            if ( region[i].per_cpu_sz > max_per_cpu_sz )
+                max_per_cpu_sz = region[i].per_cpu_sz;
+        }
+        region[i].start = start;
+        region[i].rem = rem;
+        cpumask_copy(&region[i].cpus, &node_cpus);
+    }
+
+    printk("Scrubbing Free RAM on %d nodes using %d CPUs\n", num_online_nodes(),
+           cpumask_weight(&all_worker_cpus));
+
+    /* Round: #1 - do NUMA nodes with CPUs. */
+    for ( offset = 0; offset < max_per_cpu_sz; offset += chunk_size )
+    {
+        for_each_online_node ( i )
+            region[i].offset = offset;
+
         process_pending_softirqs();
 
-        pg = mfn_to_page(mfn);
+        spin_lock(&heap_lock);
+        on_selected_cpus(&all_worker_cpus, smp_scrub_heap_pages, NULL, 1);
+        spin_unlock(&heap_lock);
 
-        /* Quick lock-free check. */
-        if ( !mfn_valid(mfn) || !page_state_is(pg, free) )
+        printk(".");
+    }
+
+    /*
+     * Round #2: NUMA nodes with no CPUs get scrubbed with CPUs on the node
+     * closest to us and with CPUs.
+     */
+    for_each_online_node ( i )
+    {
+        node_cpus = node_to_cpumask(i);
+
+        if ( !cpumask_empty(&node_cpus) )
             continue;
 
-        /* Every 100MB, print a progress dot. */
-        if ( (mfn % ((100*1024*1024)/PAGE_SIZE)) == 0 )
-            printk(".");
+        last_distance = INT_MAX;
+        best_node = first_node(node_online_map);
+        /* Figure out which NODE CPUs are close. */
+        for_each_online_node ( j )
+        {
+            int distance;
 
-        spin_lock(&heap_lock);
+            if ( cpumask_empty(&node_to_cpumask(j)) )
+                continue;
 
-        /* Re-check page status with lock held. */
-        if ( page_state_is(pg, free) )
-            scrub_one_page(pg);
+            distance = __node_distance(i, j);
+            if ( distance < last_distance )
+            {
+                last_distance = distance;
+                best_node = j;
+            }
+        }
+        /*
+         * Use CPUs from best node, and if there are no CPUs on the
+         * first node (the default) use the BSP.
+         */
+        cpus = find_non_smt(best_node, &node_cpus);
+        if ( cpus == 0 )
+        {
+            cpumask_set_cpu(smp_processor_id(), &node_cpus);
+            cpus = 1;
+        }
+        /* We already have the node information from round #0. */
+        region[i].rem = region[i].per_cpu_sz % cpus;
+        region[i].per_cpu_sz /= cpus;
+        max_per_cpu_sz = region[i].per_cpu_sz;
+        cpumask_copy(&region[i].cpus, &node_cpus);
 
-        spin_unlock(&heap_lock);
+        for ( offset = 0; offset < max_per_cpu_sz; offset += chunk_size )
+        {
+            region[i].offset = offset;
+
+            process_pending_softirqs();
+
+            spin_lock(&heap_lock);
+            on_selected_cpus(&node_cpus, smp_scrub_heap_pages, &region[i], 1);
+            spin_unlock(&heap_lock);
+
+            printk(".");
+        }
     }
 
     printk("done.\n");
diff --git a/xen/include/asm-arm/numa.h b/xen/include/asm-arm/numa.h
index cb8f2ba..2c019d7 100644
--- a/xen/include/asm-arm/numa.h
+++ b/xen/include/asm-arm/numa.h
@@ -12,6 +12,7 @@ static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
 
 /* XXX: implement NUMA support */
 #define node_spanned_pages(nid) (total_pages)
+#define node_start_pfn(nid) (frametable_base_mfn)
 #define __node_distance(a, b) (20)
 
 #endif /* __ARCH_ARM_NUMA_H */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJ2-00039J-Tx; Thu, 19 Jun 2014 04:50:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIz-00038z-J4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:34 +0000
Received: from [85.158.137.68:50513] by server-8.bemta-3.messagelabs.com id
	C2/2E-21547-81C62A35; Thu, 19 Jun 2014 04:50:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403153430!10977969!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25218 invoked from network); 19 Jun 2014 04:50:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:50:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIw-0002hk-37
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIw-0008Fp-0q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:30 +0000
Date: Thu, 19 Jun 2014 04:50:30 +0000
Message-Id: <E1WxUIw-0008Fp-0q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: rename v->cpu_affinity into
	v->cpu_hard_affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3fe14e35d96991c095a7e6916ad07f0c31bc0fad
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:11:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:11:52 2014 +0200

    sched: rename v->cpu_affinity into v->cpu_hard_affinity
    
    in order to distinguish it from the cpu_soft_affinity which will
    be introduced a later commit ("xen: sched: introduce soft-affinity
    and use it instead d->node-affinity").
    
    This patch does not imply any functional change, it is basically
    the result of something like the following:
    
     s/cpu_affinity/cpu_hard_affinity/g
     s/cpu_affinity_tmp/cpu_hard_affinity_tmp/g
     s/cpu_affinity_saved/cpu_hard_affinity_saved/g
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/traps.c      |   11 ++++++-----
 xen/common/domain.c       |   22 +++++++++++-----------
 xen/common/domctl.c       |    2 +-
 xen/common/keyhandler.c   |    2 +-
 xen/common/sched_credit.c |   12 ++++++------
 xen/common/sched_sedf.c   |    2 +-
 xen/common/schedule.c     |   21 +++++++++++----------
 xen/common/wait.c         |    4 ++--
 xen/include/xen/sched.h   |    8 ++++----
 9 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44ac014..cc1c87c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3173,7 +3173,8 @@ static void nmi_mce_softirq(void)
 
     /* Set the tmp value unconditionally, so that
      * the check in the iret hypercall works. */
-    cpumask_copy(st->vcpu->cpu_affinity_tmp, st->vcpu->cpu_affinity);
+    cpumask_copy(st->vcpu->cpu_hard_affinity_tmp,
+                 st->vcpu->cpu_hard_affinity);
 
     if ((cpu != st->processor)
        || (st->processor != st->vcpu->processor))
@@ -3208,11 +3209,11 @@ void async_exception_cleanup(struct vcpu *curr)
         return;
 
     /* Restore affinity.  */
-    if ( !cpumask_empty(curr->cpu_affinity_tmp) &&
-         !cpumask_equal(curr->cpu_affinity_tmp, curr->cpu_affinity) )
+    if ( !cpumask_empty(curr->cpu_hard_affinity_tmp) &&
+         !cpumask_equal(curr->cpu_hard_affinity_tmp, curr->cpu_hard_affinity) )
     {
-        vcpu_set_affinity(curr, curr->cpu_affinity_tmp);
-        cpumask_clear(curr->cpu_affinity_tmp);
+        vcpu_set_affinity(curr, curr->cpu_hard_affinity_tmp);
+        cpumask_clear(curr->cpu_hard_affinity_tmp);
     }
 
     if ( !(curr->async_exception_mask & (curr->async_exception_mask - 1)) )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index bc57174..141a5dc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -125,9 +125,9 @@ struct vcpu *alloc_vcpu(
 
     tasklet_init(&v->continue_hypercall_tasklet, NULL, 0);
 
-    if ( !zalloc_cpumask_var(&v->cpu_affinity) ||
-         !zalloc_cpumask_var(&v->cpu_affinity_tmp) ||
-         !zalloc_cpumask_var(&v->cpu_affinity_saved) ||
+    if ( !zalloc_cpumask_var(&v->cpu_hard_affinity) ||
+         !zalloc_cpumask_var(&v->cpu_hard_affinity_tmp) ||
+         !zalloc_cpumask_var(&v->cpu_hard_affinity_saved) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -156,9 +156,9 @@ struct vcpu *alloc_vcpu(
  fail_wq:
         destroy_waitqueue_vcpu(v);
  fail_free:
-        free_cpumask_var(v->cpu_affinity);
-        free_cpumask_var(v->cpu_affinity_tmp);
-        free_cpumask_var(v->cpu_affinity_saved);
+        free_cpumask_var(v->cpu_hard_affinity);
+        free_cpumask_var(v->cpu_hard_affinity_tmp);
+        free_cpumask_var(v->cpu_hard_affinity_saved);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
@@ -427,7 +427,7 @@ void domain_update_node_affinity(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
-        cpumask_and(online_affinity, v->cpu_affinity, online);
+        cpumask_and(online_affinity, v->cpu_hard_affinity, online);
         cpumask_or(cpumask, cpumask, online_affinity);
     }
 
@@ -792,9 +792,9 @@ static void complete_domain_destroy(struct rcu_head *head)
     for ( i = d->max_vcpus - 1; i >= 0; i-- )
         if ( (v = d->vcpu[i]) != NULL )
         {
-            free_cpumask_var(v->cpu_affinity);
-            free_cpumask_var(v->cpu_affinity_tmp);
-            free_cpumask_var(v->cpu_affinity_saved);
+            free_cpumask_var(v->cpu_hard_affinity);
+            free_cpumask_var(v->cpu_hard_affinity_tmp);
+            free_cpumask_var(v->cpu_hard_affinity_saved);
             free_cpumask_var(v->vcpu_dirty_cpumask);
             free_vcpu_struct(v);
         }
@@ -934,7 +934,7 @@ int vcpu_reset(struct vcpu *v)
     v->async_exception_mask = 0;
     memset(v->async_exception_state, 0, sizeof(v->async_exception_state));
 #endif
-    cpumask_clear(v->cpu_affinity_tmp);
+    cpumask_clear(v->cpu_hard_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
     clear_bit(_VPF_in_reset, &v->pause_flags);
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 4774277..b5c5c6c 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -625,7 +625,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         else
         {
             ret = cpumask_to_xenctl_bitmap(
-                &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
+                &op->u.vcpuaffinity.cpumap, v->cpu_hard_affinity);
         }
     }
     break;
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 5afcfef..d6eb026 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -295,7 +295,7 @@ static void dump_domains(unsigned char key)
                    !vcpu_event_delivery_is_enabled(v));
             cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
             printk("dirty_cpus=%s ", tmpstr);
-            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_affinity);
+            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_hard_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
             printk("    pause_count=%d pause_flags=%lx\n",
                    atomic_read(&v->pause_count), v->pause_flags);
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index db5512e..c6a2560 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -332,13 +332,13 @@ csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
     if ( step == CSCHED_BALANCE_NODE_AFFINITY )
     {
         cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
-                    vc->cpu_affinity);
+                    vc->cpu_hard_affinity);
 
         if ( unlikely(cpumask_empty(mask)) )
-            cpumask_copy(mask, vc->cpu_affinity);
+            cpumask_copy(mask, vc->cpu_hard_affinity);
     }
     else /* step == CSCHED_BALANCE_CPU_AFFINITY */
-        cpumask_copy(mask, vc->cpu_affinity);
+        cpumask_copy(mask, vc->cpu_hard_affinity);
 }
 
 static void burn_credits(struct csched_vcpu *svc, s_time_t now)
@@ -407,7 +407,7 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 
             if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
                  && !__vcpu_has_node_affinity(new->vcpu,
-                                              new->vcpu->cpu_affinity) )
+                                              new->vcpu->cpu_hard_affinity) )
                 continue;
 
             /* Are there idlers suitable for new (for this balance step)? */
@@ -642,7 +642,7 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
 
     /* Store in cpus the mask of online cpus on which the domain can run */
     online = cpupool_scheduler_cpumask(vc->domain->cpupool);
-    cpumask_and(&cpus, vc->cpu_affinity, online);
+    cpumask_and(&cpus, vc->cpu_hard_affinity, online);
 
     for_each_csched_balance_step( balance_step )
     {
@@ -1498,7 +1498,7 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
              * or counter.
              */
             if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-                 && !__vcpu_has_node_affinity(vc, vc->cpu_affinity) )
+                 && !__vcpu_has_node_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
             csched_balance_cpumask(vc, balance_step, csched_balance_mask);
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 0c9011a..7c80bad 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -384,7 +384,7 @@ static int sedf_pick_cpu(const struct scheduler *ops, struct vcpu *v)
     cpumask_t *online;
 
     online = cpupool_scheduler_cpumask(v->domain->cpupool);
-    cpumask_and(&online_affinity, v->cpu_affinity, online);
+    cpumask_and(&online_affinity, v->cpu_hard_affinity, online);
     return cpumask_cycle(v->vcpu_id % cpumask_weight(&online_affinity) - 1,
                          &online_affinity);
 }
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3ea9fc8..b579dfa 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -194,9 +194,9 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
      */
     v->processor = processor;
     if ( is_idle_domain(d) || d->is_pinned )
-        cpumask_copy(v->cpu_affinity, cpumask_of(processor));
+        cpumask_copy(v->cpu_hard_affinity, cpumask_of(processor));
     else
-        cpumask_setall(v->cpu_affinity);
+        cpumask_setall(v->cpu_hard_affinity);
 
     /* Initialise the per-vcpu timers. */
     init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
@@ -285,7 +285,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         migrate_timer(&v->singleshot_timer, new_p);
         migrate_timer(&v->poll_timer, new_p);
 
-        cpumask_setall(v->cpu_affinity);
+        cpumask_setall(v->cpu_hard_affinity);
 
         lock = vcpu_schedule_lock_irq(v);
         v->processor = new_p;
@@ -458,7 +458,7 @@ static void vcpu_migrate(struct vcpu *v)
              */
             if ( pick_called &&
                  (new_lock == per_cpu(schedule_data, new_cpu).schedule_lock) &&
-                 cpumask_test_cpu(new_cpu, v->cpu_affinity) &&
+                 cpumask_test_cpu(new_cpu, v->cpu_hard_affinity) &&
                  cpumask_test_cpu(new_cpu, v->domain->cpupool->cpu_valid) )
                 break;
 
@@ -561,7 +561,7 @@ void restore_vcpu_affinity(struct domain *d)
         if ( v->affinity_broken )
         {
             printk(XENLOG_DEBUG "Restoring affinity for %pv\n", v);
-            cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            cpumask_copy(v->cpu_hard_affinity, v->cpu_hard_affinity_saved);
             v->affinity_broken = 0;
         }
 
@@ -604,19 +604,20 @@ int cpu_disable_scheduler(unsigned int cpu)
             unsigned long flags;
             spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
-            cpumask_and(&online_affinity, v->cpu_affinity, c->cpu_valid);
+            cpumask_and(&online_affinity, v->cpu_hard_affinity, c->cpu_valid);
             if ( cpumask_empty(&online_affinity) &&
-                 cpumask_test_cpu(cpu, v->cpu_affinity) )
+                 cpumask_test_cpu(cpu, v->cpu_hard_affinity) )
             {
                 printk(XENLOG_DEBUG "Breaking affinity for %pv\n", v);
 
                 if (system_state == SYS_STATE_suspend)
                 {
-                    cpumask_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    cpumask_copy(v->cpu_hard_affinity_saved,
+                                 v->cpu_hard_affinity);
                     v->affinity_broken = 1;
                 }
 
-                cpumask_setall(v->cpu_affinity);
+                cpumask_setall(v->cpu_hard_affinity);
             }
 
             if ( v->processor == cpu )
@@ -664,7 +665,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 
     lock = vcpu_schedule_lock_irq(v);
 
-    cpumask_copy(v->cpu_affinity, affinity);
+    cpumask_copy(v->cpu_hard_affinity, affinity);
 
     /* Always ask the scheduler to re-evaluate placement
      * when changing the affinity */
diff --git a/xen/common/wait.c b/xen/common/wait.c
index 3c9366c..3f6ff41 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -134,7 +134,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
     wqv->wakeup_cpu = smp_processor_id();
-    cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+    cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
     if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
     {
         gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
@@ -183,7 +183,7 @@ void check_wakeup_from_wait(void)
     {
         /* Re-set VCPU affinity and re-enter the scheduler. */
         struct vcpu *curr = current;
-        cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+        cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
         if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
         {
             gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 44851ae..6f91abd 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -219,11 +219,11 @@ struct vcpu
     spinlock_t       virq_lock;
 
     /* Bitmask of CPUs on which this VCPU may run. */
-    cpumask_var_t    cpu_affinity;
+    cpumask_var_t    cpu_hard_affinity;
     /* Used to change affinity temporarily. */
-    cpumask_var_t    cpu_affinity_tmp;
+    cpumask_var_t    cpu_hard_affinity_tmp;
     /* Used to restore affinity across S3. */
-    cpumask_var_t    cpu_affinity_saved;
+    cpumask_var_t    cpu_hard_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
@@ -819,7 +819,7 @@ void watchdog_domain_destroy(struct domain *d);
 #define has_hvm_container_domain(d) ((d)->guest_type != guest_type_pv)
 #define has_hvm_container_vcpu(v)   (has_hvm_container_domain((v)->domain))
 #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
-                           cpumask_weight((v)->cpu_affinity) == 1)
+                           cpumask_weight((v)->cpu_hard_affinity) == 1)
 #ifdef HAS_PASSTHROUGH
 #define need_iommu(d)    ((d)->need_iommu)
 #else
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:37 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:37 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJ2-00039J-Tx; Thu, 19 Jun 2014 04:50:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIz-00038z-J4
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:34 +0000
Received: from [85.158.137.68:50513] by server-8.bemta-3.messagelabs.com id
	C2/2E-21547-81C62A35; Thu, 19 Jun 2014 04:50:32 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403153430!10977969!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25218 invoked from network); 19 Jun 2014 04:50:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:50:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIw-0002hk-37
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUIw-0008Fp-0q
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:30 +0000
Date: Thu, 19 Jun 2014 04:50:30 +0000
Message-Id: <E1WxUIw-0008Fp-0q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: rename v->cpu_affinity into
	v->cpu_hard_affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3fe14e35d96991c095a7e6916ad07f0c31bc0fad
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:11:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:11:52 2014 +0200

    sched: rename v->cpu_affinity into v->cpu_hard_affinity
    
    in order to distinguish it from the cpu_soft_affinity which will
    be introduced a later commit ("xen: sched: introduce soft-affinity
    and use it instead d->node-affinity").
    
    This patch does not imply any functional change, it is basically
    the result of something like the following:
    
     s/cpu_affinity/cpu_hard_affinity/g
     s/cpu_affinity_tmp/cpu_hard_affinity_tmp/g
     s/cpu_affinity_saved/cpu_hard_affinity_saved/g
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/traps.c      |   11 ++++++-----
 xen/common/domain.c       |   22 +++++++++++-----------
 xen/common/domctl.c       |    2 +-
 xen/common/keyhandler.c   |    2 +-
 xen/common/sched_credit.c |   12 ++++++------
 xen/common/sched_sedf.c   |    2 +-
 xen/common/schedule.c     |   21 +++++++++++----------
 xen/common/wait.c         |    4 ++--
 xen/include/xen/sched.h   |    8 ++++----
 9 files changed, 43 insertions(+), 41 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 44ac014..cc1c87c 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3173,7 +3173,8 @@ static void nmi_mce_softirq(void)
 
     /* Set the tmp value unconditionally, so that
      * the check in the iret hypercall works. */
-    cpumask_copy(st->vcpu->cpu_affinity_tmp, st->vcpu->cpu_affinity);
+    cpumask_copy(st->vcpu->cpu_hard_affinity_tmp,
+                 st->vcpu->cpu_hard_affinity);
 
     if ((cpu != st->processor)
        || (st->processor != st->vcpu->processor))
@@ -3208,11 +3209,11 @@ void async_exception_cleanup(struct vcpu *curr)
         return;
 
     /* Restore affinity.  */
-    if ( !cpumask_empty(curr->cpu_affinity_tmp) &&
-         !cpumask_equal(curr->cpu_affinity_tmp, curr->cpu_affinity) )
+    if ( !cpumask_empty(curr->cpu_hard_affinity_tmp) &&
+         !cpumask_equal(curr->cpu_hard_affinity_tmp, curr->cpu_hard_affinity) )
     {
-        vcpu_set_affinity(curr, curr->cpu_affinity_tmp);
-        cpumask_clear(curr->cpu_affinity_tmp);
+        vcpu_set_affinity(curr, curr->cpu_hard_affinity_tmp);
+        cpumask_clear(curr->cpu_hard_affinity_tmp);
     }
 
     if ( !(curr->async_exception_mask & (curr->async_exception_mask - 1)) )
diff --git a/xen/common/domain.c b/xen/common/domain.c
index bc57174..141a5dc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -125,9 +125,9 @@ struct vcpu *alloc_vcpu(
 
     tasklet_init(&v->continue_hypercall_tasklet, NULL, 0);
 
-    if ( !zalloc_cpumask_var(&v->cpu_affinity) ||
-         !zalloc_cpumask_var(&v->cpu_affinity_tmp) ||
-         !zalloc_cpumask_var(&v->cpu_affinity_saved) ||
+    if ( !zalloc_cpumask_var(&v->cpu_hard_affinity) ||
+         !zalloc_cpumask_var(&v->cpu_hard_affinity_tmp) ||
+         !zalloc_cpumask_var(&v->cpu_hard_affinity_saved) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -156,9 +156,9 @@ struct vcpu *alloc_vcpu(
  fail_wq:
         destroy_waitqueue_vcpu(v);
  fail_free:
-        free_cpumask_var(v->cpu_affinity);
-        free_cpumask_var(v->cpu_affinity_tmp);
-        free_cpumask_var(v->cpu_affinity_saved);
+        free_cpumask_var(v->cpu_hard_affinity);
+        free_cpumask_var(v->cpu_hard_affinity_tmp);
+        free_cpumask_var(v->cpu_hard_affinity_saved);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
@@ -427,7 +427,7 @@ void domain_update_node_affinity(struct domain *d)
 
     for_each_vcpu ( d, v )
     {
-        cpumask_and(online_affinity, v->cpu_affinity, online);
+        cpumask_and(online_affinity, v->cpu_hard_affinity, online);
         cpumask_or(cpumask, cpumask, online_affinity);
     }
 
@@ -792,9 +792,9 @@ static void complete_domain_destroy(struct rcu_head *head)
     for ( i = d->max_vcpus - 1; i >= 0; i-- )
         if ( (v = d->vcpu[i]) != NULL )
         {
-            free_cpumask_var(v->cpu_affinity);
-            free_cpumask_var(v->cpu_affinity_tmp);
-            free_cpumask_var(v->cpu_affinity_saved);
+            free_cpumask_var(v->cpu_hard_affinity);
+            free_cpumask_var(v->cpu_hard_affinity_tmp);
+            free_cpumask_var(v->cpu_hard_affinity_saved);
             free_cpumask_var(v->vcpu_dirty_cpumask);
             free_vcpu_struct(v);
         }
@@ -934,7 +934,7 @@ int vcpu_reset(struct vcpu *v)
     v->async_exception_mask = 0;
     memset(v->async_exception_state, 0, sizeof(v->async_exception_state));
 #endif
-    cpumask_clear(v->cpu_affinity_tmp);
+    cpumask_clear(v->cpu_hard_affinity_tmp);
     clear_bit(_VPF_blocked, &v->pause_flags);
     clear_bit(_VPF_in_reset, &v->pause_flags);
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 4774277..b5c5c6c 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -625,7 +625,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         else
         {
             ret = cpumask_to_xenctl_bitmap(
-                &op->u.vcpuaffinity.cpumap, v->cpu_affinity);
+                &op->u.vcpuaffinity.cpumap, v->cpu_hard_affinity);
         }
     }
     break;
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 5afcfef..d6eb026 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -295,7 +295,7 @@ static void dump_domains(unsigned char key)
                    !vcpu_event_delivery_is_enabled(v));
             cpuset_print(tmpstr, sizeof(tmpstr), v->vcpu_dirty_cpumask);
             printk("dirty_cpus=%s ", tmpstr);
-            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_affinity);
+            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_hard_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
             printk("    pause_count=%d pause_flags=%lx\n",
                    atomic_read(&v->pause_count), v->pause_flags);
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index db5512e..c6a2560 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -332,13 +332,13 @@ csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
     if ( step == CSCHED_BALANCE_NODE_AFFINITY )
     {
         cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
-                    vc->cpu_affinity);
+                    vc->cpu_hard_affinity);
 
         if ( unlikely(cpumask_empty(mask)) )
-            cpumask_copy(mask, vc->cpu_affinity);
+            cpumask_copy(mask, vc->cpu_hard_affinity);
     }
     else /* step == CSCHED_BALANCE_CPU_AFFINITY */
-        cpumask_copy(mask, vc->cpu_affinity);
+        cpumask_copy(mask, vc->cpu_hard_affinity);
 }
 
 static void burn_credits(struct csched_vcpu *svc, s_time_t now)
@@ -407,7 +407,7 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 
             if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
                  && !__vcpu_has_node_affinity(new->vcpu,
-                                              new->vcpu->cpu_affinity) )
+                                              new->vcpu->cpu_hard_affinity) )
                 continue;
 
             /* Are there idlers suitable for new (for this balance step)? */
@@ -642,7 +642,7 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
 
     /* Store in cpus the mask of online cpus on which the domain can run */
     online = cpupool_scheduler_cpumask(vc->domain->cpupool);
-    cpumask_and(&cpus, vc->cpu_affinity, online);
+    cpumask_and(&cpus, vc->cpu_hard_affinity, online);
 
     for_each_csched_balance_step( balance_step )
     {
@@ -1498,7 +1498,7 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
              * or counter.
              */
             if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-                 && !__vcpu_has_node_affinity(vc, vc->cpu_affinity) )
+                 && !__vcpu_has_node_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
             csched_balance_cpumask(vc, balance_step, csched_balance_mask);
diff --git a/xen/common/sched_sedf.c b/xen/common/sched_sedf.c
index 0c9011a..7c80bad 100644
--- a/xen/common/sched_sedf.c
+++ b/xen/common/sched_sedf.c
@@ -384,7 +384,7 @@ static int sedf_pick_cpu(const struct scheduler *ops, struct vcpu *v)
     cpumask_t *online;
 
     online = cpupool_scheduler_cpumask(v->domain->cpupool);
-    cpumask_and(&online_affinity, v->cpu_affinity, online);
+    cpumask_and(&online_affinity, v->cpu_hard_affinity, online);
     return cpumask_cycle(v->vcpu_id % cpumask_weight(&online_affinity) - 1,
                          &online_affinity);
 }
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 3ea9fc8..b579dfa 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -194,9 +194,9 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
      */
     v->processor = processor;
     if ( is_idle_domain(d) || d->is_pinned )
-        cpumask_copy(v->cpu_affinity, cpumask_of(processor));
+        cpumask_copy(v->cpu_hard_affinity, cpumask_of(processor));
     else
-        cpumask_setall(v->cpu_affinity);
+        cpumask_setall(v->cpu_hard_affinity);
 
     /* Initialise the per-vcpu timers. */
     init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
@@ -285,7 +285,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         migrate_timer(&v->singleshot_timer, new_p);
         migrate_timer(&v->poll_timer, new_p);
 
-        cpumask_setall(v->cpu_affinity);
+        cpumask_setall(v->cpu_hard_affinity);
 
         lock = vcpu_schedule_lock_irq(v);
         v->processor = new_p;
@@ -458,7 +458,7 @@ static void vcpu_migrate(struct vcpu *v)
              */
             if ( pick_called &&
                  (new_lock == per_cpu(schedule_data, new_cpu).schedule_lock) &&
-                 cpumask_test_cpu(new_cpu, v->cpu_affinity) &&
+                 cpumask_test_cpu(new_cpu, v->cpu_hard_affinity) &&
                  cpumask_test_cpu(new_cpu, v->domain->cpupool->cpu_valid) )
                 break;
 
@@ -561,7 +561,7 @@ void restore_vcpu_affinity(struct domain *d)
         if ( v->affinity_broken )
         {
             printk(XENLOG_DEBUG "Restoring affinity for %pv\n", v);
-            cpumask_copy(v->cpu_affinity, v->cpu_affinity_saved);
+            cpumask_copy(v->cpu_hard_affinity, v->cpu_hard_affinity_saved);
             v->affinity_broken = 0;
         }
 
@@ -604,19 +604,20 @@ int cpu_disable_scheduler(unsigned int cpu)
             unsigned long flags;
             spinlock_t *lock = vcpu_schedule_lock_irqsave(v, &flags);
 
-            cpumask_and(&online_affinity, v->cpu_affinity, c->cpu_valid);
+            cpumask_and(&online_affinity, v->cpu_hard_affinity, c->cpu_valid);
             if ( cpumask_empty(&online_affinity) &&
-                 cpumask_test_cpu(cpu, v->cpu_affinity) )
+                 cpumask_test_cpu(cpu, v->cpu_hard_affinity) )
             {
                 printk(XENLOG_DEBUG "Breaking affinity for %pv\n", v);
 
                 if (system_state == SYS_STATE_suspend)
                 {
-                    cpumask_copy(v->cpu_affinity_saved, v->cpu_affinity);
+                    cpumask_copy(v->cpu_hard_affinity_saved,
+                                 v->cpu_hard_affinity);
                     v->affinity_broken = 1;
                 }
 
-                cpumask_setall(v->cpu_affinity);
+                cpumask_setall(v->cpu_hard_affinity);
             }
 
             if ( v->processor == cpu )
@@ -664,7 +665,7 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 
     lock = vcpu_schedule_lock_irq(v);
 
-    cpumask_copy(v->cpu_affinity, affinity);
+    cpumask_copy(v->cpu_hard_affinity, affinity);
 
     /* Always ask the scheduler to re-evaluate placement
      * when changing the affinity */
diff --git a/xen/common/wait.c b/xen/common/wait.c
index 3c9366c..3f6ff41 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -134,7 +134,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
     wqv->wakeup_cpu = smp_processor_id();
-    cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+    cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
     if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
     {
         gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
@@ -183,7 +183,7 @@ void check_wakeup_from_wait(void)
     {
         /* Re-set VCPU affinity and re-enter the scheduler. */
         struct vcpu *curr = current;
-        cpumask_copy(&wqv->saved_affinity, curr->cpu_affinity);
+        cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
         if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
         {
             gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 44851ae..6f91abd 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -219,11 +219,11 @@ struct vcpu
     spinlock_t       virq_lock;
 
     /* Bitmask of CPUs on which this VCPU may run. */
-    cpumask_var_t    cpu_affinity;
+    cpumask_var_t    cpu_hard_affinity;
     /* Used to change affinity temporarily. */
-    cpumask_var_t    cpu_affinity_tmp;
+    cpumask_var_t    cpu_hard_affinity_tmp;
     /* Used to restore affinity across S3. */
-    cpumask_var_t    cpu_affinity_saved;
+    cpumask_var_t    cpu_hard_affinity_saved;
 
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
@@ -819,7 +819,7 @@ void watchdog_domain_destroy(struct domain *d);
 #define has_hvm_container_domain(d) ((d)->guest_type != guest_type_pv)
 #define has_hvm_container_vcpu(v)   (has_hvm_container_domain((v)->domain))
 #define is_pinned_vcpu(v) ((v)->domain->is_pinned || \
-                           cpumask_weight((v)->cpu_affinity) == 1)
+                           cpumask_weight((v)->cpu_hard_affinity) == 1)
 #ifdef HAS_PASSTHROUGH
 #define need_iommu(d)    ((d)->need_iommu)
 #else
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:46 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJC-0003AX-0j; Thu, 19 Jun 2014 04:50:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJA-0003AI-BD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:44 +0000
Received: from [85.158.139.211:34889] by server-4.bemta-5.messagelabs.com id
	CD/A7-07250-32C62A35; Thu, 19 Jun 2014 04:50:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403153440!7884936!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22687 invoked from network); 19 Jun 2014 04:50:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:50:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJ6-0002ho-9p
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJ6-0008GB-86
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:40 +0000
Date: Thu, 19 Jun 2014 04:50:40 +0000
Message-Id: <E1WxUJ6-0008GB-86@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: introduce soft-affinity and use
	it instead d->node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db6b2215910327cd4401868c67a44680932c1f2a
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:12:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:12:28 2014 +0200

    sched: introduce soft-affinity and use it instead d->node-affinity
    
    Before this change, each vcpu had its own vcpu-affinity
    (in v->cpu_affinity), representing the set of pcpus where
    the vcpu is allowed to run. Since when NUMA-aware scheduling
    was introduced the (credit1 only, for now) scheduler also
    tries as much as it can to run all the vcpus of a domain
    on one of the nodes that constitutes the domain's
    node-affinity.
    
    The idea here is making the mechanism more general by:
      * allowing for this 'preference' for some pcpus/nodes to be
        expressed on a per-vcpu basis, instead than for the domain
        as a whole. That is to say, each vcpu should have its own
        set of preferred pcpus/nodes, instead than it being the
        very same for all the vcpus of the domain;
      * generalizing the idea of 'preferred pcpus' to not only NUMA
        awareness and support. That is to say, independently from
        it being or not (mostly) useful on NUMA systems, it should
        be possible to specify, for each vcpu, a set of pcpus where
        it prefers to run (in addition, and possibly unrelated to,
        the set of pcpus where it is allowed to run).
    
    We will be calling this set of *preferred* pcpus the vcpu's
    soft affinity, and this changes introduce it, and starts using it
    for scheduling, replacing the indirect use of the domain's NUMA
    node-affinity. This is more general, as soft affinity does not
    have to be related to NUMA. Nevertheless, it allows to achieve the
    same results of NUMA-aware scheduling, just by making soft affinity
    equal to the domain's node affinity, for all the vCPUs (e.g.,
    from the toolstack).
    
    This also means renaming most of the NUMA-aware scheduling related
    functions, in credit1, to something more generic, hinting toward
    the concept of soft affinity rather than directly to NUMA awareness.
    
    As a side effects, this simplifies the code quit a bit. In fact,
    prior to this change, we needed to cache the translation of
    d->node_affinity (which is a nodemask_t) to a cpumask_t, since that
    is what scheduling decisions require (we used to keep it in
    node_affinity_cpumask). This, and all the complicated logic
    required to keep it updated, is not necessary any longer.
    
    The high level description of NUMA placement and scheduling in
    docs/misc/xl-numa-placement.markdown is being updated too, to match
    the new architecture.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xl-numa-placement.markdown |  148 +++++++++++++++++++++-----------
 xen/common/domain.c                  |    5 +-
 xen/common/keyhandler.c              |    2 +
 xen/common/sched_credit.c            |  153 +++++++++++++--------------------
 xen/common/schedule.c                |    8 +-
 xen/include/xen/sched-if.h           |    2 -
 xen/include/xen/sched.h              |    4 +-
 7 files changed, 168 insertions(+), 154 deletions(-)

diff --git a/docs/misc/xl-numa-placement.markdown b/docs/misc/xl-numa-placement.markdown
index caa3fec..9d64eae 100644
--- a/docs/misc/xl-numa-placement.markdown
+++ b/docs/misc/xl-numa-placement.markdown
@@ -12,13 +12,6 @@ is quite more complex and slow. On these machines, a NUMA node is usually
 defined as a set of processor cores (typically a physical CPU package) and
 the memory directly attached to the set of cores.
 
-The Xen hypervisor deals with NUMA machines by assigning to each domain
-a "node affinity", i.e., a set of NUMA nodes of the host from which they
-get their memory allocated. Also, even if the node affinity of a domain
-is allowed to change on-line, it is very important to "place" the domain
-correctly when it is fist created, as the most of its memory is allocated
-at that time and can not (for now) be moved easily.
-
 NUMA awareness becomes very important as soon as many domains start
 running memory-intensive workloads on a shared host. In fact, the cost
 of accessing non node-local memory locations is very high, and the
@@ -27,14 +20,37 @@ performance degradation is likely to be noticeable.
 For more information, have a look at the [Xen NUMA Introduction][numa_intro]
 page on the Wiki.
 
+## Xen and NUMA machines: the concept of _node-affinity_ ##
+
+The Xen hypervisor deals with NUMA machines throughout the concept of
+_node-affinity_. The node-affinity of a domain is the set of NUMA nodes
+of the host where the memory for the domain is being allocated (mostly,
+at domain creation time). This is, at least in principle, different and
+unrelated with the vCPU (hard and soft, see below) scheduling affinity,
+which instead is the set of pCPUs where the vCPU is allowed (or prefers)
+to run.
+
+Of course, despite the fact that they belong to and affect different
+subsystems, the domain node-affinity and the vCPUs affinity are not
+completely independent.
+In fact, if the domain node-affinity is not explicitly specified by the
+user, via the proper libxl calls or xl config item, it will be computed
+basing on the vCPUs' scheduling affinity.
+
+Notice that, even if the node affinity of a domain may change on-line,
+it is very important to "place" the domain correctly when it is fist
+created, as the most of its memory is allocated at that time and can
+not (for now) be moved easily.
+
 ### Placing via pinning and cpupools ###
 
-The simplest way of placing a domain on a NUMA node is statically pinning
-the domain's vCPUs to the pCPUs of the node. This goes under the name of
-CPU affinity and can be set through the "cpus=" option in the config file
-(more about this below). Another option is to pool together the pCPUs
-spanning the node and put the domain in such a cpupool with the "pool="
-config option (as documented in our [Wiki][cpupools_howto]).
+The simplest way of placing a domain on a NUMA node is setting the hard
+scheduling affinity of the domain's vCPUs to the pCPUs of the node. This
+also goes under the name of vCPU pinning, and can be done through the
+"cpus=" option in the config file (more about this below). Another option
+is to pool together the pCPUs spanning the node and put the domain in
+such a _cpupool_ with the "pool=" config option (as documented in our
+[Wiki][cpupools_howto]).
 
 In both the above cases, the domain will not be able to execute outside
 the specified set of pCPUs for any reasons, even if all those pCPUs are
@@ -45,24 +61,45 @@ may come at he cost of some load imbalances.
 
 ### NUMA aware scheduling ###
 
-If the credit scheduler is in use, the concept of node affinity defined
-above does not only apply to memory. In fact, starting from Xen 4.3, the
-scheduler always tries to run the domain's vCPUs on one of the nodes in
-its node affinity. Only if that turns out to be impossible, it will just
-pick any free pCPU.
-
-This is, therefore, something more flexible than CPU affinity, as a domain
-can still run everywhere, it just prefers some nodes rather than others.
-Locality of access is less guaranteed than in the pinning case, but that
-comes along with better chances to exploit all the host resources (e.g.,
-the pCPUs).
-
-In fact, if all the pCPUs in a domain's node affinity are busy, it is
-possible for the domain to run outside of there, but it is very likely that
-slower execution (due to remote memory accesses) is still better than no
-execution at all, as it would happen with pinning. For this reason, NUMA
-aware scheduling has the potential of bringing substantial performances
-benefits, although this will depend on the workload.
+If using the credit1 scheduler, and starting from Xen 4.3, the scheduler
+itself always tries to run the domain's vCPUs on one of the nodes in
+its node-affinity. Only if that turns out to be impossible, it will just
+pick any free pCPU. Locality of access is less guaranteed than in the
+pinning case, but that comes along with better chances to exploit all
+the host resources (e.g., the pCPUs).
+
+Starting from Xen 4.5, credit1 supports two forms of affinity: hard and
+soft, both on a per-vCPU basis. This means each vCPU can have its own
+soft affinity, stating where such vCPU prefers to execute on. This is
+less strict than what it (also starting from 4.5) is called hard affinity,
+as the vCPU can potentially run everywhere, it just prefers some pCPUs
+rather than others.
+In Xen 4.5, therefore, NUMA-aware scheduling is achieved by matching the
+soft affinity of the vCPUs of a domain with its node-affinity.
+
+In fact, as it was for 4.3, if all the pCPUs in a vCPU's soft affinity
+are busy, it is possible for the domain to run outside from there. The
+idea is that slower execution (due to remote memory accesses) is still
+better than no execution at all (as it would happen with pinning). For
+this reason, NUMA aware scheduling has the potential of bringing
+substantial performances benefits, although this will depend on the
+workload.
+
+Notice that, for each vCPU, the following three scenarios are possbile:
+
+  * a vCPU *is pinned* to some pCPUs and *does not have* any soft affinity
+    In this case, the vCPU is always scheduled on one of the pCPUs to which
+    it is pinned, without any specific peference among them.
+  * a vCPU *has* its own soft affinity and *is not* pinned to any particular
+    pCPU. In this case, the vCPU can run on every pCPU. Nevertheless, the
+    scheduler will try to have it running on one of the pCPUs in its soft
+    affinity;
+  * a vCPU *has* its own vCPU soft affinity and *is also* pinned to some
+    pCPUs. In this case, the vCPU is always scheduled on one of the pCPUs
+    onto which it is pinned, with, among them, a preference for the ones
+    that also forms its soft affinity. In case pinning and soft affinity
+    form two disjoint sets of pCPUs, pinning "wins", and the soft affinity
+    is just ignored.
 
 ## Guest placement in xl ##
 
@@ -71,25 +108,23 @@ both manual or automatic placement of them across the host's NUMA nodes.
 
 Note that xm/xend does a very similar thing, the only differences being
 the details of the heuristics adopted for automatic placement (see below),
-and the lack of support (in both xm/xend and the Xen versions where that\
+and the lack of support (in both xm/xend and the Xen versions where that
 was the default toolstack) for NUMA aware scheduling.
 
 ### Placing the guest manually ###
 
 Thanks to the "cpus=" option, it is possible to specify where a domain
 should be created and scheduled on, directly in its config file. This
-affects NUMA placement and memory accesses as the hypervisor constructs
-the node affinity of a VM basing right on its CPU affinity when it is
-created.
+affects NUMA placement and memory accesses as, in this case, the
+hypervisor constructs the node-affinity of a VM basing right on its
+vCPU pinning when it is created.
 
 This is very simple and effective, but requires the user/system
-administrator to explicitly specify affinities for each and every domain,
+administrator to explicitly specify the pinning for each and every domain,
 or Xen won't be able to guarantee the locality for their memory accesses.
 
-Notice that this also pins the domain's vCPUs to the specified set of
-pCPUs, so it not only sets the domain's node affinity (its memory will
-come from the nodes to which the pCPUs belong), but at the same time
-forces the vCPUs of the domain to be scheduled on those same pCPUs.
+That, of course, also mean the vCPUs of the domain will only be able to
+execute on those same pCPUs.
 
 ### Placing the guest automatically ###
 
@@ -97,7 +132,9 @@ If no "cpus=" option is specified in the config file, libxl tries
 to figure out on its own on which node(s) the domain could fit best.
 If it finds one (some), the domain's node affinity get set to there,
 and both memory allocations and NUMA aware scheduling (for the credit
-scheduler and starting from Xen 4.3) will comply with it.
+scheduler and starting from Xen 4.3) will comply with it. Starting from
+Xen 4.5, this also means that the mask resulting from this "fitting"
+procedure will become the soft affinity of all the vCPUs of the domain.
 
 It is worthwhile noting that optimally fitting a set of VMs on the NUMA
 nodes of an host is an incarnation of the Bin Packing Problem. In fact,
@@ -142,34 +179,43 @@ any placement from happening:
 
     libxl_defbool_set(&domain_build_info->numa_placement, false);
 
-Also, if `numa_placement` is set to `true`, the domain must not
-have any CPU affinity (i.e., `domain_build_info->cpumap` must
-have all its bits set, as it is by default), or domain creation
-will fail returning `ERROR_INVAL`.
+Also, if `numa_placement` is set to `true`, the domain's vCPUs must
+not be pinned (i.e., `domain_build_info->cpumap` must have all its
+bits set, as it is by default), or domain creation will fail with
+`ERROR_INVAL`.
 
 Starting from Xen 4.3, in case automatic placement happens (and is
-successful), it will affect the domain's node affinity and _not_ its
-CPU affinity. Namely, the domain's vCPUs will not be pinned to any
+successful), it will affect the domain's node-affinity and _not_ its
+vCPU pinning. Namely, the domain's vCPUs will not be pinned to any
 pCPU on the host, but the memory from the domain will come from the
 selected node(s) and the NUMA aware scheduling (if the credit scheduler
-is in use) will try to keep the domain there as much as possible.
+is in use) will try to keep the domain's vCPUs there as much as possible.
 
 Besides than that, looking and/or tweaking the placement algorithm
 search "Automatic NUMA placement" in libxl\_internal.h.
 
 Note this may change in future versions of Xen/libxl.
 
+## Xen < 4.5 ##
+
+The concept of vCPU soft affinity has been introduced for the first time
+in Xen 4.5. In 4.3, it is the domain's node-affinity that drives the
+NUMA-aware scheduler. The main difference is soft affinity is per-vCPU,
+and so each vCPU can have its own mask of pCPUs, while node-affinity is
+per-domain, that is the equivalent of having all the vCPUs with the same
+soft affinity.
+
 ## Xen < 4.3 ##
 
 As NUMA aware scheduling is a new feature of Xen 4.3, things are a little
 bit different for earlier version of Xen. If no "cpus=" option is specified
 and Xen 4.2 is in use, the automatic placement algorithm still runs, but
 the results is used to _pin_ the vCPUs of the domain to the output node(s).
-This is consistent with what was happening with xm/xend, which were also
-affecting the domain's CPU affinity.
+This is consistent with what was happening with xm/xend.
 
 On a version of Xen earlier than 4.2, there is not automatic placement at
-all in xl or libxl, and hence no node or CPU affinity being affected.
+all in xl or libxl, and hence no node-affinity, vCPU affinity or pinning
+being introduced/modified.
 
 ## Limitations ##
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 141a5dc..e20d3bf 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -128,6 +128,7 @@ struct vcpu *alloc_vcpu(
     if ( !zalloc_cpumask_var(&v->cpu_hard_affinity) ||
          !zalloc_cpumask_var(&v->cpu_hard_affinity_tmp) ||
          !zalloc_cpumask_var(&v->cpu_hard_affinity_saved) ||
+         !zalloc_cpumask_var(&v->cpu_soft_affinity) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -159,6 +160,7 @@ struct vcpu *alloc_vcpu(
         free_cpumask_var(v->cpu_hard_affinity);
         free_cpumask_var(v->cpu_hard_affinity_tmp);
         free_cpumask_var(v->cpu_hard_affinity_saved);
+        free_cpumask_var(v->cpu_soft_affinity);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
@@ -446,8 +448,6 @@ void domain_update_node_affinity(struct domain *d)
                 node_set(node, d->node_affinity);
     }
 
-    sched_set_node_affinity(d, &d->node_affinity);
-
     spin_unlock(&d->node_affinity_lock);
 
     free_cpumask_var(online_affinity);
@@ -795,6 +795,7 @@ static void complete_domain_destroy(struct rcu_head *head)
             free_cpumask_var(v->cpu_hard_affinity);
             free_cpumask_var(v->cpu_hard_affinity_tmp);
             free_cpumask_var(v->cpu_hard_affinity_saved);
+            free_cpumask_var(v->cpu_soft_affinity);
             free_cpumask_var(v->vcpu_dirty_cpumask);
             free_vcpu_struct(v);
         }
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index d6eb026..809378c 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -297,6 +297,8 @@ static void dump_domains(unsigned char key)
             printk("dirty_cpus=%s ", tmpstr);
             cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_hard_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
+            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_soft_affinity);
+            printk("cpu_soft_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);
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index c6a2560..8b02b7b 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -112,10 +112,24 @@
 
 
 /*
- * Node Balancing
+ * Hard and soft affinity load balancing.
+ *
+ * Idea is each vcpu has some pcpus that it prefers, some that it does not
+ * prefer but is OK with, and some that it cannot run on at all. The first
+ * set of pcpus are the ones that are both in the soft affinity *and* in the
+ * hard affinity; the second set of pcpus are the ones that are in the hard
+ * affinity but *not* in the soft affinity; the third set of pcpus are the
+ * ones that are not in the hard affinity.
+ *
+ * We implement a two step balancing logic. Basically, every time there is
+ * the need to decide where to run a vcpu, we first check the soft affinity
+ * (well, actually, the && between soft and hard affinity), to see if we can
+ * send it where it prefers to (and can) run on. However, if the first step
+ * does not find any suitable and free pcpu, we fall back checking the hard
+ * affinity.
  */
-#define CSCHED_BALANCE_NODE_AFFINITY    0
-#define CSCHED_BALANCE_CPU_AFFINITY     1
+#define CSCHED_BALANCE_SOFT_AFFINITY    0
+#define CSCHED_BALANCE_HARD_AFFINITY    1
 
 /*
  * Boot parameters
@@ -138,7 +152,7 @@ struct csched_pcpu {
 
 /*
  * Convenience macro for accessing the per-PCPU cpumask we need for
- * implementing the two steps (vcpu and node affinity) balancing logic.
+ * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
  * as there is a csched_pcpu for each PCPU and we always hold the
  * runqueue spin-lock when using this.
@@ -178,9 +192,6 @@ struct csched_dom {
     struct list_head active_vcpu;
     struct list_head active_sdom_elem;
     struct domain *dom;
-    /* cpumask translated from the domain's node-affinity.
-     * Basically, the CPUs we prefer to be scheduled on. */
-    cpumask_var_t node_affinity_cpumask;
     uint16_t active_vcpu_count;
     uint16_t weight;
     uint16_t cap;
@@ -261,59 +272,28 @@ __runq_remove(struct csched_vcpu *svc)
     list_del_init(&svc->runq_elem);
 }
 
-/*
- * Translates node-affinity mask into a cpumask, so that we can use it during
- * actual scheduling. That of course will contain all the cpus from all the
- * set nodes in the original node-affinity mask.
- *
- * Note that any serialization needed to access mask safely is complete
- * responsibility of the caller of this function/hook.
- */
-static void csched_set_node_affinity(
-    const struct scheduler *ops,
-    struct domain *d,
-    nodemask_t *mask)
-{
-    struct csched_dom *sdom;
-    int node;
-
-    /* Skip idle domain since it doesn't even have a node_affinity_cpumask */
-    if ( unlikely(is_idle_domain(d)) )
-        return;
-
-    sdom = CSCHED_DOM(d);
-    cpumask_clear(sdom->node_affinity_cpumask);
-    for_each_node_mask( node, *mask )
-        cpumask_or(sdom->node_affinity_cpumask, sdom->node_affinity_cpumask,
-                   &node_to_cpumask(node));
-}
 
 #define for_each_csched_balance_step(step) \
-    for ( (step) = 0; (step) <= CSCHED_BALANCE_CPU_AFFINITY; (step)++ )
+    for ( (step) = 0; (step) <= CSCHED_BALANCE_HARD_AFFINITY; (step)++ )
 
 
 /*
- * vcpu-affinity balancing is always necessary and must never be skipped.
- * OTOH, if a domain's node-affinity is said to be automatically computed
- * (or if it just spans all the nodes), we can safely avoid dealing with
- * node-affinity entirely.
+ * Hard affinity balancing is always necessary and must never be skipped.
+ * OTOH, if the vcpu's soft affinity is full (it spans all the possible
+ * pcpus) we can safely avoid dealing with it entirely.
  *
- * Node-affinity is also deemed meaningless in case it has empty
- * intersection with mask, to cover the cases where using the node-affinity
+ * A vcpu's soft affinity is also deemed meaningless in case it has empty
+ * intersection with mask, to cover the cases where using the soft affinity
  * mask seems legit, but would instead led to trying to schedule the vcpu
  * on _no_ pcpu! Typical use cases are for mask to be equal to the vcpu's
- * vcpu-affinity, or to the && of vcpu-affinity and the set of online cpus
+ * hard affinity, or to the && of hard affinity and the set of online cpus
  * in the domain's cpupool.
  */
-static inline int __vcpu_has_node_affinity(const struct vcpu *vc,
+static inline int __vcpu_has_soft_affinity(const struct vcpu *vc,
                                            const cpumask_t *mask)
 {
-    const struct domain *d = vc->domain;
-    const struct csched_dom *sdom = CSCHED_DOM(d);
-
-    if ( d->auto_node_affinity
-         || cpumask_full(sdom->node_affinity_cpumask)
-         || !cpumask_intersects(sdom->node_affinity_cpumask, mask) )
+    if ( cpumask_full(vc->cpu_soft_affinity)
+         || !cpumask_intersects(vc->cpu_soft_affinity, mask) )
         return 0;
 
     return 1;
@@ -321,23 +301,22 @@ static inline int __vcpu_has_node_affinity(const struct vcpu *vc,
 
 /*
  * Each csched-balance step uses its own cpumask. This function determines
- * which one (given the step) and copies it in mask. For the node-affinity
- * balancing step, the pcpus that are not part of vc's vcpu-affinity are
+ * which one (given the step) and copies it in mask. For the soft affinity
+ * balancing step, the pcpus that are not part of vc's hard affinity are
  * filtered out from the result, to avoid running a vcpu where it would
  * like, but is not allowed to!
  */
 static void
 csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
 {
-    if ( step == CSCHED_BALANCE_NODE_AFFINITY )
+    if ( step == CSCHED_BALANCE_SOFT_AFFINITY )
     {
-        cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
-                    vc->cpu_hard_affinity);
+        cpumask_and(mask, vc->cpu_soft_affinity, vc->cpu_hard_affinity);
 
         if ( unlikely(cpumask_empty(mask)) )
             cpumask_copy(mask, vc->cpu_hard_affinity);
     }
-    else /* step == CSCHED_BALANCE_CPU_AFFINITY */
+    else /* step == CSCHED_BALANCE_HARD_AFFINITY */
         cpumask_copy(mask, vc->cpu_hard_affinity);
 }
 
@@ -398,15 +377,15 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     else if ( !idlers_empty )
     {
         /*
-         * Node and vcpu-affinity balancing loop. For vcpus without
-         * a useful node-affinity, consider vcpu-affinity only.
+         * Soft and hard affinity balancing loop. For vcpus without
+         * a useful soft affinity, consider hard affinity only.
          */
         for_each_csched_balance_step( balance_step )
         {
             int new_idlers_empty;
 
-            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-                 && !__vcpu_has_node_affinity(new->vcpu,
+            if ( balance_step == CSCHED_BALANCE_SOFT_AFFINITY
+                 && !__vcpu_has_soft_affinity(new->vcpu,
                                               new->vcpu->cpu_hard_affinity) )
                 continue;
 
@@ -418,11 +397,11 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
-             * for new in its node-affinity mask, make sure we check its
-             * vcpu-affinity as well, before taking final decisions.
+             * for new in its soft affinity mask, make sure we check its
+             * hard affinity as well, before taking final decisions.
              */
             if ( new_idlers_empty
-                 && balance_step == CSCHED_BALANCE_NODE_AFFINITY )
+                 && balance_step == CSCHED_BALANCE_SOFT_AFFINITY )
                 continue;
 
             /*
@@ -649,23 +628,23 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
         /*
          * We want to pick up a pcpu among the ones that are online and
          * can accommodate vc, which is basically what we computed above
-         * and stored in cpus. As far as vcpu-affinity is concerned,
+         * and stored in cpus. As far as hard affinity is concerned,
          * there always will be at least one of these pcpus, hence cpus
          * is never empty and the calls to cpumask_cycle() and
          * cpumask_test_cpu() below are ok.
          *
-         * On the other hand, when considering node-affinity too, it
+         * On the other hand, when considering soft affinity too, it
          * is possible for the mask to become empty (for instance, if the
          * domain has been put in a cpupool that does not contain any of the
-         * nodes in its node-affinity), which would result in the ASSERT()-s
+         * pcpus in its soft affinity), which would result in the ASSERT()-s
          * inside cpumask_*() operations triggering (in debug builds).
          *
-         * Therefore, in this case, we filter the node-affinity mask against
-         * cpus and, if the result is empty, we just skip the node-affinity
+         * Therefore, in this case, we filter the soft affinity mask against
+         * cpus and, if the result is empty, we just skip the soft affinity
          * balancing step all together.
          */
-        if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-             && !__vcpu_has_node_affinity(vc, &cpus) )
+        if ( balance_step == CSCHED_BALANCE_SOFT_AFFINITY
+             && !__vcpu_has_soft_affinity(vc, &cpus) )
             continue;
 
         /* Pick an online CPU from the proper affinity mask */
@@ -1122,13 +1101,6 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
     if ( sdom == NULL )
         return NULL;
 
-    if ( !alloc_cpumask_var(&sdom->node_affinity_cpumask) )
-    {
-        xfree(sdom);
-        return NULL;
-    }
-    cpumask_setall(sdom->node_affinity_cpumask);
-
     /* Initialize credit and weight */
     INIT_LIST_HEAD(&sdom->active_vcpu);
     INIT_LIST_HEAD(&sdom->active_sdom_elem);
@@ -1158,9 +1130,6 @@ csched_dom_init(const struct scheduler *ops, struct domain *dom)
 static void
 csched_free_domdata(const struct scheduler *ops, void *data)
 {
-    struct csched_dom *sdom = data;
-
-    free_cpumask_var(sdom->node_affinity_cpumask);
     xfree(data);
 }
 
@@ -1486,19 +1455,19 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
             BUG_ON( is_idle_vcpu(vc) );
 
             /*
-             * If the vcpu has no useful node-affinity, skip this vcpu.
-             * In fact, what we want is to check if we have any node-affine
-             * work to steal, before starting to look at vcpu-affine work.
+             * If the vcpu has no useful soft affinity, skip this vcpu.
+             * In fact, what we want is to check if we have any "soft-affine
+             * work" to steal, before starting to look at "hard-affine work".
              *
              * Notice that, if not even one vCPU on this runq has a useful
-             * node-affinity, we could have avoid considering this runq for
-             * a node balancing step in the first place. This, for instance,
+             * soft affinity, we could have avoid considering this runq for
+             * a soft balancing step in the first place. This, for instance,
              * can be implemented by taking note of on what runq there are
-             * vCPUs with useful node-affinities in some sort of bitmap
+             * vCPUs with useful soft affinities in some sort of bitmap
              * or counter.
              */
-            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-                 && !__vcpu_has_node_affinity(vc, vc->cpu_hard_affinity) )
+            if ( balance_step == CSCHED_BALANCE_SOFT_AFFINITY
+                 && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
             csched_balance_cpumask(vc, balance_step, csched_balance_mask);
@@ -1546,17 +1515,17 @@ csched_load_balance(struct csched_private *prv, int cpu,
         SCHED_STAT_CRANK(load_balance_other);
 
     /*
-     * Let's look around for work to steal, taking both vcpu-affinity
-     * and node-affinity into account. More specifically, we check all
+     * Let's look around for work to steal, taking both hard affinity
+     * and soft affinity into account. More specifically, we check all
      * the non-idle CPUs' runq, looking for:
-     *  1. any node-affine work to steal first,
-     *  2. if not finding anything, any vcpu-affine work to steal.
+     *  1. any "soft-affine work" to steal first,
+     *  2. if not finding anything, any "hard-affine work" to steal.
      */
     for_each_csched_balance_step( bstep )
     {
         /*
          * We peek at the non-idling CPUs in a node-wise fashion. In fact,
-         * it is more likely that we find some node-affine work on our same
+         * it is more likely that we find some affine work on our same
          * node, not to mention that migrating vcpus within the same node
          * could well expected to be cheaper than across-nodes (memory
          * stays local, there might be some node-wide cache[s], etc.).
@@ -1982,8 +1951,6 @@ const struct scheduler sched_credit_def = {
     .adjust         = csched_dom_cntl,
     .adjust_global  = csched_sys_cntl,
 
-    .set_node_affinity  = csched_set_node_affinity,
-
     .pick_cpu       = csched_cpu_pick,
     .do_schedule    = csched_schedule,
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index b579dfa..d76a425 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -198,6 +198,8 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
     else
         cpumask_setall(v->cpu_hard_affinity);
 
+    cpumask_setall(v->cpu_soft_affinity);
+
     /* Initialise the per-vcpu timers. */
     init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
                v, v->processor);
@@ -286,6 +288,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         migrate_timer(&v->poll_timer, new_p);
 
         cpumask_setall(v->cpu_hard_affinity);
+        cpumask_setall(v->cpu_soft_affinity);
 
         lock = vcpu_schedule_lock_irq(v);
         v->processor = new_p;
@@ -645,11 +648,6 @@ int cpu_disable_scheduler(unsigned int cpu)
     return ret;
 }
 
-void sched_set_node_affinity(struct domain *d, nodemask_t *mask)
-{
-    SCHED_OP(DOM2OP(d), set_node_affinity, d, mask);
-}
-
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
     cpumask_t online_affinity;
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index d95e254..4164dff 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -158,8 +158,6 @@ struct scheduler {
                                     struct xen_domctl_scheduler_op *);
     int          (*adjust_global)  (const struct scheduler *,
                                     struct xen_sysctl_scheduler_op *);
-    void         (*set_node_affinity) (const struct scheduler *,
-                                       struct domain *, nodemask_t *);
     void         (*dump_settings)  (const struct scheduler *);
     void         (*dump_cpu_state) (const struct scheduler *, int);
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6f91abd..445b659 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -225,6 +225,9 @@ struct vcpu
     /* Used to restore affinity across S3. */
     cpumask_var_t    cpu_hard_affinity_saved;
 
+    /* Bitmask of CPUs on which this VCPU prefers to run. */
+    cpumask_var_t    cpu_soft_affinity;
+
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
 
@@ -627,7 +630,6 @@ void sched_destroy_domain(struct domain *d);
 int sched_move_domain(struct domain *d, struct cpupool *c);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
-void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:46 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:46 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJC-0003AX-0j; Thu, 19 Jun 2014 04:50:46 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJA-0003AI-BD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:44 +0000
Received: from [85.158.139.211:34889] by server-4.bemta-5.messagelabs.com id
	CD/A7-07250-32C62A35; Thu, 19 Jun 2014 04:50:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403153440!7884936!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22687 invoked from network); 19 Jun 2014 04:50:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:50:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJ6-0002ho-9p
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJ6-0008GB-86
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:40 +0000
Date: Thu, 19 Jun 2014 04:50:40 +0000
Message-Id: <E1WxUJ6-0008GB-86@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: introduce soft-affinity and use
	it instead d->node-affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit db6b2215910327cd4401868c67a44680932c1f2a
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:12:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:12:28 2014 +0200

    sched: introduce soft-affinity and use it instead d->node-affinity
    
    Before this change, each vcpu had its own vcpu-affinity
    (in v->cpu_affinity), representing the set of pcpus where
    the vcpu is allowed to run. Since when NUMA-aware scheduling
    was introduced the (credit1 only, for now) scheduler also
    tries as much as it can to run all the vcpus of a domain
    on one of the nodes that constitutes the domain's
    node-affinity.
    
    The idea here is making the mechanism more general by:
      * allowing for this 'preference' for some pcpus/nodes to be
        expressed on a per-vcpu basis, instead than for the domain
        as a whole. That is to say, each vcpu should have its own
        set of preferred pcpus/nodes, instead than it being the
        very same for all the vcpus of the domain;
      * generalizing the idea of 'preferred pcpus' to not only NUMA
        awareness and support. That is to say, independently from
        it being or not (mostly) useful on NUMA systems, it should
        be possible to specify, for each vcpu, a set of pcpus where
        it prefers to run (in addition, and possibly unrelated to,
        the set of pcpus where it is allowed to run).
    
    We will be calling this set of *preferred* pcpus the vcpu's
    soft affinity, and this changes introduce it, and starts using it
    for scheduling, replacing the indirect use of the domain's NUMA
    node-affinity. This is more general, as soft affinity does not
    have to be related to NUMA. Nevertheless, it allows to achieve the
    same results of NUMA-aware scheduling, just by making soft affinity
    equal to the domain's node affinity, for all the vCPUs (e.g.,
    from the toolstack).
    
    This also means renaming most of the NUMA-aware scheduling related
    functions, in credit1, to something more generic, hinting toward
    the concept of soft affinity rather than directly to NUMA awareness.
    
    As a side effects, this simplifies the code quit a bit. In fact,
    prior to this change, we needed to cache the translation of
    d->node_affinity (which is a nodemask_t) to a cpumask_t, since that
    is what scheduling decisions require (we used to keep it in
    node_affinity_cpumask). This, and all the complicated logic
    required to keep it updated, is not necessary any longer.
    
    The high level description of NUMA placement and scheduling in
    docs/misc/xl-numa-placement.markdown is being updated too, to match
    the new architecture.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 docs/misc/xl-numa-placement.markdown |  148 +++++++++++++++++++++-----------
 xen/common/domain.c                  |    5 +-
 xen/common/keyhandler.c              |    2 +
 xen/common/sched_credit.c            |  153 +++++++++++++--------------------
 xen/common/schedule.c                |    8 +-
 xen/include/xen/sched-if.h           |    2 -
 xen/include/xen/sched.h              |    4 +-
 7 files changed, 168 insertions(+), 154 deletions(-)

diff --git a/docs/misc/xl-numa-placement.markdown b/docs/misc/xl-numa-placement.markdown
index caa3fec..9d64eae 100644
--- a/docs/misc/xl-numa-placement.markdown
+++ b/docs/misc/xl-numa-placement.markdown
@@ -12,13 +12,6 @@ is quite more complex and slow. On these machines, a NUMA node is usually
 defined as a set of processor cores (typically a physical CPU package) and
 the memory directly attached to the set of cores.
 
-The Xen hypervisor deals with NUMA machines by assigning to each domain
-a "node affinity", i.e., a set of NUMA nodes of the host from which they
-get their memory allocated. Also, even if the node affinity of a domain
-is allowed to change on-line, it is very important to "place" the domain
-correctly when it is fist created, as the most of its memory is allocated
-at that time and can not (for now) be moved easily.
-
 NUMA awareness becomes very important as soon as many domains start
 running memory-intensive workloads on a shared host. In fact, the cost
 of accessing non node-local memory locations is very high, and the
@@ -27,14 +20,37 @@ performance degradation is likely to be noticeable.
 For more information, have a look at the [Xen NUMA Introduction][numa_intro]
 page on the Wiki.
 
+## Xen and NUMA machines: the concept of _node-affinity_ ##
+
+The Xen hypervisor deals with NUMA machines throughout the concept of
+_node-affinity_. The node-affinity of a domain is the set of NUMA nodes
+of the host where the memory for the domain is being allocated (mostly,
+at domain creation time). This is, at least in principle, different and
+unrelated with the vCPU (hard and soft, see below) scheduling affinity,
+which instead is the set of pCPUs where the vCPU is allowed (or prefers)
+to run.
+
+Of course, despite the fact that they belong to and affect different
+subsystems, the domain node-affinity and the vCPUs affinity are not
+completely independent.
+In fact, if the domain node-affinity is not explicitly specified by the
+user, via the proper libxl calls or xl config item, it will be computed
+basing on the vCPUs' scheduling affinity.
+
+Notice that, even if the node affinity of a domain may change on-line,
+it is very important to "place" the domain correctly when it is fist
+created, as the most of its memory is allocated at that time and can
+not (for now) be moved easily.
+
 ### Placing via pinning and cpupools ###
 
-The simplest way of placing a domain on a NUMA node is statically pinning
-the domain's vCPUs to the pCPUs of the node. This goes under the name of
-CPU affinity and can be set through the "cpus=" option in the config file
-(more about this below). Another option is to pool together the pCPUs
-spanning the node and put the domain in such a cpupool with the "pool="
-config option (as documented in our [Wiki][cpupools_howto]).
+The simplest way of placing a domain on a NUMA node is setting the hard
+scheduling affinity of the domain's vCPUs to the pCPUs of the node. This
+also goes under the name of vCPU pinning, and can be done through the
+"cpus=" option in the config file (more about this below). Another option
+is to pool together the pCPUs spanning the node and put the domain in
+such a _cpupool_ with the "pool=" config option (as documented in our
+[Wiki][cpupools_howto]).
 
 In both the above cases, the domain will not be able to execute outside
 the specified set of pCPUs for any reasons, even if all those pCPUs are
@@ -45,24 +61,45 @@ may come at he cost of some load imbalances.
 
 ### NUMA aware scheduling ###
 
-If the credit scheduler is in use, the concept of node affinity defined
-above does not only apply to memory. In fact, starting from Xen 4.3, the
-scheduler always tries to run the domain's vCPUs on one of the nodes in
-its node affinity. Only if that turns out to be impossible, it will just
-pick any free pCPU.
-
-This is, therefore, something more flexible than CPU affinity, as a domain
-can still run everywhere, it just prefers some nodes rather than others.
-Locality of access is less guaranteed than in the pinning case, but that
-comes along with better chances to exploit all the host resources (e.g.,
-the pCPUs).
-
-In fact, if all the pCPUs in a domain's node affinity are busy, it is
-possible for the domain to run outside of there, but it is very likely that
-slower execution (due to remote memory accesses) is still better than no
-execution at all, as it would happen with pinning. For this reason, NUMA
-aware scheduling has the potential of bringing substantial performances
-benefits, although this will depend on the workload.
+If using the credit1 scheduler, and starting from Xen 4.3, the scheduler
+itself always tries to run the domain's vCPUs on one of the nodes in
+its node-affinity. Only if that turns out to be impossible, it will just
+pick any free pCPU. Locality of access is less guaranteed than in the
+pinning case, but that comes along with better chances to exploit all
+the host resources (e.g., the pCPUs).
+
+Starting from Xen 4.5, credit1 supports two forms of affinity: hard and
+soft, both on a per-vCPU basis. This means each vCPU can have its own
+soft affinity, stating where such vCPU prefers to execute on. This is
+less strict than what it (also starting from 4.5) is called hard affinity,
+as the vCPU can potentially run everywhere, it just prefers some pCPUs
+rather than others.
+In Xen 4.5, therefore, NUMA-aware scheduling is achieved by matching the
+soft affinity of the vCPUs of a domain with its node-affinity.
+
+In fact, as it was for 4.3, if all the pCPUs in a vCPU's soft affinity
+are busy, it is possible for the domain to run outside from there. The
+idea is that slower execution (due to remote memory accesses) is still
+better than no execution at all (as it would happen with pinning). For
+this reason, NUMA aware scheduling has the potential of bringing
+substantial performances benefits, although this will depend on the
+workload.
+
+Notice that, for each vCPU, the following three scenarios are possbile:
+
+  * a vCPU *is pinned* to some pCPUs and *does not have* any soft affinity
+    In this case, the vCPU is always scheduled on one of the pCPUs to which
+    it is pinned, without any specific peference among them.
+  * a vCPU *has* its own soft affinity and *is not* pinned to any particular
+    pCPU. In this case, the vCPU can run on every pCPU. Nevertheless, the
+    scheduler will try to have it running on one of the pCPUs in its soft
+    affinity;
+  * a vCPU *has* its own vCPU soft affinity and *is also* pinned to some
+    pCPUs. In this case, the vCPU is always scheduled on one of the pCPUs
+    onto which it is pinned, with, among them, a preference for the ones
+    that also forms its soft affinity. In case pinning and soft affinity
+    form two disjoint sets of pCPUs, pinning "wins", and the soft affinity
+    is just ignored.
 
 ## Guest placement in xl ##
 
@@ -71,25 +108,23 @@ both manual or automatic placement of them across the host's NUMA nodes.
 
 Note that xm/xend does a very similar thing, the only differences being
 the details of the heuristics adopted for automatic placement (see below),
-and the lack of support (in both xm/xend and the Xen versions where that\
+and the lack of support (in both xm/xend and the Xen versions where that
 was the default toolstack) for NUMA aware scheduling.
 
 ### Placing the guest manually ###
 
 Thanks to the "cpus=" option, it is possible to specify where a domain
 should be created and scheduled on, directly in its config file. This
-affects NUMA placement and memory accesses as the hypervisor constructs
-the node affinity of a VM basing right on its CPU affinity when it is
-created.
+affects NUMA placement and memory accesses as, in this case, the
+hypervisor constructs the node-affinity of a VM basing right on its
+vCPU pinning when it is created.
 
 This is very simple and effective, but requires the user/system
-administrator to explicitly specify affinities for each and every domain,
+administrator to explicitly specify the pinning for each and every domain,
 or Xen won't be able to guarantee the locality for their memory accesses.
 
-Notice that this also pins the domain's vCPUs to the specified set of
-pCPUs, so it not only sets the domain's node affinity (its memory will
-come from the nodes to which the pCPUs belong), but at the same time
-forces the vCPUs of the domain to be scheduled on those same pCPUs.
+That, of course, also mean the vCPUs of the domain will only be able to
+execute on those same pCPUs.
 
 ### Placing the guest automatically ###
 
@@ -97,7 +132,9 @@ If no "cpus=" option is specified in the config file, libxl tries
 to figure out on its own on which node(s) the domain could fit best.
 If it finds one (some), the domain's node affinity get set to there,
 and both memory allocations and NUMA aware scheduling (for the credit
-scheduler and starting from Xen 4.3) will comply with it.
+scheduler and starting from Xen 4.3) will comply with it. Starting from
+Xen 4.5, this also means that the mask resulting from this "fitting"
+procedure will become the soft affinity of all the vCPUs of the domain.
 
 It is worthwhile noting that optimally fitting a set of VMs on the NUMA
 nodes of an host is an incarnation of the Bin Packing Problem. In fact,
@@ -142,34 +179,43 @@ any placement from happening:
 
     libxl_defbool_set(&domain_build_info->numa_placement, false);
 
-Also, if `numa_placement` is set to `true`, the domain must not
-have any CPU affinity (i.e., `domain_build_info->cpumap` must
-have all its bits set, as it is by default), or domain creation
-will fail returning `ERROR_INVAL`.
+Also, if `numa_placement` is set to `true`, the domain's vCPUs must
+not be pinned (i.e., `domain_build_info->cpumap` must have all its
+bits set, as it is by default), or domain creation will fail with
+`ERROR_INVAL`.
 
 Starting from Xen 4.3, in case automatic placement happens (and is
-successful), it will affect the domain's node affinity and _not_ its
-CPU affinity. Namely, the domain's vCPUs will not be pinned to any
+successful), it will affect the domain's node-affinity and _not_ its
+vCPU pinning. Namely, the domain's vCPUs will not be pinned to any
 pCPU on the host, but the memory from the domain will come from the
 selected node(s) and the NUMA aware scheduling (if the credit scheduler
-is in use) will try to keep the domain there as much as possible.
+is in use) will try to keep the domain's vCPUs there as much as possible.
 
 Besides than that, looking and/or tweaking the placement algorithm
 search "Automatic NUMA placement" in libxl\_internal.h.
 
 Note this may change in future versions of Xen/libxl.
 
+## Xen < 4.5 ##
+
+The concept of vCPU soft affinity has been introduced for the first time
+in Xen 4.5. In 4.3, it is the domain's node-affinity that drives the
+NUMA-aware scheduler. The main difference is soft affinity is per-vCPU,
+and so each vCPU can have its own mask of pCPUs, while node-affinity is
+per-domain, that is the equivalent of having all the vCPUs with the same
+soft affinity.
+
 ## Xen < 4.3 ##
 
 As NUMA aware scheduling is a new feature of Xen 4.3, things are a little
 bit different for earlier version of Xen. If no "cpus=" option is specified
 and Xen 4.2 is in use, the automatic placement algorithm still runs, but
 the results is used to _pin_ the vCPUs of the domain to the output node(s).
-This is consistent with what was happening with xm/xend, which were also
-affecting the domain's CPU affinity.
+This is consistent with what was happening with xm/xend.
 
 On a version of Xen earlier than 4.2, there is not automatic placement at
-all in xl or libxl, and hence no node or CPU affinity being affected.
+all in xl or libxl, and hence no node-affinity, vCPU affinity or pinning
+being introduced/modified.
 
 ## Limitations ##
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 141a5dc..e20d3bf 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -128,6 +128,7 @@ struct vcpu *alloc_vcpu(
     if ( !zalloc_cpumask_var(&v->cpu_hard_affinity) ||
          !zalloc_cpumask_var(&v->cpu_hard_affinity_tmp) ||
          !zalloc_cpumask_var(&v->cpu_hard_affinity_saved) ||
+         !zalloc_cpumask_var(&v->cpu_soft_affinity) ||
          !zalloc_cpumask_var(&v->vcpu_dirty_cpumask) )
         goto fail_free;
 
@@ -159,6 +160,7 @@ struct vcpu *alloc_vcpu(
         free_cpumask_var(v->cpu_hard_affinity);
         free_cpumask_var(v->cpu_hard_affinity_tmp);
         free_cpumask_var(v->cpu_hard_affinity_saved);
+        free_cpumask_var(v->cpu_soft_affinity);
         free_cpumask_var(v->vcpu_dirty_cpumask);
         free_vcpu_struct(v);
         return NULL;
@@ -446,8 +448,6 @@ void domain_update_node_affinity(struct domain *d)
                 node_set(node, d->node_affinity);
     }
 
-    sched_set_node_affinity(d, &d->node_affinity);
-
     spin_unlock(&d->node_affinity_lock);
 
     free_cpumask_var(online_affinity);
@@ -795,6 +795,7 @@ static void complete_domain_destroy(struct rcu_head *head)
             free_cpumask_var(v->cpu_hard_affinity);
             free_cpumask_var(v->cpu_hard_affinity_tmp);
             free_cpumask_var(v->cpu_hard_affinity_saved);
+            free_cpumask_var(v->cpu_soft_affinity);
             free_cpumask_var(v->vcpu_dirty_cpumask);
             free_vcpu_struct(v);
         }
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index d6eb026..809378c 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -297,6 +297,8 @@ static void dump_domains(unsigned char key)
             printk("dirty_cpus=%s ", tmpstr);
             cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_hard_affinity);
             printk("cpu_affinity=%s\n", tmpstr);
+            cpuset_print(tmpstr, sizeof(tmpstr), v->cpu_soft_affinity);
+            printk("cpu_soft_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);
diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index c6a2560..8b02b7b 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -112,10 +112,24 @@
 
 
 /*
- * Node Balancing
+ * Hard and soft affinity load balancing.
+ *
+ * Idea is each vcpu has some pcpus that it prefers, some that it does not
+ * prefer but is OK with, and some that it cannot run on at all. The first
+ * set of pcpus are the ones that are both in the soft affinity *and* in the
+ * hard affinity; the second set of pcpus are the ones that are in the hard
+ * affinity but *not* in the soft affinity; the third set of pcpus are the
+ * ones that are not in the hard affinity.
+ *
+ * We implement a two step balancing logic. Basically, every time there is
+ * the need to decide where to run a vcpu, we first check the soft affinity
+ * (well, actually, the && between soft and hard affinity), to see if we can
+ * send it where it prefers to (and can) run on. However, if the first step
+ * does not find any suitable and free pcpu, we fall back checking the hard
+ * affinity.
  */
-#define CSCHED_BALANCE_NODE_AFFINITY    0
-#define CSCHED_BALANCE_CPU_AFFINITY     1
+#define CSCHED_BALANCE_SOFT_AFFINITY    0
+#define CSCHED_BALANCE_HARD_AFFINITY    1
 
 /*
  * Boot parameters
@@ -138,7 +152,7 @@ struct csched_pcpu {
 
 /*
  * Convenience macro for accessing the per-PCPU cpumask we need for
- * implementing the two steps (vcpu and node affinity) balancing logic.
+ * implementing the two steps (soft and hard affinity) balancing logic.
  * It is stored in csched_pcpu so that serialization is not an issue,
  * as there is a csched_pcpu for each PCPU and we always hold the
  * runqueue spin-lock when using this.
@@ -178,9 +192,6 @@ struct csched_dom {
     struct list_head active_vcpu;
     struct list_head active_sdom_elem;
     struct domain *dom;
-    /* cpumask translated from the domain's node-affinity.
-     * Basically, the CPUs we prefer to be scheduled on. */
-    cpumask_var_t node_affinity_cpumask;
     uint16_t active_vcpu_count;
     uint16_t weight;
     uint16_t cap;
@@ -261,59 +272,28 @@ __runq_remove(struct csched_vcpu *svc)
     list_del_init(&svc->runq_elem);
 }
 
-/*
- * Translates node-affinity mask into a cpumask, so that we can use it during
- * actual scheduling. That of course will contain all the cpus from all the
- * set nodes in the original node-affinity mask.
- *
- * Note that any serialization needed to access mask safely is complete
- * responsibility of the caller of this function/hook.
- */
-static void csched_set_node_affinity(
-    const struct scheduler *ops,
-    struct domain *d,
-    nodemask_t *mask)
-{
-    struct csched_dom *sdom;
-    int node;
-
-    /* Skip idle domain since it doesn't even have a node_affinity_cpumask */
-    if ( unlikely(is_idle_domain(d)) )
-        return;
-
-    sdom = CSCHED_DOM(d);
-    cpumask_clear(sdom->node_affinity_cpumask);
-    for_each_node_mask( node, *mask )
-        cpumask_or(sdom->node_affinity_cpumask, sdom->node_affinity_cpumask,
-                   &node_to_cpumask(node));
-}
 
 #define for_each_csched_balance_step(step) \
-    for ( (step) = 0; (step) <= CSCHED_BALANCE_CPU_AFFINITY; (step)++ )
+    for ( (step) = 0; (step) <= CSCHED_BALANCE_HARD_AFFINITY; (step)++ )
 
 
 /*
- * vcpu-affinity balancing is always necessary and must never be skipped.
- * OTOH, if a domain's node-affinity is said to be automatically computed
- * (or if it just spans all the nodes), we can safely avoid dealing with
- * node-affinity entirely.
+ * Hard affinity balancing is always necessary and must never be skipped.
+ * OTOH, if the vcpu's soft affinity is full (it spans all the possible
+ * pcpus) we can safely avoid dealing with it entirely.
  *
- * Node-affinity is also deemed meaningless in case it has empty
- * intersection with mask, to cover the cases where using the node-affinity
+ * A vcpu's soft affinity is also deemed meaningless in case it has empty
+ * intersection with mask, to cover the cases where using the soft affinity
  * mask seems legit, but would instead led to trying to schedule the vcpu
  * on _no_ pcpu! Typical use cases are for mask to be equal to the vcpu's
- * vcpu-affinity, or to the && of vcpu-affinity and the set of online cpus
+ * hard affinity, or to the && of hard affinity and the set of online cpus
  * in the domain's cpupool.
  */
-static inline int __vcpu_has_node_affinity(const struct vcpu *vc,
+static inline int __vcpu_has_soft_affinity(const struct vcpu *vc,
                                            const cpumask_t *mask)
 {
-    const struct domain *d = vc->domain;
-    const struct csched_dom *sdom = CSCHED_DOM(d);
-
-    if ( d->auto_node_affinity
-         || cpumask_full(sdom->node_affinity_cpumask)
-         || !cpumask_intersects(sdom->node_affinity_cpumask, mask) )
+    if ( cpumask_full(vc->cpu_soft_affinity)
+         || !cpumask_intersects(vc->cpu_soft_affinity, mask) )
         return 0;
 
     return 1;
@@ -321,23 +301,22 @@ static inline int __vcpu_has_node_affinity(const struct vcpu *vc,
 
 /*
  * Each csched-balance step uses its own cpumask. This function determines
- * which one (given the step) and copies it in mask. For the node-affinity
- * balancing step, the pcpus that are not part of vc's vcpu-affinity are
+ * which one (given the step) and copies it in mask. For the soft affinity
+ * balancing step, the pcpus that are not part of vc's hard affinity are
  * filtered out from the result, to avoid running a vcpu where it would
  * like, but is not allowed to!
  */
 static void
 csched_balance_cpumask(const struct vcpu *vc, int step, cpumask_t *mask)
 {
-    if ( step == CSCHED_BALANCE_NODE_AFFINITY )
+    if ( step == CSCHED_BALANCE_SOFT_AFFINITY )
     {
-        cpumask_and(mask, CSCHED_DOM(vc->domain)->node_affinity_cpumask,
-                    vc->cpu_hard_affinity);
+        cpumask_and(mask, vc->cpu_soft_affinity, vc->cpu_hard_affinity);
 
         if ( unlikely(cpumask_empty(mask)) )
             cpumask_copy(mask, vc->cpu_hard_affinity);
     }
-    else /* step == CSCHED_BALANCE_CPU_AFFINITY */
+    else /* step == CSCHED_BALANCE_HARD_AFFINITY */
         cpumask_copy(mask, vc->cpu_hard_affinity);
 }
 
@@ -398,15 +377,15 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
     else if ( !idlers_empty )
     {
         /*
-         * Node and vcpu-affinity balancing loop. For vcpus without
-         * a useful node-affinity, consider vcpu-affinity only.
+         * Soft and hard affinity balancing loop. For vcpus without
+         * a useful soft affinity, consider hard affinity only.
          */
         for_each_csched_balance_step( balance_step )
         {
             int new_idlers_empty;
 
-            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-                 && !__vcpu_has_node_affinity(new->vcpu,
+            if ( balance_step == CSCHED_BALANCE_SOFT_AFFINITY
+                 && !__vcpu_has_soft_affinity(new->vcpu,
                                               new->vcpu->cpu_hard_affinity) )
                 continue;
 
@@ -418,11 +397,11 @@ __runq_tickle(unsigned int cpu, struct csched_vcpu *new)
 
             /*
              * Let's not be too harsh! If there aren't idlers suitable
-             * for new in its node-affinity mask, make sure we check its
-             * vcpu-affinity as well, before taking final decisions.
+             * for new in its soft affinity mask, make sure we check its
+             * hard affinity as well, before taking final decisions.
              */
             if ( new_idlers_empty
-                 && balance_step == CSCHED_BALANCE_NODE_AFFINITY )
+                 && balance_step == CSCHED_BALANCE_SOFT_AFFINITY )
                 continue;
 
             /*
@@ -649,23 +628,23 @@ _csched_cpu_pick(const struct scheduler *ops, struct vcpu *vc, bool_t commit)
         /*
          * We want to pick up a pcpu among the ones that are online and
          * can accommodate vc, which is basically what we computed above
-         * and stored in cpus. As far as vcpu-affinity is concerned,
+         * and stored in cpus. As far as hard affinity is concerned,
          * there always will be at least one of these pcpus, hence cpus
          * is never empty and the calls to cpumask_cycle() and
          * cpumask_test_cpu() below are ok.
          *
-         * On the other hand, when considering node-affinity too, it
+         * On the other hand, when considering soft affinity too, it
          * is possible for the mask to become empty (for instance, if the
          * domain has been put in a cpupool that does not contain any of the
-         * nodes in its node-affinity), which would result in the ASSERT()-s
+         * pcpus in its soft affinity), which would result in the ASSERT()-s
          * inside cpumask_*() operations triggering (in debug builds).
          *
-         * Therefore, in this case, we filter the node-affinity mask against
-         * cpus and, if the result is empty, we just skip the node-affinity
+         * Therefore, in this case, we filter the soft affinity mask against
+         * cpus and, if the result is empty, we just skip the soft affinity
          * balancing step all together.
          */
-        if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-             && !__vcpu_has_node_affinity(vc, &cpus) )
+        if ( balance_step == CSCHED_BALANCE_SOFT_AFFINITY
+             && !__vcpu_has_soft_affinity(vc, &cpus) )
             continue;
 
         /* Pick an online CPU from the proper affinity mask */
@@ -1122,13 +1101,6 @@ csched_alloc_domdata(const struct scheduler *ops, struct domain *dom)
     if ( sdom == NULL )
         return NULL;
 
-    if ( !alloc_cpumask_var(&sdom->node_affinity_cpumask) )
-    {
-        xfree(sdom);
-        return NULL;
-    }
-    cpumask_setall(sdom->node_affinity_cpumask);
-
     /* Initialize credit and weight */
     INIT_LIST_HEAD(&sdom->active_vcpu);
     INIT_LIST_HEAD(&sdom->active_sdom_elem);
@@ -1158,9 +1130,6 @@ csched_dom_init(const struct scheduler *ops, struct domain *dom)
 static void
 csched_free_domdata(const struct scheduler *ops, void *data)
 {
-    struct csched_dom *sdom = data;
-
-    free_cpumask_var(sdom->node_affinity_cpumask);
     xfree(data);
 }
 
@@ -1486,19 +1455,19 @@ csched_runq_steal(int peer_cpu, int cpu, int pri, int balance_step)
             BUG_ON( is_idle_vcpu(vc) );
 
             /*
-             * If the vcpu has no useful node-affinity, skip this vcpu.
-             * In fact, what we want is to check if we have any node-affine
-             * work to steal, before starting to look at vcpu-affine work.
+             * If the vcpu has no useful soft affinity, skip this vcpu.
+             * In fact, what we want is to check if we have any "soft-affine
+             * work" to steal, before starting to look at "hard-affine work".
              *
              * Notice that, if not even one vCPU on this runq has a useful
-             * node-affinity, we could have avoid considering this runq for
-             * a node balancing step in the first place. This, for instance,
+             * soft affinity, we could have avoid considering this runq for
+             * a soft balancing step in the first place. This, for instance,
              * can be implemented by taking note of on what runq there are
-             * vCPUs with useful node-affinities in some sort of bitmap
+             * vCPUs with useful soft affinities in some sort of bitmap
              * or counter.
              */
-            if ( balance_step == CSCHED_BALANCE_NODE_AFFINITY
-                 && !__vcpu_has_node_affinity(vc, vc->cpu_hard_affinity) )
+            if ( balance_step == CSCHED_BALANCE_SOFT_AFFINITY
+                 && !__vcpu_has_soft_affinity(vc, vc->cpu_hard_affinity) )
                 continue;
 
             csched_balance_cpumask(vc, balance_step, csched_balance_mask);
@@ -1546,17 +1515,17 @@ csched_load_balance(struct csched_private *prv, int cpu,
         SCHED_STAT_CRANK(load_balance_other);
 
     /*
-     * Let's look around for work to steal, taking both vcpu-affinity
-     * and node-affinity into account. More specifically, we check all
+     * Let's look around for work to steal, taking both hard affinity
+     * and soft affinity into account. More specifically, we check all
      * the non-idle CPUs' runq, looking for:
-     *  1. any node-affine work to steal first,
-     *  2. if not finding anything, any vcpu-affine work to steal.
+     *  1. any "soft-affine work" to steal first,
+     *  2. if not finding anything, any "hard-affine work" to steal.
      */
     for_each_csched_balance_step( bstep )
     {
         /*
          * We peek at the non-idling CPUs in a node-wise fashion. In fact,
-         * it is more likely that we find some node-affine work on our same
+         * it is more likely that we find some affine work on our same
          * node, not to mention that migrating vcpus within the same node
          * could well expected to be cheaper than across-nodes (memory
          * stays local, there might be some node-wide cache[s], etc.).
@@ -1982,8 +1951,6 @@ const struct scheduler sched_credit_def = {
     .adjust         = csched_dom_cntl,
     .adjust_global  = csched_sys_cntl,
 
-    .set_node_affinity  = csched_set_node_affinity,
-
     .pick_cpu       = csched_cpu_pick,
     .do_schedule    = csched_schedule,
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index b579dfa..d76a425 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -198,6 +198,8 @@ int sched_init_vcpu(struct vcpu *v, unsigned int processor)
     else
         cpumask_setall(v->cpu_hard_affinity);
 
+    cpumask_setall(v->cpu_soft_affinity);
+
     /* Initialise the per-vcpu timers. */
     init_timer(&v->periodic_timer, vcpu_periodic_timer_fn,
                v, v->processor);
@@ -286,6 +288,7 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         migrate_timer(&v->poll_timer, new_p);
 
         cpumask_setall(v->cpu_hard_affinity);
+        cpumask_setall(v->cpu_soft_affinity);
 
         lock = vcpu_schedule_lock_irq(v);
         v->processor = new_p;
@@ -645,11 +648,6 @@ int cpu_disable_scheduler(unsigned int cpu)
     return ret;
 }
 
-void sched_set_node_affinity(struct domain *d, nodemask_t *mask)
-{
-    SCHED_OP(DOM2OP(d), set_node_affinity, d, mask);
-}
-
 int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
 {
     cpumask_t online_affinity;
diff --git a/xen/include/xen/sched-if.h b/xen/include/xen/sched-if.h
index d95e254..4164dff 100644
--- a/xen/include/xen/sched-if.h
+++ b/xen/include/xen/sched-if.h
@@ -158,8 +158,6 @@ struct scheduler {
                                     struct xen_domctl_scheduler_op *);
     int          (*adjust_global)  (const struct scheduler *,
                                     struct xen_sysctl_scheduler_op *);
-    void         (*set_node_affinity) (const struct scheduler *,
-                                       struct domain *, nodemask_t *);
     void         (*dump_settings)  (const struct scheduler *);
     void         (*dump_cpu_state) (const struct scheduler *, int);
 
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 6f91abd..445b659 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -225,6 +225,9 @@ struct vcpu
     /* Used to restore affinity across S3. */
     cpumask_var_t    cpu_hard_affinity_saved;
 
+    /* Bitmask of CPUs on which this VCPU prefers to run. */
+    cpumask_var_t    cpu_soft_affinity;
+
     /* Bitmask of CPUs which are holding onto this VCPU's state. */
     cpumask_var_t    vcpu_dirty_cpumask;
 
@@ -627,7 +630,6 @@ void sched_destroy_domain(struct domain *d);
 int sched_move_domain(struct domain *d, struct cpupool *c);
 long sched_adjust(struct domain *, struct xen_domctl_scheduler_op *);
 long sched_adjust_global(struct xen_sysctl_scheduler_op *);
-void sched_set_node_affinity(struct domain *, nodemask_t *);
 int  sched_id(void);
 void sched_tick_suspend(void);
 void sched_tick_resume(void);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJK-0003CB-6c; Thu, 19 Jun 2014 04:50:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJJ-0003Bn-5r
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:53 +0000
Received: from [193.109.254.147:41725] by server-5.bemta-14.messagelabs.com id
	C3/63-26413-C2C62A35; Thu, 19 Jun 2014 04:50:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403153450!7610815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6738 invoked from network); 19 Jun 2014 04:50:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:50:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJG-0002i2-JW
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJG-0008Gj-F1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:50 +0000
Date: Thu, 19 Jun 2014 04:50:50 +0000
Message-Id: <E1WxUJG-0008Gj-F1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] derive NUMA node affinity from hard
	and soft CPU affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf508bd2fb83b51f8547d1969629e05b6b87d1c5
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:13:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:13:03 2014 +0200

    derive NUMA node affinity from hard and soft CPU affinity
    
    if a domain's NUMA node-affinity (which is what controls
    memory allocations) is provided by the user/toolstack, it
    just is not touched. However, if the user does not say
    anything, leaving it all to Xen, let's compute it in the
    following way:
    
     1. cpupool's cpus & hard-affinity & soft-affinity
     2. if (1) is empty: cpupool's cpus & hard-affinity
    
    This guarantees memory to be allocated from the narrowest
    possible set of NUMA nodes, ad makes it relatively easy to
    set up NUMA-aware scheduling on top of soft affinity.
    
    Note that such 'narrowest set' is guaranteed to be non-empty.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c   |   61 +++++++++++++++++++++++++++++++-----------------
 xen/common/schedule.c |    4 ++-
 2 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index e20d3bf..c3a576e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -409,17 +409,17 @@ struct domain *domain_create(
 
 void domain_update_node_affinity(struct domain *d)
 {
-    cpumask_var_t cpumask;
-    cpumask_var_t online_affinity;
+    cpumask_var_t dom_cpumask, dom_cpumask_soft;
+    cpumask_t *dom_affinity;
     const cpumask_t *online;
     struct vcpu *v;
-    unsigned int node;
+    unsigned int cpu;
 
-    if ( !zalloc_cpumask_var(&cpumask) )
+    if ( !zalloc_cpumask_var(&dom_cpumask) )
         return;
-    if ( !alloc_cpumask_var(&online_affinity) )
+    if ( !zalloc_cpumask_var(&dom_cpumask_soft) )
     {
-        free_cpumask_var(cpumask);
+        free_cpumask_var(dom_cpumask);
         return;
     }
 
@@ -427,31 +427,48 @@ void domain_update_node_affinity(struct domain *d)
 
     spin_lock(&d->node_affinity_lock);
 
-    for_each_vcpu ( d, v )
-    {
-        cpumask_and(online_affinity, v->cpu_hard_affinity, online);
-        cpumask_or(cpumask, cpumask, online_affinity);
-    }
-
     /*
-     * If d->auto_node_affinity is true, the domain's node-affinity mask
-     * (d->node_affinity) is automaically computed from all the domain's
-     * vcpus' vcpu-affinity masks (the union of which we have just built
-     * above in cpumask). OTOH, if d->auto_node_affinity is false, we
-     * must leave the node-affinity of the domain alone.
+     * If d->auto_node_affinity is true, let's compute the domain's
+     * node-affinity and update d->node_affinity accordingly. if false,
+     * just leave d->auto_node_affinity alone.
      */
     if ( d->auto_node_affinity )
     {
+        /*
+         * We want the narrowest possible set of pcpus (to get the narowest
+         * possible set of nodes). What we need is the cpumask of where the
+         * domain can run (the union of the hard affinity of all its vcpus),
+         * and the full mask of where it would prefer to run (the union of
+         * the soft affinity of all its various vcpus). Let's build them.
+         */
+        for_each_vcpu ( d, v )
+        {
+            cpumask_or(dom_cpumask, dom_cpumask, v->cpu_hard_affinity);
+            cpumask_or(dom_cpumask_soft, dom_cpumask_soft,
+                       v->cpu_soft_affinity);
+        }
+        /* Filter out non-online cpus */
+        cpumask_and(dom_cpumask, dom_cpumask, online);
+        ASSERT(!cpumask_empty(dom_cpumask));
+        /* And compute the intersection between hard, online and soft */
+        cpumask_and(dom_cpumask_soft, dom_cpumask_soft, dom_cpumask);
+
+        /*
+         * If not empty, the intersection of hard, soft and online is the
+         * narrowest set we want. If empty, we fall back to hard&online.
+         */
+        dom_affinity = cpumask_empty(dom_cpumask_soft) ?
+                           dom_cpumask : dom_cpumask_soft;
+
         nodes_clear(d->node_affinity);
-        for_each_online_node ( node )
-            if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
-                node_set(node, d->node_affinity);
+        for_each_cpu ( cpu, dom_affinity )
+            node_set(cpu_to_node(cpu), d->node_affinity);
     }
 
     spin_unlock(&d->node_affinity_lock);
 
-    free_cpumask_var(online_affinity);
-    free_cpumask_var(cpumask);
+    free_cpumask_var(dom_cpumask_soft);
+    free_cpumask_var(dom_cpumask);
 }
 
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index d76a425..e57cd91 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -310,7 +310,9 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         SCHED_OP(old_ops, free_vdata, vcpudata);
     }
 
-    domain_update_node_affinity(d);
+    /* Do we have vcpus already? If not, no need to update node-affinity */
+    if ( d->vcpu )
+        domain_update_node_affinity(d);
 
     domain_unpause(d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:50:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:50:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJK-0003CB-6c; Thu, 19 Jun 2014 04:50:54 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJJ-0003Bn-5r
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:53 +0000
Received: from [193.109.254.147:41725] by server-5.bemta-14.messagelabs.com id
	C3/63-26413-C2C62A35; Thu, 19 Jun 2014 04:50:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403153450!7610815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6738 invoked from network); 19 Jun 2014 04:50:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:50:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJG-0002i2-JW
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJG-0008Gj-F1
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:50:50 +0000
Date: Thu, 19 Jun 2014 04:50:50 +0000
Message-Id: <E1WxUJG-0008Gj-F1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] derive NUMA node affinity from hard
	and soft CPU affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bf508bd2fb83b51f8547d1969629e05b6b87d1c5
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:13:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:13:03 2014 +0200

    derive NUMA node affinity from hard and soft CPU affinity
    
    if a domain's NUMA node-affinity (which is what controls
    memory allocations) is provided by the user/toolstack, it
    just is not touched. However, if the user does not say
    anything, leaving it all to Xen, let's compute it in the
    following way:
    
     1. cpupool's cpus & hard-affinity & soft-affinity
     2. if (1) is empty: cpupool's cpus & hard-affinity
    
    This guarantees memory to be allocated from the narrowest
    possible set of NUMA nodes, ad makes it relatively easy to
    set up NUMA-aware scheduling on top of soft affinity.
    
    Note that such 'narrowest set' is guaranteed to be non-empty.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
---
 xen/common/domain.c   |   61 +++++++++++++++++++++++++++++++-----------------
 xen/common/schedule.c |    4 ++-
 2 files changed, 42 insertions(+), 23 deletions(-)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index e20d3bf..c3a576e 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -409,17 +409,17 @@ struct domain *domain_create(
 
 void domain_update_node_affinity(struct domain *d)
 {
-    cpumask_var_t cpumask;
-    cpumask_var_t online_affinity;
+    cpumask_var_t dom_cpumask, dom_cpumask_soft;
+    cpumask_t *dom_affinity;
     const cpumask_t *online;
     struct vcpu *v;
-    unsigned int node;
+    unsigned int cpu;
 
-    if ( !zalloc_cpumask_var(&cpumask) )
+    if ( !zalloc_cpumask_var(&dom_cpumask) )
         return;
-    if ( !alloc_cpumask_var(&online_affinity) )
+    if ( !zalloc_cpumask_var(&dom_cpumask_soft) )
     {
-        free_cpumask_var(cpumask);
+        free_cpumask_var(dom_cpumask);
         return;
     }
 
@@ -427,31 +427,48 @@ void domain_update_node_affinity(struct domain *d)
 
     spin_lock(&d->node_affinity_lock);
 
-    for_each_vcpu ( d, v )
-    {
-        cpumask_and(online_affinity, v->cpu_hard_affinity, online);
-        cpumask_or(cpumask, cpumask, online_affinity);
-    }
-
     /*
-     * If d->auto_node_affinity is true, the domain's node-affinity mask
-     * (d->node_affinity) is automaically computed from all the domain's
-     * vcpus' vcpu-affinity masks (the union of which we have just built
-     * above in cpumask). OTOH, if d->auto_node_affinity is false, we
-     * must leave the node-affinity of the domain alone.
+     * If d->auto_node_affinity is true, let's compute the domain's
+     * node-affinity and update d->node_affinity accordingly. if false,
+     * just leave d->auto_node_affinity alone.
      */
     if ( d->auto_node_affinity )
     {
+        /*
+         * We want the narrowest possible set of pcpus (to get the narowest
+         * possible set of nodes). What we need is the cpumask of where the
+         * domain can run (the union of the hard affinity of all its vcpus),
+         * and the full mask of where it would prefer to run (the union of
+         * the soft affinity of all its various vcpus). Let's build them.
+         */
+        for_each_vcpu ( d, v )
+        {
+            cpumask_or(dom_cpumask, dom_cpumask, v->cpu_hard_affinity);
+            cpumask_or(dom_cpumask_soft, dom_cpumask_soft,
+                       v->cpu_soft_affinity);
+        }
+        /* Filter out non-online cpus */
+        cpumask_and(dom_cpumask, dom_cpumask, online);
+        ASSERT(!cpumask_empty(dom_cpumask));
+        /* And compute the intersection between hard, online and soft */
+        cpumask_and(dom_cpumask_soft, dom_cpumask_soft, dom_cpumask);
+
+        /*
+         * If not empty, the intersection of hard, soft and online is the
+         * narrowest set we want. If empty, we fall back to hard&online.
+         */
+        dom_affinity = cpumask_empty(dom_cpumask_soft) ?
+                           dom_cpumask : dom_cpumask_soft;
+
         nodes_clear(d->node_affinity);
-        for_each_online_node ( node )
-            if ( cpumask_intersects(&node_to_cpumask(node), cpumask) )
-                node_set(node, d->node_affinity);
+        for_each_cpu ( cpu, dom_affinity )
+            node_set(cpu_to_node(cpu), d->node_affinity);
     }
 
     spin_unlock(&d->node_affinity_lock);
 
-    free_cpumask_var(online_affinity);
-    free_cpumask_var(cpumask);
+    free_cpumask_var(dom_cpumask_soft);
+    free_cpumask_var(dom_cpumask);
 }
 
 
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index d76a425..e57cd91 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -310,7 +310,9 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         SCHED_OP(old_ops, free_vdata, vcpudata);
     }
 
-    domain_update_node_affinity(d);
+    /* Do we have vcpus already? If not, no need to update node-affinity */
+    if ( d->vcpu )
+        domain_update_node_affinity(d);
 
     domain_unpause(d);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:51:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:51:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJV-0003Eo-9b; Thu, 19 Jun 2014 04:51:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJT-0003EO-PM
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:04 +0000
Received: from [85.158.137.68:61055] by server-8.bemta-3.messagelabs.com id
	3F/7E-21547-73C62A35; Thu, 19 Jun 2014 04:51:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403153460!10885062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32549 invoked from network); 19 Jun 2014 04:51:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:51:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJQ-0002iE-PY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJQ-0008H6-OP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:00 +0000
Date: Thu, 19 Jun 2014 04:51:00 +0000
Message-Id: <E1WxUJQ-0008H6-OP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: DOMCTL_*vcpuaffinity works with
	hard and soft affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e4ecc6d5884b816ed6eb1949561fdfb85acd179
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:13:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:13:25 2014 +0200

    sched: DOMCTL_*vcpuaffinity works with hard and soft affinity
    
    by adding a flag for the caller to specify which one he cares about.
    
    At the same time, enable the caller to get back the "effective affinity"
    of the vCPU. That is the intersection between cpupool's cpus, the (new)
    hard affinity and, for soft affinity, the (new) soft affinity. In fact,
    despite what has been successfully set with the DOMCTL_setvcpuaffinity
    hypercall, the Xen scheduler will never run a vCPU outside of its hard
    affinity or of its domain's cpupool.
    
    This happens by adding another cpumap to the interface and making both
    the cpumaps IN/OUT parameters (for DOMCTL_setvcpuaffinity, they're of
    course out-only for DOMCTL_getvcpuaffinity).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c     |   12 +++--
 xen/arch/x86/traps.c        |    4 +-
 xen/common/domctl.c         |  107 +++++++++++++++++++++++++++++++++++++++----
 xen/common/schedule.c       |   35 ++++++++++----
 xen/common/wait.c           |    6 +-
 xen/include/public/domctl.h |   29 +++++++++++-
 xen/include/xen/sched.h     |    3 +-
 7 files changed, 162 insertions(+), 34 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 9c8653e..26edbaf 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -225,13 +225,14 @@ int xc_vcpu_setaffinity(xc_interface *xch,
 
     domctl.cmd = XEN_DOMCTL_setvcpuaffinity;
     domctl.domain = (domid_t)domid;
-    domctl.u.vcpuaffinity.vcpu    = vcpu;
+    domctl.u.vcpuaffinity.vcpu = vcpu;
+    domctl.u.vcpuaffinity.flags = XEN_VCPUAFFINITY_HARD;
 
     memcpy(local, cpumap, cpusize);
 
-    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
+    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_hard.bitmap, local);
 
-    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
+    domctl.u.vcpuaffinity.cpumap_hard.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
@@ -269,9 +270,10 @@ int xc_vcpu_getaffinity(xc_interface *xch,
     domctl.cmd = XEN_DOMCTL_getvcpuaffinity;
     domctl.domain = (domid_t)domid;
     domctl.u.vcpuaffinity.vcpu = vcpu;
+    domctl.u.vcpuaffinity.flags = XEN_VCPUAFFINITY_HARD;
 
-    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
-    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
+    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_hard.bitmap, local);
+    domctl.u.vcpuaffinity.cpumap_hard.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index cc1c87c..5897928 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3183,7 +3183,7 @@ static void nmi_mce_softirq(void)
          * Make sure to wakeup the vcpu on the
          * specified processor.
          */
-        vcpu_set_affinity(st->vcpu, cpumask_of(st->processor));
+        vcpu_set_hard_affinity(st->vcpu, cpumask_of(st->processor));
 
         /* Affinity is restored in the iret hypercall. */
     }
@@ -3212,7 +3212,7 @@ void async_exception_cleanup(struct vcpu *curr)
     if ( !cpumask_empty(curr->cpu_hard_affinity_tmp) &&
          !cpumask_equal(curr->cpu_hard_affinity_tmp, curr->cpu_hard_affinity) )
     {
-        vcpu_set_affinity(curr, curr->cpu_hard_affinity_tmp);
+        vcpu_set_hard_affinity(curr, curr->cpu_hard_affinity_tmp);
         cpumask_clear(curr->cpu_hard_affinity_tmp);
     }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index b5c5c6c..000993f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -287,6 +287,16 @@ void domctl_lock_release(void)
     spin_unlock(&current->domain->hypercall_deadlock_mutex);
 }
 
+static inline
+int vcpuaffinity_params_invalid(const xen_domctl_vcpuaffinity_t *vcpuaff)
+{
+    return vcpuaff->flags == 0 ||
+           ((vcpuaff->flags & XEN_VCPUAFFINITY_HARD) &&
+            guest_handle_is_null(vcpuaff->cpumap_hard.bitmap)) ||
+           ((vcpuaff->flags & XEN_VCPUAFFINITY_SOFT) &&
+            guest_handle_is_null(vcpuaff->cpumap_soft.bitmap));
+}
+
 long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -601,31 +611,108 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_getvcpuaffinity:
     {
         struct vcpu *v;
+        xen_domctl_vcpuaffinity_t *vcpuaff = &op->u.vcpuaffinity;
 
         ret = -EINVAL;
-        if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
+        if ( vcpuaff->vcpu >= d->max_vcpus )
             break;
 
         ret = -ESRCH;
-        if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
+        if ( (v = d->vcpu[vcpuaff->vcpu]) == NULL )
+            break;
+
+        ret = -EINVAL;
+        if ( vcpuaffinity_params_invalid(vcpuaff) )
             break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
-            cpumask_var_t new_affinity;
+            cpumask_var_t new_affinity, old_affinity;
+            cpumask_t *online = cpupool_online_cpumask(v->domain->cpupool);;
+
+            /*
+             * We want to be able to restore hard affinity if we are trying
+             * setting both and changing soft affinity (which happens later,
+             * when hard affinity has been succesfully chaged already) fails.
+             */
+            if ( !alloc_cpumask_var(&old_affinity) )
+            {
+                ret = -ENOMEM;
+                break;
+            }
+            cpumask_copy(old_affinity, v->cpu_hard_affinity);
+
+            if ( !alloc_cpumask_var(&new_affinity) )
+            {
+                free_cpumask_var(old_affinity);
+                ret = -ENOMEM;
+                break;
+            }
 
-            ret = xenctl_bitmap_to_cpumask(
-                &new_affinity, &op->u.vcpuaffinity.cpumap);
-            if ( !ret )
+            /*
+             * We both set a new affinity and report back to the caller what
+             * the scheduler will be effectively using.
+             */
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
+            {
+                ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
+                                              &vcpuaff->cpumap_hard,
+                                              nr_cpu_ids);
+                if ( !ret )
+                    ret = vcpu_set_hard_affinity(v, new_affinity);
+                if ( ret )
+                    goto setvcpuaffinity_out;
+
+                /*
+                 * For hard affinity, what we return is the intersection of
+                 * cpupool's online mask and the new hard affinity.
+                 */
+                cpumask_and(new_affinity, online, v->cpu_hard_affinity);
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard,
+                                               new_affinity);
+            }
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
             {
-                ret = vcpu_set_affinity(v, new_affinity);
-                free_cpumask_var(new_affinity);
+                ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
+                                              &vcpuaff->cpumap_soft,
+                                              nr_cpu_ids);
+                if ( !ret)
+                    ret = vcpu_set_soft_affinity(v, new_affinity);
+                if ( ret )
+                {
+                    /*
+                     * Since we're returning error, the caller expects nothing
+                     * happened, so we rollback the changes to hard affinity
+                     * (if any).
+                     */
+                    if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
+                        vcpu_set_hard_affinity(v, old_affinity);
+                    goto setvcpuaffinity_out;
+                }
+
+                /*
+                 * For soft affinity, we return the intersection between the
+                 * new soft affinity, the cpupool's online map and the (new)
+                 * hard affinity.
+                 */
+                cpumask_and(new_affinity, new_affinity, online);
+                cpumask_and(new_affinity, new_affinity, v->cpu_hard_affinity);
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft,
+                                               new_affinity);
             }
+
+ setvcpuaffinity_out:
+            free_cpumask_var(new_affinity);
+            free_cpumask_var(old_affinity);
         }
         else
         {
-            ret = cpumask_to_xenctl_bitmap(
-                &op->u.vcpuaffinity.cpumap, v->cpu_hard_affinity);
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard,
+                                               v->cpu_hard_affinity);
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft,
+                                               v->cpu_soft_affinity);
         }
     }
     break;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e57cd91..e9eb0bc 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -650,22 +650,14 @@ int cpu_disable_scheduler(unsigned int cpu)
     return ret;
 }
 
-int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
+static int vcpu_set_affinity(
+    struct vcpu *v, const cpumask_t *affinity, cpumask_t *which)
 {
-    cpumask_t online_affinity;
-    cpumask_t *online;
     spinlock_t *lock;
 
-    if ( v->domain->is_pinned )
-        return -EINVAL;
-    online = VCPU2ONLINE(v);
-    cpumask_and(&online_affinity, affinity, online);
-    if ( cpumask_empty(&online_affinity) )
-        return -EINVAL;
-
     lock = vcpu_schedule_lock_irq(v);
 
-    cpumask_copy(v->cpu_hard_affinity, affinity);
+    cpumask_copy(which, affinity);
 
     /* Always ask the scheduler to re-evaluate placement
      * when changing the affinity */
@@ -684,6 +676,27 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
     return 0;
 }
 
+int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity)
+{
+    cpumask_t online_affinity;
+    cpumask_t *online;
+
+    if ( v->domain->is_pinned )
+        return -EINVAL;
+
+    online = VCPU2ONLINE(v);
+    cpumask_and(&online_affinity, affinity, online);
+    if ( cpumask_empty(&online_affinity) )
+        return -EINVAL;
+
+    return vcpu_set_affinity(v, affinity, v->cpu_hard_affinity);
+}
+
+int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity)
+{
+    return vcpu_set_affinity(v, affinity, v->cpu_soft_affinity);
+}
+
 /* Block the currently-executing domain until a pertinent event occurs. */
 void vcpu_block(void)
 {
diff --git a/xen/common/wait.c b/xen/common/wait.c
index 3f6ff41..1f6b597 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -135,7 +135,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
     wqv->wakeup_cpu = smp_processor_id();
     cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
-    if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+    if ( vcpu_set_hard_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
     {
         gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
         domain_crash_synchronous();
@@ -166,7 +166,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 static void __finish_wait(struct waitqueue_vcpu *wqv)
 {
     wqv->esp = NULL;
-    (void)vcpu_set_affinity(current, &wqv->saved_affinity);
+    (void)vcpu_set_hard_affinity(current, &wqv->saved_affinity);
 }
 
 void check_wakeup_from_wait(void)
@@ -184,7 +184,7 @@ void check_wakeup_from_wait(void)
         /* Re-set VCPU affinity and re-enter the scheduler. */
         struct vcpu *curr = current;
         cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
-        if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+        if ( vcpu_set_hard_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
         {
             gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
             domain_crash_synchronous();
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 2967133..5b11bbf 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -300,8 +300,33 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_nodeaffinity_t);
 /* XEN_DOMCTL_setvcpuaffinity */
 /* XEN_DOMCTL_getvcpuaffinity */
 struct xen_domctl_vcpuaffinity {
-    uint32_t  vcpu;              /* IN */
-    struct xenctl_bitmap cpumap; /* IN/OUT */
+    /* IN variables. */
+    uint32_t  vcpu;
+ /* Set/get the hard affinity for vcpu */
+#define _XEN_VCPUAFFINITY_HARD  0
+#define XEN_VCPUAFFINITY_HARD   (1U<<_XEN_VCPUAFFINITY_HARD)
+ /* Set/get the soft affinity for vcpu */
+#define _XEN_VCPUAFFINITY_SOFT  1
+#define XEN_VCPUAFFINITY_SOFT   (1U<<_XEN_VCPUAFFINITY_SOFT)
+    uint32_t flags;
+    /*
+     * IN/OUT variables.
+     *
+     * Both are IN/OUT for XEN_DOMCTL_setvcpuaffinity, in which case they
+     * contain effective hard or/and soft affinity. That is, upon successful
+     * return, cpumap_soft, contains the intersection of the soft affinity,
+     * hard affinity and the cpupool's online CPUs for the domain (if
+     * XEN_VCPUAFFINITY_SOFT was set in flags). cpumap_hard contains the
+     * intersection between hard affinity and the cpupool's online CPUs (if
+     * XEN_VCPUAFFINITY_HARD was set in flags).
+     *
+     * Both are OUT-only for XEN_DOMCTL_getvcpuaffinity, in which case they
+     * contain the plain hard and/or soft affinity masks that were set during
+     * previous successful calls to XEN_DOMCTL_setvcpuaffinity (or the
+     * default values), without intersecting or altering them in any way.
+     */
+    struct xenctl_bitmap cpumap_hard;
+    struct xenctl_bitmap cpumap_soft;
 };
 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 445b659..f920e1a 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -781,7 +781,8 @@ void scheduler_free(struct scheduler *sched);
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
-int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
+int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity);
+int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity);
 void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:51:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:51:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJV-0003Eo-9b; Thu, 19 Jun 2014 04:51:05 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJT-0003EO-PM
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:04 +0000
Received: from [85.158.137.68:61055] by server-8.bemta-3.messagelabs.com id
	3F/7E-21547-73C62A35; Thu, 19 Jun 2014 04:51:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403153460!10885062!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32549 invoked from network); 19 Jun 2014 04:51:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:51:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJQ-0002iE-PY
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJQ-0008H6-OP
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:00 +0000
Date: Thu, 19 Jun 2014 04:51:00 +0000
Message-Id: <E1WxUJQ-0008H6-OP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] sched: DOMCTL_*vcpuaffinity works with
	hard and soft affinity
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6e4ecc6d5884b816ed6eb1949561fdfb85acd179
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Mon Jun 16 12:13:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Mon Jun 16 12:13:25 2014 +0200

    sched: DOMCTL_*vcpuaffinity works with hard and soft affinity
    
    by adding a flag for the caller to specify which one he cares about.
    
    At the same time, enable the caller to get back the "effective affinity"
    of the vCPU. That is the intersection between cpupool's cpus, the (new)
    hard affinity and, for soft affinity, the (new) soft affinity. In fact,
    despite what has been successfully set with the DOMCTL_setvcpuaffinity
    hypercall, the Xen scheduler will never run a vCPU outside of its hard
    affinity or of its domain's cpupool.
    
    This happens by adding another cpumap to the interface and making both
    the cpumaps IN/OUT parameters (for DOMCTL_setvcpuaffinity, they're of
    course out-only for DOMCTL_getvcpuaffinity).
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
    Acked-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c     |   12 +++--
 xen/arch/x86/traps.c        |    4 +-
 xen/common/domctl.c         |  107 +++++++++++++++++++++++++++++++++++++++----
 xen/common/schedule.c       |   35 ++++++++++----
 xen/common/wait.c           |    6 +-
 xen/include/public/domctl.h |   29 +++++++++++-
 xen/include/xen/sched.h     |    3 +-
 7 files changed, 162 insertions(+), 34 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 9c8653e..26edbaf 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -225,13 +225,14 @@ int xc_vcpu_setaffinity(xc_interface *xch,
 
     domctl.cmd = XEN_DOMCTL_setvcpuaffinity;
     domctl.domain = (domid_t)domid;
-    domctl.u.vcpuaffinity.vcpu    = vcpu;
+    domctl.u.vcpuaffinity.vcpu = vcpu;
+    domctl.u.vcpuaffinity.flags = XEN_VCPUAFFINITY_HARD;
 
     memcpy(local, cpumap, cpusize);
 
-    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
+    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_hard.bitmap, local);
 
-    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
+    domctl.u.vcpuaffinity.cpumap_hard.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
@@ -269,9 +270,10 @@ int xc_vcpu_getaffinity(xc_interface *xch,
     domctl.cmd = XEN_DOMCTL_getvcpuaffinity;
     domctl.domain = (domid_t)domid;
     domctl.u.vcpuaffinity.vcpu = vcpu;
+    domctl.u.vcpuaffinity.flags = XEN_VCPUAFFINITY_HARD;
 
-    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap.bitmap, local);
-    domctl.u.vcpuaffinity.cpumap.nr_bits = cpusize * 8;
+    set_xen_guest_handle(domctl.u.vcpuaffinity.cpumap_hard.bitmap, local);
+    domctl.u.vcpuaffinity.cpumap_hard.nr_bits = cpusize * 8;
 
     ret = do_domctl(xch, &domctl);
 
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index cc1c87c..5897928 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -3183,7 +3183,7 @@ static void nmi_mce_softirq(void)
          * Make sure to wakeup the vcpu on the
          * specified processor.
          */
-        vcpu_set_affinity(st->vcpu, cpumask_of(st->processor));
+        vcpu_set_hard_affinity(st->vcpu, cpumask_of(st->processor));
 
         /* Affinity is restored in the iret hypercall. */
     }
@@ -3212,7 +3212,7 @@ void async_exception_cleanup(struct vcpu *curr)
     if ( !cpumask_empty(curr->cpu_hard_affinity_tmp) &&
          !cpumask_equal(curr->cpu_hard_affinity_tmp, curr->cpu_hard_affinity) )
     {
-        vcpu_set_affinity(curr, curr->cpu_hard_affinity_tmp);
+        vcpu_set_hard_affinity(curr, curr->cpu_hard_affinity_tmp);
         cpumask_clear(curr->cpu_hard_affinity_tmp);
     }
 
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index b5c5c6c..000993f 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -287,6 +287,16 @@ void domctl_lock_release(void)
     spin_unlock(&current->domain->hypercall_deadlock_mutex);
 }
 
+static inline
+int vcpuaffinity_params_invalid(const xen_domctl_vcpuaffinity_t *vcpuaff)
+{
+    return vcpuaff->flags == 0 ||
+           ((vcpuaff->flags & XEN_VCPUAFFINITY_HARD) &&
+            guest_handle_is_null(vcpuaff->cpumap_hard.bitmap)) ||
+           ((vcpuaff->flags & XEN_VCPUAFFINITY_SOFT) &&
+            guest_handle_is_null(vcpuaff->cpumap_soft.bitmap));
+}
+
 long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
 {
     long ret = 0;
@@ -601,31 +611,108 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
     case XEN_DOMCTL_getvcpuaffinity:
     {
         struct vcpu *v;
+        xen_domctl_vcpuaffinity_t *vcpuaff = &op->u.vcpuaffinity;
 
         ret = -EINVAL;
-        if ( op->u.vcpuaffinity.vcpu >= d->max_vcpus )
+        if ( vcpuaff->vcpu >= d->max_vcpus )
             break;
 
         ret = -ESRCH;
-        if ( (v = d->vcpu[op->u.vcpuaffinity.vcpu]) == NULL )
+        if ( (v = d->vcpu[vcpuaff->vcpu]) == NULL )
+            break;
+
+        ret = -EINVAL;
+        if ( vcpuaffinity_params_invalid(vcpuaff) )
             break;
 
         if ( op->cmd == XEN_DOMCTL_setvcpuaffinity )
         {
-            cpumask_var_t new_affinity;
+            cpumask_var_t new_affinity, old_affinity;
+            cpumask_t *online = cpupool_online_cpumask(v->domain->cpupool);;
+
+            /*
+             * We want to be able to restore hard affinity if we are trying
+             * setting both and changing soft affinity (which happens later,
+             * when hard affinity has been succesfully chaged already) fails.
+             */
+            if ( !alloc_cpumask_var(&old_affinity) )
+            {
+                ret = -ENOMEM;
+                break;
+            }
+            cpumask_copy(old_affinity, v->cpu_hard_affinity);
+
+            if ( !alloc_cpumask_var(&new_affinity) )
+            {
+                free_cpumask_var(old_affinity);
+                ret = -ENOMEM;
+                break;
+            }
 
-            ret = xenctl_bitmap_to_cpumask(
-                &new_affinity, &op->u.vcpuaffinity.cpumap);
-            if ( !ret )
+            /*
+             * We both set a new affinity and report back to the caller what
+             * the scheduler will be effectively using.
+             */
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
+            {
+                ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
+                                              &vcpuaff->cpumap_hard,
+                                              nr_cpu_ids);
+                if ( !ret )
+                    ret = vcpu_set_hard_affinity(v, new_affinity);
+                if ( ret )
+                    goto setvcpuaffinity_out;
+
+                /*
+                 * For hard affinity, what we return is the intersection of
+                 * cpupool's online mask and the new hard affinity.
+                 */
+                cpumask_and(new_affinity, online, v->cpu_hard_affinity);
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard,
+                                               new_affinity);
+            }
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
             {
-                ret = vcpu_set_affinity(v, new_affinity);
-                free_cpumask_var(new_affinity);
+                ret = xenctl_bitmap_to_bitmap(cpumask_bits(new_affinity),
+                                              &vcpuaff->cpumap_soft,
+                                              nr_cpu_ids);
+                if ( !ret)
+                    ret = vcpu_set_soft_affinity(v, new_affinity);
+                if ( ret )
+                {
+                    /*
+                     * Since we're returning error, the caller expects nothing
+                     * happened, so we rollback the changes to hard affinity
+                     * (if any).
+                     */
+                    if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
+                        vcpu_set_hard_affinity(v, old_affinity);
+                    goto setvcpuaffinity_out;
+                }
+
+                /*
+                 * For soft affinity, we return the intersection between the
+                 * new soft affinity, the cpupool's online map and the (new)
+                 * hard affinity.
+                 */
+                cpumask_and(new_affinity, new_affinity, online);
+                cpumask_and(new_affinity, new_affinity, v->cpu_hard_affinity);
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft,
+                                               new_affinity);
             }
+
+ setvcpuaffinity_out:
+            free_cpumask_var(new_affinity);
+            free_cpumask_var(old_affinity);
         }
         else
         {
-            ret = cpumask_to_xenctl_bitmap(
-                &op->u.vcpuaffinity.cpumap, v->cpu_hard_affinity);
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_HARD )
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_hard,
+                                               v->cpu_hard_affinity);
+            if ( vcpuaff->flags & XEN_VCPUAFFINITY_SOFT )
+                ret = cpumask_to_xenctl_bitmap(&vcpuaff->cpumap_soft,
+                                               v->cpu_soft_affinity);
         }
     }
     break;
diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e57cd91..e9eb0bc 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -650,22 +650,14 @@ int cpu_disable_scheduler(unsigned int cpu)
     return ret;
 }
 
-int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
+static int vcpu_set_affinity(
+    struct vcpu *v, const cpumask_t *affinity, cpumask_t *which)
 {
-    cpumask_t online_affinity;
-    cpumask_t *online;
     spinlock_t *lock;
 
-    if ( v->domain->is_pinned )
-        return -EINVAL;
-    online = VCPU2ONLINE(v);
-    cpumask_and(&online_affinity, affinity, online);
-    if ( cpumask_empty(&online_affinity) )
-        return -EINVAL;
-
     lock = vcpu_schedule_lock_irq(v);
 
-    cpumask_copy(v->cpu_hard_affinity, affinity);
+    cpumask_copy(which, affinity);
 
     /* Always ask the scheduler to re-evaluate placement
      * when changing the affinity */
@@ -684,6 +676,27 @@ int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity)
     return 0;
 }
 
+int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity)
+{
+    cpumask_t online_affinity;
+    cpumask_t *online;
+
+    if ( v->domain->is_pinned )
+        return -EINVAL;
+
+    online = VCPU2ONLINE(v);
+    cpumask_and(&online_affinity, affinity, online);
+    if ( cpumask_empty(&online_affinity) )
+        return -EINVAL;
+
+    return vcpu_set_affinity(v, affinity, v->cpu_hard_affinity);
+}
+
+int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity)
+{
+    return vcpu_set_affinity(v, affinity, v->cpu_soft_affinity);
+}
+
 /* Block the currently-executing domain until a pertinent event occurs. */
 void vcpu_block(void)
 {
diff --git a/xen/common/wait.c b/xen/common/wait.c
index 3f6ff41..1f6b597 100644
--- a/xen/common/wait.c
+++ b/xen/common/wait.c
@@ -135,7 +135,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
     /* Save current VCPU affinity; force wakeup on *this* CPU only. */
     wqv->wakeup_cpu = smp_processor_id();
     cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
-    if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+    if ( vcpu_set_hard_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
     {
         gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
         domain_crash_synchronous();
@@ -166,7 +166,7 @@ static void __prepare_to_wait(struct waitqueue_vcpu *wqv)
 static void __finish_wait(struct waitqueue_vcpu *wqv)
 {
     wqv->esp = NULL;
-    (void)vcpu_set_affinity(current, &wqv->saved_affinity);
+    (void)vcpu_set_hard_affinity(current, &wqv->saved_affinity);
 }
 
 void check_wakeup_from_wait(void)
@@ -184,7 +184,7 @@ void check_wakeup_from_wait(void)
         /* Re-set VCPU affinity and re-enter the scheduler. */
         struct vcpu *curr = current;
         cpumask_copy(&wqv->saved_affinity, curr->cpu_hard_affinity);
-        if ( vcpu_set_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
+        if ( vcpu_set_hard_affinity(curr, cpumask_of(wqv->wakeup_cpu)) )
         {
             gdprintk(XENLOG_ERR, "Unable to set vcpu affinity\n");
             domain_crash_synchronous();
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 2967133..5b11bbf 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -300,8 +300,33 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_nodeaffinity_t);
 /* XEN_DOMCTL_setvcpuaffinity */
 /* XEN_DOMCTL_getvcpuaffinity */
 struct xen_domctl_vcpuaffinity {
-    uint32_t  vcpu;              /* IN */
-    struct xenctl_bitmap cpumap; /* IN/OUT */
+    /* IN variables. */
+    uint32_t  vcpu;
+ /* Set/get the hard affinity for vcpu */
+#define _XEN_VCPUAFFINITY_HARD  0
+#define XEN_VCPUAFFINITY_HARD   (1U<<_XEN_VCPUAFFINITY_HARD)
+ /* Set/get the soft affinity for vcpu */
+#define _XEN_VCPUAFFINITY_SOFT  1
+#define XEN_VCPUAFFINITY_SOFT   (1U<<_XEN_VCPUAFFINITY_SOFT)
+    uint32_t flags;
+    /*
+     * IN/OUT variables.
+     *
+     * Both are IN/OUT for XEN_DOMCTL_setvcpuaffinity, in which case they
+     * contain effective hard or/and soft affinity. That is, upon successful
+     * return, cpumap_soft, contains the intersection of the soft affinity,
+     * hard affinity and the cpupool's online CPUs for the domain (if
+     * XEN_VCPUAFFINITY_SOFT was set in flags). cpumap_hard contains the
+     * intersection between hard affinity and the cpupool's online CPUs (if
+     * XEN_VCPUAFFINITY_HARD was set in flags).
+     *
+     * Both are OUT-only for XEN_DOMCTL_getvcpuaffinity, in which case they
+     * contain the plain hard and/or soft affinity masks that were set during
+     * previous successful calls to XEN_DOMCTL_setvcpuaffinity (or the
+     * default values), without intersecting or altering them in any way.
+     */
+    struct xenctl_bitmap cpumap_hard;
+    struct xenctl_bitmap cpumap_soft;
 };
 typedef struct xen_domctl_vcpuaffinity xen_domctl_vcpuaffinity_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_vcpuaffinity_t);
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index 445b659..f920e1a 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -781,7 +781,8 @@ void scheduler_free(struct scheduler *sched);
 int schedule_cpu_switch(unsigned int cpu, struct cpupool *c);
 void vcpu_force_reschedule(struct vcpu *v);
 int cpu_disable_scheduler(unsigned int cpu);
-int vcpu_set_affinity(struct vcpu *v, const cpumask_t *affinity);
+int vcpu_set_hard_affinity(struct vcpu *v, const cpumask_t *affinity);
+int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinity);
 void restore_vcpu_affinity(struct domain *d);
 
 void vcpu_runstate_get(struct vcpu *v, struct vcpu_runstate_info *runstate);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:51:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:51:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJe-0003HP-DF; Thu, 19 Jun 2014 04:51:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJd-0003Gx-Es
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:13 +0000
Received: from [85.158.139.211:15915] by server-6.bemta-5.messagelabs.com id
	8C/7A-25531-04C62A35; Thu, 19 Jun 2014 04:51:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403153471!10756965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11427 invoked from network); 19 Jun 2014 04:51:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:51:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJb-0002in-0m
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJa-0008Hb-VR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:10 +0000
Date: Thu, 19 Jun 2014 04:51:10 +0000
Message-Id: <E1WxUJa-0008Hb-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5157e9dfd52682a7376c0c6a9c13ea413c06047e
Merge: 364c9ee0076d66498c1ae2b2c65833cbe433ceba 6e4ecc6d5884b816ed6eb1949561fdfb85acd179
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 17 10:40:39 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 17 10:40:39 2014 +0100

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

 docs/misc/xen-command-line.markdown   |   10 ++
 docs/misc/xl-numa-placement.markdown  |  148 +++++++++++++++--------
 tools/libxc/xc_domain.c               |   50 +++++---
 xen/arch/x86/acpi/cpuidle_menu.c      |   21 +++-
 xen/arch/x86/cpu/mcheck/mce_intel.c   |   19 ++-
 xen/arch/x86/efi/boot.c               |   15 ++-
 xen/arch/x86/physdev.c                |    7 +-
 xen/arch/x86/traps.c                  |   13 +-
 xen/common/domain.c                   |   86 ++++++++-----
 xen/common/domctl.c                   |  107 +++++++++++++++--
 xen/common/keyhandler.c               |    4 +-
 xen/common/page_alloc.c               |  214 ++++++++++++++++++++++++++++++---
 xen/common/sched_credit.c             |  161 ++++++++++---------------
 xen/common/sched_sedf.c               |    2 +-
 xen/common/schedule.c                 |   66 ++++++----
 xen/common/wait.c                     |   10 +-
 xen/drivers/passthrough/io.c          |  185 ++++++++++++++++-------------
 xen/drivers/passthrough/vtd/x86/vtd.c |    8 +-
 xen/include/asm-arm/numa.h            |    1 +
 xen/include/asm-x86/hvm/io.h          |    2 +-
 xen/include/public/domctl.h           |   29 ++++-
 xen/include/xen/hvm/irq.h             |    4 +-
 xen/include/xen/sched-if.h            |    2 -
 xen/include/xen/sched.h               |   15 ++-
 24 files changed, 795 insertions(+), 384 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:51:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:51:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJe-0003HP-DF; Thu, 19 Jun 2014 04:51:14 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJd-0003Gx-Es
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:13 +0000
Received: from [85.158.139.211:15915] by server-6.bemta-5.messagelabs.com id
	8C/7A-25531-04C62A35; Thu, 19 Jun 2014 04:51:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403153471!10756965!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11427 invoked from network); 19 Jun 2014 04:51:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:51:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJb-0002in-0m
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJa-0008Hb-VR
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:10 +0000
Date: Thu, 19 Jun 2014 04:51:10 +0000
Message-Id: <E1WxUJa-0008Hb-VR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] Merge branch 'staging' of
	ssh://xenbits.xen.org/home/xen/git/xen into staging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5157e9dfd52682a7376c0c6a9c13ea413c06047e
Merge: 364c9ee0076d66498c1ae2b2c65833cbe433ceba 6e4ecc6d5884b816ed6eb1949561fdfb85acd179
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Tue Jun 17 10:40:39 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 17 10:40:39 2014 +0100

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

 docs/misc/xen-command-line.markdown   |   10 ++
 docs/misc/xl-numa-placement.markdown  |  148 +++++++++++++++--------
 tools/libxc/xc_domain.c               |   50 +++++---
 xen/arch/x86/acpi/cpuidle_menu.c      |   21 +++-
 xen/arch/x86/cpu/mcheck/mce_intel.c   |   19 ++-
 xen/arch/x86/efi/boot.c               |   15 ++-
 xen/arch/x86/physdev.c                |    7 +-
 xen/arch/x86/traps.c                  |   13 +-
 xen/common/domain.c                   |   86 ++++++++-----
 xen/common/domctl.c                   |  107 +++++++++++++++--
 xen/common/keyhandler.c               |    4 +-
 xen/common/page_alloc.c               |  214 ++++++++++++++++++++++++++++++---
 xen/common/sched_credit.c             |  161 ++++++++++---------------
 xen/common/sched_sedf.c               |    2 +-
 xen/common/schedule.c                 |   66 ++++++----
 xen/common/wait.c                     |   10 +-
 xen/drivers/passthrough/io.c          |  185 ++++++++++++++++-------------
 xen/drivers/passthrough/vtd/x86/vtd.c |    8 +-
 xen/include/asm-arm/numa.h            |    1 +
 xen/include/asm-x86/hvm/io.h          |    2 +-
 xen/include/public/domctl.h           |   29 ++++-
 xen/include/xen/hvm/irq.h             |    4 +-
 xen/include/xen/sched-if.h            |    2 -
 xen/include/xen/sched.h               |   15 ++-
 24 files changed, 795 insertions(+), 384 deletions(-)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:51:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:51:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJp-0003L2-GA; Thu, 19 Jun 2014 04:51:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJn-0003KF-UD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:24 +0000
Received: from [85.158.137.68:58197] by server-7.bemta-3.messagelabs.com id
	E3/71-04151-B4C62A35; Thu, 19 Jun 2014 04:51:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403153481!10978060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28039 invoked from network); 19 Jun 2014 04:51:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:51:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJl-0002it-9J
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJl-0008Ig-5g
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:21 +0000
Date: Thu, 19 Jun 2014 04:51:21 +0000
Message-Id: <E1WxUJl-0008Ig-5g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4bd78937ec324bcef4e29ef951e0ff9815770de1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 15:21:10 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 15:21:10 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1b2d541..58677d0 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1587,7 +1587,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1757,6 +1760,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 04:51:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 04:51:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUJp-0003L2-GA; Thu, 19 Jun 2014 04:51:25 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJn-0003KF-UD
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:24 +0000
Received: from [85.158.137.68:58197] by server-7.bemta-3.messagelabs.com id
	E3/71-04151-B4C62A35; Thu, 19 Jun 2014 04:51:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403153481!10978060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28039 invoked from network); 19 Jun 2014 04:51:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:51:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJl-0002it-9J
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUJl-0008Ig-5g
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:51:21 +0000
Date: Thu, 19 Jun 2014 04:51:21 +0000
Message-Id: <E1WxUJl-0008Ig-5g@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4bd78937ec324bcef4e29ef951e0ff9815770de1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 15:21:10 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 15:21:10 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 1b2d541..58677d0 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1587,7 +1587,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1757,6 +1760,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 05:15:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 05:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUh8-0003m3-1O; Thu, 19 Jun 2014 05:15:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUh7-0003ly-Ea
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 05:15:29 +0000
Received: from [193.109.254.147:56746] by server-4.bemta-14.messagelabs.com id
	A8/76-02781-0F172A35; Thu, 19 Jun 2014 05:15:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403153150!12245736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16239 invoked from network); 19 Jun 2014 04:45:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:45:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEQ-0002cl-MH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEQ-0007zR-GI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:50 +0000
Date: Thu, 19 Jun 2014 04:45:50 +0000
Message-Id: <E1WxUEQ-0007zR-GI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce
	libxl_cpuid_policy_list_length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 92f962f4a72f297a0e21bf1acbea4a685a487fc7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:26 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:27:35 2014 +0100

    libxl: introduce libxl_cpuid_policy_list_length
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h       |    1 +
 tools/libxl/libxl_cpuid.c |   13 +++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index e2259b2..17b8a7b 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -529,6 +529,7 @@ void libxl_bitmap_dispose(libxl_bitmap *map);
 typedef struct libxl__cpuid_policy libxl_cpuid_policy;
 typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
+int libxl_cpuid_policy_list_length(libxl_cpuid_policy_list *l);
 
 #define LIBXL_PCI_FUNC_ALL (~0U)
 
diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index d9007b2..1f2bcd5 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -455,6 +455,19 @@ int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
     return 0;
 }
 
+int libxl_cpuid_policy_list_length(libxl_cpuid_policy_list *pl)
+{
+    int i = 0;
+    libxl_cpuid_policy_list l = *pl;
+
+    if (l) {
+        while (l[i].input[0] != XEN_CPUID_INPUT_UNUSED)
+            i++;
+    }
+
+    return i;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 19 05:15:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 19 Jun 2014 05:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxUh8-0003m3-1O; Thu, 19 Jun 2014 05:15:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUh7-0003ly-Ea
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 05:15:29 +0000
Received: from [193.109.254.147:56746] by server-4.bemta-14.messagelabs.com id
	A8/76-02781-0F172A35; Thu, 19 Jun 2014 05:15:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403153150!12245736!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16239 invoked from network); 19 Jun 2014 04:45:51 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	19 Jun 2014 04:45:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEQ-0002cl-MH
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxUEQ-0007zR-GI
	for xen-changelog@lists.xensource.com; Thu, 19 Jun 2014 04:45:50 +0000
Date: Thu, 19 Jun 2014 04:45:50 +0000
Message-Id: <E1WxUEQ-0007zR-GI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: introduce
	libxl_cpuid_policy_list_length
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 92f962f4a72f297a0e21bf1acbea4a685a487fc7
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Mon Jun 9 13:43:26 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Tue Jun 10 14:27:35 2014 +0100

    libxl: introduce libxl_cpuid_policy_list_length
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.h       |    1 +
 tools/libxl/libxl_cpuid.c |   13 +++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index e2259b2..17b8a7b 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -529,6 +529,7 @@ void libxl_bitmap_dispose(libxl_bitmap *map);
 typedef struct libxl__cpuid_policy libxl_cpuid_policy;
 typedef libxl_cpuid_policy * libxl_cpuid_policy_list;
 void libxl_cpuid_dispose(libxl_cpuid_policy_list *cpuid_list);
+int libxl_cpuid_policy_list_length(libxl_cpuid_policy_list *l);
 
 #define LIBXL_PCI_FUNC_ALL (~0U)
 
diff --git a/tools/libxl/libxl_cpuid.c b/tools/libxl/libxl_cpuid.c
index d9007b2..1f2bcd5 100644
--- a/tools/libxl/libxl_cpuid.c
+++ b/tools/libxl/libxl_cpuid.c
@@ -455,6 +455,19 @@ int libxl_cpuid_policy_list_parse_json(libxl__gc *gc,
     return 0;
 }
 
+int libxl_cpuid_policy_list_length(libxl_cpuid_policy_list *pl)
+{
+    int i = 0;
+    libxl_cpuid_policy_list l = *pl;
+
+    if (l) {
+        while (l[i].input[0] != XEN_CPUID_INPUT_UNUSED)
+            i++;
+    }
+
+    return i;
+}
+
 /*
  * Local variables:
  * mode: C
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Fri Jun 20 05:22:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jun 2014 05:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxrH5-0006ox-Qy; Fri, 20 Jun 2014 05:22:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrH4-0006os-F1
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:06 +0000
Received: from [193.109.254.147:16506] by server-6.bemta-14.messagelabs.com id
	B5/DC-13066-DF4C3A35; Fri, 20 Jun 2014 05:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403241724!12503586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23406 invoked from network); 20 Jun 2014 05:22:05 -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;
	20 Jun 2014 05:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrH1-00088f-R5
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrH1-0001nb-Mp
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:03 +0000
Date: Fri, 20 Jun 2014 05:22:03 +0000
Message-Id: <E1WxrH1-0001nb-Mp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.3-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fffe193f5371c57d398c56bfb71d5930cd729bd1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:04:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:04:42 2014 +0200

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Jun 20 05:22:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jun 2014 05:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxrH5-0006ox-Qy; Fri, 20 Jun 2014 05:22:07 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrH4-0006os-F1
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:06 +0000
Received: from [193.109.254.147:16506] by server-6.bemta-14.messagelabs.com id
	B5/DC-13066-DF4C3A35; Fri, 20 Jun 2014 05:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403241724!12503586!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23406 invoked from network); 20 Jun 2014 05:22:05 -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;
	20 Jun 2014 05:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrH1-00088f-R5
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrH1-0001nb-Mp
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:03 +0000
Date: Fri, 20 Jun 2014 05:22:03 +0000
Message-Id: <E1WxrH1-0001nb-Mp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] update Xen version to 4.3.3-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fffe193f5371c57d398c56bfb71d5930cd729bd1
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:04:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:04:42 2014 +0200

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

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

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

From xen-changelog-bounces@lists.xen.org Fri Jun 20 05:22:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jun 2014 05:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxrHF-0006px-TX; Fri, 20 Jun 2014 05:22:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrHE-0006pn-RI
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:16 +0000
Received: from [85.158.137.68:7799] by server-11.bemta-3.messagelabs.com id
	BE/47-12889-805C3A35; Fri, 20 Jun 2014 05:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403241734!11121447!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3822 invoked from network); 20 Jun 2014 05:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jun 2014 05:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrHC-00088j-5V
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrHB-0001oT-Uq
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:14 +0000
Date: Fri, 20 Jun 2014 05:22:13 +0000
Message-Id: <E1WxrHB-0001oT-Uq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d03e21fdc77366a77ee06eec7905d006a9738fb8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:05:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:05:04 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 60cb01d..300669e 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1404,7 +1404,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1571,6 +1574,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Fri Jun 20 05:22:17 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 20 Jun 2014 05:22:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WxrHF-0006px-TX; Fri, 20 Jun 2014 05:22:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrHE-0006pn-RI
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:16 +0000
Received: from [85.158.137.68:7799] by server-11.bemta-3.messagelabs.com id
	BE/47-12889-805C3A35; Fri, 20 Jun 2014 05:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1403241734!11121447!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3822 invoked from network); 20 Jun 2014 05:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	20 Jun 2014 05:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrHC-00088j-5V
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WxrHB-0001oT-Uq
	for xen-changelog@lists.xensource.com; Fri, 20 Jun 2014 05:22:14 +0000
Date: Fri, 20 Jun 2014 05:22:13 +0000
Message-Id: <E1WxrHB-0001oT-Uq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d03e21fdc77366a77ee06eec7905d006a9738fb8
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:05:04 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:05:04 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 60cb01d..300669e 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1404,7 +1404,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1571,6 +1574,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sat Jun 21 14:44:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jun 2014 14:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WyMWY-00074T-1t; Sat, 21 Jun 2014 14:44:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWW-00074H-Mc
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:08 +0000
Received: from [85.158.139.211:19121] by server-17.bemta-5.messagelabs.com id
	18/22-08711-83A95A35; Sat, 21 Jun 2014 14:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403361845!11244650!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25474 invoked from network); 21 Jun 2014 14:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jun 2014 14:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWR-0001nh-56
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWQ-0002oF-P1
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:02 +0000
Date: Sat, 21 Jun 2014 14:44:02 +0000
Message-Id: <E1WyMWQ-0002oF-P1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] update Xen version to 4.4.1-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 450412653b0f48672a4fa0f170f8e8fa09610269
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:00:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:00:42 2014 +0200

    update Xen version to 4.4.1-rc1
---
 Config.mk    |    2 +-
 xen/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index a7cb312..f9a44b7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.1-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
diff --git a/xen/Makefile b/xen/Makefile
index 9c0d356..fc59708 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-rc1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 21 14:44:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jun 2014 14:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WyMWY-00074T-1t; Sat, 21 Jun 2014 14:44:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWW-00074H-Mc
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:08 +0000
Received: from [85.158.139.211:19121] by server-17.bemta-5.messagelabs.com id
	18/22-08711-83A95A35; Sat, 21 Jun 2014 14:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403361845!11244650!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25474 invoked from network); 21 Jun 2014 14:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jun 2014 14:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWR-0001nh-56
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWQ-0002oF-P1
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:02 +0000
Date: Sat, 21 Jun 2014 14:44:02 +0000
Message-Id: <E1WyMWQ-0002oF-P1@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] update Xen version to 4.4.1-rc1
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 450412653b0f48672a4fa0f170f8e8fa09610269
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:00:42 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:00:42 2014 +0200

    update Xen version to 4.4.1-rc1
---
 Config.mk    |    2 +-
 xen/Makefile |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Config.mk b/Config.mk
index a7cb312..f9a44b7 100644
--- a/Config.mk
+++ b/Config.mk
@@ -234,7 +234,7 @@ QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-4.4-testing.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 OVMF_UPSTREAM_REVISION ?= 447d264115c476142f884af0be287622cd244423
-QEMU_UPSTREAM_REVISION ?= master
+QEMU_UPSTREAM_REVISION ?= qemu-xen-4.4.1-rc1
 SEABIOS_UPSTREAM_TAG ?= rel-1.7.3.1
 # Fri Aug 2 14:12:09 2013 -0400
 # Fix bug in CBFS file walking with compressed files.
diff --git a/xen/Makefile b/xen/Makefile
index 9c0d356..fc59708 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -2,7 +2,7 @@
 # All other places this is stored (eg. compile.h) should be autogenerated.
 export XEN_VERSION       = 4
 export XEN_SUBVERSION    = 4
-export XEN_EXTRAVERSION ?= .1-pre$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .1-rc1$(XEN_VENDORVERSION)
 export XEN_FULLVERSION   = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
 -include xen-version
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 21 14:44:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jun 2014 14:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WyMWi-00075x-5P; Sat, 21 Jun 2014 14:44:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWg-00075a-4t
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:18 +0000
Received: from [85.158.143.35:44666] by server-1.bemta-4.messagelabs.com id
	3E/16-09496-14A95A35; Sat, 21 Jun 2014 14:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1403361856!12870475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27237 invoked from network); 21 Jun 2014 14:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jun 2014 14:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWd-0001nn-OJ
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWd-0002on-I5
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:15 +0000
Date: Sat, 21 Jun 2014 14:44:15 +0000
Message-Id: <E1WyMWd-0002on-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3d1024d56aaf7fbb6415db1558f7eb40c854afc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:01:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:01:35 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 601319c..5cbdeb7 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1409,7 +1409,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1579,6 +1582,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sat Jun 21 14:44:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 21 Jun 2014 14:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WyMWi-00075x-5P; Sat, 21 Jun 2014 14:44:20 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWg-00075a-4t
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:18 +0000
Received: from [85.158.143.35:44666] by server-1.bemta-4.messagelabs.com id
	3E/16-09496-14A95A35; Sat, 21 Jun 2014 14:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1403361856!12870475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27237 invoked from network); 21 Jun 2014 14:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	21 Jun 2014 14:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWd-0001nn-OJ
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WyMWd-0002on-I5
	for xen-changelog@lists.xensource.com; Sat, 21 Jun 2014 14:44:15 +0000
Date: Sat, 21 Jun 2014 14:44:15 +0000
Message-Id: <E1WyMWd-0002on-I5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c3d1024d56aaf7fbb6415db1558f7eb40c854afc
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:01:35 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:01:35 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 601319c..5cbdeb7 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1409,7 +1409,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1579,6 +1582,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 07:44:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 07:44:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WycRZ-00017G-K7; Sun, 22 Jun 2014 07:44:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WycRY-00017B-No
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 07:44:04 +0000
Received: from [85.158.139.211:51297] by server-12.bemta-5.messagelabs.com id
	D0/83-27841-44986A35; Sun, 22 Jun 2014 07:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403423042!11267967!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22865 invoked from network); 22 Jun 2014 07:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 07:44:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WycRW-00029t-Ev
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 07:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WycRW-0001Ut-BR
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 07:44:02 +0000
Date: Sun, 22 Jun 2014 07:44:02 +0000
Message-Id: <E1WycRW-0001Ut-BR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8995a94f8f88b174dabd1289d1d54c1dcfe7c78d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:17:30 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:17:30 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index f0de320..cf6b1bb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1123,7 +1123,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1290,6 +1293,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 07:44:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 07:44:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WycRZ-00017G-K7; Sun, 22 Jun 2014 07:44:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WycRY-00017B-No
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 07:44:04 +0000
Received: from [85.158.139.211:51297] by server-12.bemta-5.messagelabs.com id
	D0/83-27841-44986A35; Sun, 22 Jun 2014 07:44:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403423042!11267967!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22865 invoked from network); 22 Jun 2014 07:44:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 07:44:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WycRW-00029t-Ev
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 07:44:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WycRW-0001Ut-BR
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 07:44:02 +0000
Date: Sun, 22 Jun 2014 07:44:02 +0000
Message-Id: <E1WycRW-0001Ut-BR@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.1] page-alloc: scrub pages used by
	hypervisor upon freeing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8995a94f8f88b174dabd1289d1d54c1dcfe7c78d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 17 16:17:30 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 17 16:17:30 2014 +0200

    page-alloc: scrub pages used by hypervisor upon freeing
    
    ... unless they're part of a fully separate pool (and hence can't ever
    be used for guest allocations).
    
    This is CVE-2014-4021 / XSA-100.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Keir Fraser <keir@xen.org>
    master commit: 4bd78937ec324bcef4e29ef951e0ff9815770de1
    master date: 2014-06-17 15:21:10 +0200
---
 xen/common/page_alloc.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index f0de320..cf6b1bb 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1123,7 +1123,10 @@ void free_xenheap_pages(void *v, unsigned int order)
     pg = virt_to_page(v);
 
     for ( i = 0; i < (1u << order); i++ )
+    {
+        scrub_one_page(&pg[i]);
         pg[i].count_info &= ~PGC_xen_heap;
+    }
 
     free_heap_pages(pg, order);
 }
@@ -1290,6 +1293,8 @@ void free_domheap_pages(struct page_info *pg, unsigned int order)
     else
     {
         /* Freeing anonymous domain-heap pages. */
+        for ( i = 0; i < (1 << order); i++ )
+            scrub_one_page(&pg[i]);
         free_heap_pages(pg, order);
         drop_dom_ref = 0;
     }
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.1

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymEP-0006kv-1n; Sun, 22 Jun 2014 18:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEN-0006ko-Cj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:07 +0000
Received: from [85.158.139.211:31548] by server-16.bemta-5.messagelabs.com id
	EE/2C-18862-A3C17A35; Sun, 22 Jun 2014 18:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1403460665!11293874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18985 invoked from network); 22 Jun 2014 18:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEK-0000CL-Ib
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEJ-0007Wn-Ud
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:03 +0000
Date: Sun, 22 Jun 2014 18:11:03 +0000
Message-Id: <E1WymEJ-0007Wn-Ud@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: no need to set HCR_VI when
	using the vgic to inject irqs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f91502be64a05d0635454d629118b96ae38b50f
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:09 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:55 2014 +0100

    xen/arm: no need to set HCR_VI when using the vgic to inject irqs
    
    HCR_VI forces the guest to resume execution in IRQ mode and can actually
    cause spurious interrupt injections.
    The GIC is capable of injecting interrupts into the guest and causing it
    to switch to IRQ mode automatically, without any need for the hypervisor
    to set HCR_VI manually.
    
    See ARM ARM B1.8.11 and chapter 5.4 of the Generic Interrupt Controller
    Architecture Specification.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ff1addc..6b2653f 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -649,22 +649,6 @@ void gic_clear_pending_irqs(struct vcpu *v)
     spin_unlock_irqrestore(&gic.lock, flags);
 }
 
-static void gic_inject_irq_start(void)
-{
-    register_t hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr | HCR_VI, HCR_EL2);
-    isb();
-}
-
-static void gic_inject_irq_stop(void)
-{
-    register_t hcr = READ_SYSREG(HCR_EL2);
-    if (hcr & HCR_VI) {
-        WRITE_SYSREG(hcr & ~HCR_VI, HCR_EL2);
-        isb();
-    }
-}
-
 int gic_events_need_delivery(void)
 {
     return (!list_empty(&current->arch.vgic.lr_pending) ||
@@ -677,10 +661,6 @@ void gic_inject(void)
         vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq, 1);
 
     gic_restore_pending_irqs(current);
-    if (!gic_events_need_delivery())
-        gic_inject_irq_stop();
-    else
-        gic_inject_irq_start();
 }
 
 static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymEP-0006kv-1n; Sun, 22 Jun 2014 18:11:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEN-0006ko-Cj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:07 +0000
Received: from [85.158.139.211:31548] by server-16.bemta-5.messagelabs.com id
	EE/2C-18862-A3C17A35; Sun, 22 Jun 2014 18:11:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1403460665!11293874!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18985 invoked from network); 22 Jun 2014 18:11:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEK-0000CL-Ib
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEJ-0007Wn-Ud
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:03 +0000
Date: Sun, 22 Jun 2014 18:11:03 +0000
Message-Id: <E1WymEJ-0007Wn-Ud@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: no need to set HCR_VI when
	using the vgic to inject irqs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6f91502be64a05d0635454d629118b96ae38b50f
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:09 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:55 2014 +0100

    xen/arm: no need to set HCR_VI when using the vgic to inject irqs
    
    HCR_VI forces the guest to resume execution in IRQ mode and can actually
    cause spurious interrupt injections.
    The GIC is capable of injecting interrupts into the guest and causing it
    to switch to IRQ mode automatically, without any need for the hypervisor
    to set HCR_VI manually.
    
    See ARM ARM B1.8.11 and chapter 5.4 of the Generic Interrupt Controller
    Architecture Specification.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index ff1addc..6b2653f 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -649,22 +649,6 @@ void gic_clear_pending_irqs(struct vcpu *v)
     spin_unlock_irqrestore(&gic.lock, flags);
 }
 
-static void gic_inject_irq_start(void)
-{
-    register_t hcr = READ_SYSREG(HCR_EL2);
-    WRITE_SYSREG(hcr | HCR_VI, HCR_EL2);
-    isb();
-}
-
-static void gic_inject_irq_stop(void)
-{
-    register_t hcr = READ_SYSREG(HCR_EL2);
-    if (hcr & HCR_VI) {
-        WRITE_SYSREG(hcr & ~HCR_VI, HCR_EL2);
-        isb();
-    }
-}
-
 int gic_events_need_delivery(void)
 {
     return (!list_empty(&current->arch.vgic.lr_pending) ||
@@ -677,10 +661,6 @@ void gic_inject(void)
         vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq, 1);
 
     gic_restore_pending_irqs(current);
-    if (!gic_events_need_delivery())
-        gic_inject_irq_stop();
-    else
-        gic_inject_irq_start();
 }
 
 static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymEZ-0006lk-4S; Sun, 22 Jun 2014 18:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEX-0006lZ-Qg
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:18 +0000
Received: from [193.109.254.147:42025] by server-14.bemta-14.messagelabs.com
	id 94/79-08195-54C17A35; Sun, 22 Jun 2014 18:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403460675!12877247!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19092 invoked from network); 22 Jun 2014 18:11:16 -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 Jun 2014 18:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEV-0000CO-0N
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEU-0007XG-Rk
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:14 +0000
Date: Sun, 22 Jun 2014 18:11:14 +0000
Message-Id: <E1WymEU-0007XG-Rk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: remove unused virtual
	parameter from vgic_vcpu_inject_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65e15e78d413d982ea5073643ea4c5f419b10d75
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:10 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:55 2014 +0100

    xen/arm: remove unused virtual parameter from vgic_vcpu_inject_irq
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c     |    2 +-
 xen/arch/arm/gic.c        |    2 +-
 xen/arch/arm/irq.c        |    2 +-
 xen/arch/arm/time.c       |    2 +-
 xen/arch/arm/vgic.c       |    4 ++--
 xen/arch/arm/vtimer.c     |    4 ++--
 xen/include/asm-arm/gic.h |    2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 04d0cd0..e20ba0b 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -780,7 +780,7 @@ void vcpu_mark_events_pending(struct vcpu *v)
     if ( already_pending )
         return;
 
-    vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq, 1);
+    vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq);
 }
 
 /*
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 6b2653f..f441a83 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -658,7 +658,7 @@ int gic_events_need_delivery(void)
 void gic_inject(void)
 {
     if ( vcpu_info(current, evtchn_upcall_pending) )
-        vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq, 1);
+        vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
 
     gic_restore_pending_irqs(current);
 }
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 3a9a688..9c141bc 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -198,7 +198,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
         desc->arch.eoi_cpu = smp_processor_id();
 
         /* XXX: inject irq into all guest vcpus */
-        vgic_vcpu_inject_irq(d->vcpu[0], irq, 0);
+        vgic_vcpu_inject_irq(d->vcpu[0], irq);
         goto out_no_end;
     }
 
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 0395b7b..06cc709 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -217,7 +217,7 @@ static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
     current->arch.virt_timer.ctl = READ_SYSREG32(CNTV_CTL_EL0);
     WRITE_SYSREG32(current->arch.virt_timer.ctl | CNTx_CTL_MASK, CNTV_CTL_EL0);
-    vgic_vcpu_inject_irq(current, current->arch.virt_timer.irq, 1);
+    vgic_vcpu_inject_irq(current, current->arch.virt_timer.irq);
 }
 
 /* Set up the timer interrupt on this CPU */
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 4cf6470..9838ce5 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -476,7 +476,7 @@ static int vgic_to_sgi(struct vcpu *v, register_t sgir)
                      sgir, vcpu_mask);
             continue;
         }
-        vgic_vcpu_inject_irq(d->vcpu[vcpuid], virtual_irq, 1);
+        vgic_vcpu_inject_irq(d->vcpu[vcpuid], virtual_irq);
     }
     return 1;
 }
@@ -704,7 +704,7 @@ void vgic_clear_pending_irqs(struct vcpu *v)
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
-void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
+void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 {
     int idx = irq >> 2, byte = irq & 0x3;
     uint8_t priority;
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 7b50826..c268873 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -34,14 +34,14 @@ static void phys_timer_expired(void *data)
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_PENDING;
     if ( !(t->ctl & CNTx_CTL_MASK) )
-        vgic_vcpu_inject_irq(t->v, t->irq, 1);
+        vgic_vcpu_inject_irq(t->v, t->irq);
 }
 
 static void virt_timer_expired(void *data)
 {
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_MASK;
-    vgic_vcpu_inject_irq(t->v, t->irq, 1);
+    vgic_vcpu_inject_irq(t->v, t->irq);
 }
 
 int domain_vtimer_init(struct domain *d)
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 80f8dd2..8f75fd3 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -163,7 +163,7 @@ extern void domain_vgic_free(struct domain *d);
 
 extern int vcpu_vgic_init(struct vcpu *v);
 
-extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
+extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq);
 extern void vgic_clear_pending_irqs(struct vcpu *v);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymEZ-0006lk-4S; Sun, 22 Jun 2014 18:11:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEX-0006lZ-Qg
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:18 +0000
Received: from [193.109.254.147:42025] by server-14.bemta-14.messagelabs.com
	id 94/79-08195-54C17A35; Sun, 22 Jun 2014 18:11:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403460675!12877247!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19092 invoked from network); 22 Jun 2014 18:11:16 -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 Jun 2014 18:11:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEV-0000CO-0N
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEU-0007XG-Rk
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:14 +0000
Date: Sun, 22 Jun 2014 18:11:14 +0000
Message-Id: <E1WymEU-0007XG-Rk@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: remove unused virtual
	parameter from vgic_vcpu_inject_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 65e15e78d413d982ea5073643ea4c5f419b10d75
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:10 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:55 2014 +0100

    xen/arm: remove unused virtual parameter from vgic_vcpu_inject_irq
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c     |    2 +-
 xen/arch/arm/gic.c        |    2 +-
 xen/arch/arm/irq.c        |    2 +-
 xen/arch/arm/time.c       |    2 +-
 xen/arch/arm/vgic.c       |    4 ++--
 xen/arch/arm/vtimer.c     |    4 ++--
 xen/include/asm-arm/gic.h |    2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 04d0cd0..e20ba0b 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -780,7 +780,7 @@ void vcpu_mark_events_pending(struct vcpu *v)
     if ( already_pending )
         return;
 
-    vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq, 1);
+    vgic_vcpu_inject_irq(v, v->domain->arch.evtchn_irq);
 }
 
 /*
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 6b2653f..f441a83 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -658,7 +658,7 @@ int gic_events_need_delivery(void)
 void gic_inject(void)
 {
     if ( vcpu_info(current, evtchn_upcall_pending) )
-        vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq, 1);
+        vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
 
     gic_restore_pending_irqs(current);
 }
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 3a9a688..9c141bc 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -198,7 +198,7 @@ void do_IRQ(struct cpu_user_regs *regs, unsigned int irq, int is_fiq)
         desc->arch.eoi_cpu = smp_processor_id();
 
         /* XXX: inject irq into all guest vcpus */
-        vgic_vcpu_inject_irq(d->vcpu[0], irq, 0);
+        vgic_vcpu_inject_irq(d->vcpu[0], irq);
         goto out_no_end;
     }
 
diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c
index 0395b7b..06cc709 100644
--- a/xen/arch/arm/time.c
+++ b/xen/arch/arm/time.c
@@ -217,7 +217,7 @@ static void vtimer_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
     current->arch.virt_timer.ctl = READ_SYSREG32(CNTV_CTL_EL0);
     WRITE_SYSREG32(current->arch.virt_timer.ctl | CNTx_CTL_MASK, CNTV_CTL_EL0);
-    vgic_vcpu_inject_irq(current, current->arch.virt_timer.irq, 1);
+    vgic_vcpu_inject_irq(current, current->arch.virt_timer.irq);
 }
 
 /* Set up the timer interrupt on this CPU */
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 4cf6470..9838ce5 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -476,7 +476,7 @@ static int vgic_to_sgi(struct vcpu *v, register_t sgir)
                      sgir, vcpu_mask);
             continue;
         }
-        vgic_vcpu_inject_irq(d->vcpu[vcpuid], virtual_irq, 1);
+        vgic_vcpu_inject_irq(d->vcpu[vcpuid], virtual_irq);
     }
     return 1;
 }
@@ -704,7 +704,7 @@ void vgic_clear_pending_irqs(struct vcpu *v)
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
-void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq, int virtual)
+void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 {
     int idx = irq >> 2, byte = irq & 0x3;
     uint8_t priority;
diff --git a/xen/arch/arm/vtimer.c b/xen/arch/arm/vtimer.c
index 7b50826..c268873 100644
--- a/xen/arch/arm/vtimer.c
+++ b/xen/arch/arm/vtimer.c
@@ -34,14 +34,14 @@ static void phys_timer_expired(void *data)
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_PENDING;
     if ( !(t->ctl & CNTx_CTL_MASK) )
-        vgic_vcpu_inject_irq(t->v, t->irq, 1);
+        vgic_vcpu_inject_irq(t->v, t->irq);
 }
 
 static void virt_timer_expired(void *data)
 {
     struct vtimer *t = data;
     t->ctl |= CNTx_CTL_MASK;
-    vgic_vcpu_inject_irq(t->v, t->irq, 1);
+    vgic_vcpu_inject_irq(t->v, t->irq);
 }
 
 int domain_vtimer_init(struct domain *d)
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 80f8dd2..8f75fd3 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -163,7 +163,7 @@ extern void domain_vgic_free(struct domain *d);
 
 extern int vcpu_vgic_init(struct vcpu *v);
 
-extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq,int virtual);
+extern void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq);
 extern void vgic_clear_pending_irqs(struct vcpu *v);
 extern struct pending_irq *irq_to_pending(struct vcpu *v, unsigned int irq);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18: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.xen.org>)
	id 1WymEj-0006n3-78; Sun, 22 Jun 2014 18:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEh-0006mu-Rh
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:28 +0000
Received: from [193.109.254.147:59903] by server-16.bemta-14.messagelabs.com
	id 9A/20-16986-F4C17A35; Sun, 22 Jun 2014 18:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403460685!8254162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16071 invoked from network); 22 Jun 2014 18:11:26 -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;
	22 Jun 2014 18:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEf-0000CZ-6R
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEf-0007Xd-4d
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:25 +0000
Date: Sun, 22 Jun 2014 18:11:25 +0000
Message-Id: <E1WymEf-0007Xd-4d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: set GICH_HCR_UIE if all the
	LRs are in use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 596f885a3202159ee16cfe96d2cbfce4b348af52
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:11 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: set GICH_HCR_UIE if all the LRs are in use
    
    On return to guest, if there are no free LRs and we still have more
    interrupt to inject, set GICH_HCR_UIE so that we are going to receive a
    maintenance interrupt when no pending interrupts are present in the LR
    registers.
    The maintenance interrupt handler won't do anything anymore, but
    receiving the interrupt is going to cause gic_inject to be called on
    return to guest that is going to clear the old LRs and inject new
    interrupts.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index f441a83..d455031 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -55,6 +55,7 @@ static struct {
 static DEFINE_PER_CPU(uint64_t, lr_mask);
 
 static unsigned nr_lrs;
+#define lr_all_full() (this_cpu(lr_mask) == ((1 << nr_lrs) - 1))
 
 /* The GIC mapping of CPU interfaces does not necessarily match the
  * logical CPU numbering. Let's use mapping as returned by the GIC
@@ -661,6 +662,13 @@ void gic_inject(void)
         vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
 
     gic_restore_pending_irqs(current);
+
+
+    if ( !list_empty(&current->arch.vgic.lr_pending) && lr_all_full() )
+        GICH[GICH_HCR] |= GICH_HCR_UIE;
+    else
+        GICH[GICH_HCR] &= ~GICH_HCR_UIE;
+
 }
 
 static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18: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.xen.org>)
	id 1WymEj-0006n3-78; Sun, 22 Jun 2014 18:11:29 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEh-0006mu-Rh
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:28 +0000
Received: from [193.109.254.147:59903] by server-16.bemta-14.messagelabs.com
	id 9A/20-16986-F4C17A35; Sun, 22 Jun 2014 18:11:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403460685!8254162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16071 invoked from network); 22 Jun 2014 18:11:26 -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;
	22 Jun 2014 18:11:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEf-0000CZ-6R
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEf-0007Xd-4d
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:25 +0000
Date: Sun, 22 Jun 2014 18:11:25 +0000
Message-Id: <E1WymEf-0007Xd-4d@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: set GICH_HCR_UIE if all the
	LRs are in use
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 596f885a3202159ee16cfe96d2cbfce4b348af52
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:11 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: set GICH_HCR_UIE if all the LRs are in use
    
    On return to guest, if there are no free LRs and we still have more
    interrupt to inject, set GICH_HCR_UIE so that we are going to receive a
    maintenance interrupt when no pending interrupts are present in the LR
    registers.
    The maintenance interrupt handler won't do anything anymore, but
    receiving the interrupt is going to cause gic_inject to be called on
    return to guest that is going to clear the old LRs and inject new
    interrupts.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index f441a83..d455031 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -55,6 +55,7 @@ static struct {
 static DEFINE_PER_CPU(uint64_t, lr_mask);
 
 static unsigned nr_lrs;
+#define lr_all_full() (this_cpu(lr_mask) == ((1 << nr_lrs) - 1))
 
 /* The GIC mapping of CPU interfaces does not necessarily match the
  * logical CPU numbering. Let's use mapping as returned by the GIC
@@ -661,6 +662,13 @@ void gic_inject(void)
         vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
 
     gic_restore_pending_irqs(current);
+
+
+    if ( !list_empty(&current->arch.vgic.lr_pending) && lr_all_full() )
+        GICH[GICH_HCR] |= GICH_HCR_UIE;
+    else
+        GICH[GICH_HCR] &= ~GICH_HCR_UIE;
+
 }
 
 static void do_sgi(struct cpu_user_regs *regs, int othercpu, enum gic_sgi sgi)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymEu-0006oP-9v; Sun, 22 Jun 2014 18:11:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEs-0006oD-N4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:38 +0000
Received: from [85.158.137.68:51497] by server-3.bemta-3.messagelabs.com id
	95/45-12895-95C17A35; Sun, 22 Jun 2014 18:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403460695!11609489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17997 invoked from network); 22 Jun 2014 18:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEp-0000Cf-Bp
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEp-0007YP-9Q
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:35 +0000
Date: Sun, 22 Jun 2014 18:11:35 +0000
Message-Id: <E1WymEp-0007YP-9Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support HW interrupts,
	do not request maintenance_interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5495a512b63bad868c147198f7f049c2617d468c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: support HW interrupts, do not request maintenance_interrupts
    
    If the irq to be injected is an hardware irq (p->desc != NULL), set
    GICH_LR_HW. Do not set GICH_LR_MAINTENANCE_IRQ.
    
    Remove the code to EOI a physical interrupt on behalf of the guest
    because it has become unnecessary.
    
    Introduce a new function, gic_clear_lrs, that goes over the GICH_LR
    registers, clear the invalid ones and free the corresponding interrupts
    from the inflight queue if appropriate. Add the interrupt to lr_pending
    if the GIC_IRQ_GUEST_PENDING is still set.
    
    Call gic_clear_lrs on entry to the hypervisor if we are coming from
    guest mode to make sure that the calculation in Xen of the highest
    priority interrupt currently inflight is correct and accurate and not
    based on stale data.
    
    In vgic_vcpu_inject_irq, if the target is a vcpu running on another
    pcpu, we are already sending an SGI to the other pcpu so that it would
    pick up the new IRQ to inject.  Now also send an SGI to the other pcpu
    even if the IRQ is already inflight, so that it can clear the LR
    corresponding to the previous injection as well as injecting the new
    interrupt.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c        |  136 +++++++++++++++++++++------------------------
 xen/arch/arm/traps.c      |   10 +++
 xen/arch/arm/vgic.c       |    3 +-
 xen/include/asm-arm/gic.h |    1 +
 4 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index d455031..302c031 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -66,6 +66,8 @@ static DEFINE_PER_CPU(u8, gic_cpu_id);
 /* Maximum cpu interface per GIC */
 #define NR_GIC_CPU_IF 8
 
+static void gic_update_one_lr(struct vcpu *v, int i);
+
 static unsigned int gic_cpu_mask(const cpumask_t *cpumask)
 {
     unsigned int cpu;
@@ -549,16 +551,18 @@ void gic_disable_cpu(void)
 static inline void gic_set_lr(int lr, struct pending_irq *p,
         unsigned int state)
 {
-    int maintenance_int = GICH_LR_MAINTENANCE_IRQ;
+    uint32_t lr_val;
 
     BUG_ON(lr >= nr_lrs);
     BUG_ON(lr < 0);
     BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
 
-    GICH[GICH_LR + lr] = state |
-        maintenance_int |
-        ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
+    lr_val = state | ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
         ((p->irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT);
+    if ( p->desc != NULL )
+        lr_val |= GICH_LR_HW | (p->desc->irq << GICH_LR_PHYSICAL_SHIFT);
+
+    GICH[GICH_LR + lr] = lr_val;
 
     set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
     clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
@@ -618,6 +622,55 @@ out:
     return;
 }
 
+static void gic_update_one_lr(struct vcpu *v, int i)
+{
+    struct pending_irq *p;
+    uint32_t lr;
+    int irq;
+
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
+    lr = GICH[GICH_LR + i];
+    if ( !(lr & (GICH_LR_PENDING|GICH_LR_ACTIVE)) )
+    {
+        GICH[GICH_LR + i] = 0;
+        clear_bit(i, &this_cpu(lr_mask));
+
+        irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
+        p = irq_to_pending(v, irq);
+        if ( p->desc != NULL )
+            p->desc->status &= ~IRQ_INPROGRESS;
+        clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
+                test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
+            gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+        else
+            list_del_init(&p->inflight);
+    }
+}
+
+void gic_clear_lrs(struct vcpu *v)
+{
+    int i = 0;
+    unsigned long flags;
+
+    /* The idle domain has no LRs to be cleared. Since gic_restore_state
+     * doesn't write any LR registers for the idle domain they could be
+     * non-zero. */
+    if ( is_idle_vcpu(v) )
+        return;
+
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask),
+                              nr_lrs, i)) < nr_lrs ) {
+        gic_update_one_lr(v, i);
+        i++;
+    }
+
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+}
+
 static void gic_restore_pending_irqs(struct vcpu *v)
 {
     int i;
@@ -773,77 +826,14 @@ int gicv_setup(struct domain *d)
 
 }
 
-static void gic_irq_eoi(void *info)
-{
-    int virq = (uintptr_t) info;
-    GICC[GICC_DIR] = virq;
-}
-
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    int i = 0, virq, pirq = -1;
-    uint32_t lr;
-    struct vcpu *v = current;
-    uint64_t eisr = GICH[GICH_EISR0] | (((uint64_t) GICH[GICH_EISR1]) << 32);
-
-    while ((i = find_next_bit((const long unsigned int *) &eisr,
-                              64, i)) < 64) {
-        struct pending_irq *p, *p2;
-        int cpu;
-        bool_t inflight;
-
-        cpu = -1;
-        inflight = 0;
-
-        spin_lock_irq(&gic.lock);
-        lr = GICH[GICH_LR + i];
-        virq = lr & GICH_LR_VIRTUAL_MASK;
-        GICH[GICH_LR + i] = 0;
-        clear_bit(i, &this_cpu(lr_mask));
-
-        p = irq_to_pending(v, virq);
-        if ( p->desc != NULL ) {
-            p->desc->status &= ~IRQ_INPROGRESS;
-            /* Assume only one pcpu needs to EOI the irq */
-            cpu = p->desc->arch.eoi_cpu;
-            pirq = p->desc->irq;
-        }
-        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
-             test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
-        {
-            inflight = 1;
-            gic_add_to_lr_pending(v, p);
-        }
-
-        clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
-
-        if ( !list_empty(&v->arch.vgic.lr_pending) ) {
-            p2 = list_entry(v->arch.vgic.lr_pending.next, typeof(*p2), lr_queue);
-            gic_set_lr(i, p2, GICH_LR_PENDING);
-            list_del_init(&p2->lr_queue);
-            set_bit(i, &this_cpu(lr_mask));
-        }
-        spin_unlock_irq(&gic.lock);
-
-        if ( !inflight )
-        {
-            spin_lock_irq(&v->arch.vgic.lock);
-            list_del_init(&p->inflight);
-            spin_unlock_irq(&v->arch.vgic.lock);
-        }
-
-        if ( p->desc != NULL ) {
-            /* this is not racy because we can't receive another irq of the
-             * same type until we EOI it.  */
-            if ( cpu == smp_processor_id() )
-                gic_irq_eoi((void*)(uintptr_t)pirq);
-            else
-                on_selected_cpus(cpumask_of(cpu),
-                                 gic_irq_eoi, (void*)(uintptr_t)pirq, 0);
-        }
-
-        i++;
-    }
+    /*
+     * This is a dummy interrupt handler.
+     * Receiving the interrupt is going to cause gic_inject to be called
+     * on return to guest that is going to clear the old LRs and inject
+     * new interrupts.
+     */
 }
 
 void gic_dump_info(struct vcpu *v)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 333d5c0..31127fe 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1762,10 +1762,18 @@ bad_data_abort:
     inject_dabt_exception(regs, info.gva, hsr.len);
 }
 
+static void enter_hypervisor_head(struct cpu_user_regs *regs)
+{
+    if ( guest_mode(regs) )
+        gic_clear_lrs(current);
+}
+
 asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
 {
     union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) };
 
+    enter_hypervisor_head(regs);
+
     switch (hsr.ec) {
     case HSR_EC_WFI_WFE:
         if ( !check_conditional_instr(regs, hsr) )
@@ -1858,11 +1866,13 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
 
 asmlinkage void do_trap_irq(struct cpu_user_regs *regs)
 {
+    enter_hypervisor_head(regs);
     gic_interrupt(regs, 0);
 }
 
 asmlinkage void do_trap_fiq(struct cpu_user_regs *regs)
 {
+    enter_hypervisor_head(regs);
     gic_interrupt(regs, 1);
 }
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 9838ce5..d5b3a4b 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -720,8 +720,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
         if ( (irq != current->domain->arch.evtchn_irq) ||
              (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
             set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
-        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
-        return;
+        goto out;
     }
 
     /* vcpu offline */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 8f75fd3..2ba4802 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -218,6 +218,7 @@ extern unsigned int gic_number_lines(void);
 /* IRQ translation function for the device tree */
 int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
                   unsigned int *out_hwirq, unsigned int *out_type);
+void gic_clear_lrs(struct vcpu *v);
 
 #endif /* __ASSEMBLY__ */
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymEu-0006oP-9v; Sun, 22 Jun 2014 18:11:40 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEs-0006oD-N4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:38 +0000
Received: from [85.158.137.68:51497] by server-3.bemta-3.messagelabs.com id
	95/45-12895-95C17A35; Sun, 22 Jun 2014 18:11:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403460695!11609489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17997 invoked from network); 22 Jun 2014 18:11:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEp-0000Cf-Bp
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEp-0007YP-9Q
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:35 +0000
Date: Sun, 22 Jun 2014 18:11:35 +0000
Message-Id: <E1WymEp-0007YP-9Q@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: support HW interrupts,
	do not request maintenance_interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5495a512b63bad868c147198f7f049c2617d468c
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:12 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: support HW interrupts, do not request maintenance_interrupts
    
    If the irq to be injected is an hardware irq (p->desc != NULL), set
    GICH_LR_HW. Do not set GICH_LR_MAINTENANCE_IRQ.
    
    Remove the code to EOI a physical interrupt on behalf of the guest
    because it has become unnecessary.
    
    Introduce a new function, gic_clear_lrs, that goes over the GICH_LR
    registers, clear the invalid ones and free the corresponding interrupts
    from the inflight queue if appropriate. Add the interrupt to lr_pending
    if the GIC_IRQ_GUEST_PENDING is still set.
    
    Call gic_clear_lrs on entry to the hypervisor if we are coming from
    guest mode to make sure that the calculation in Xen of the highest
    priority interrupt currently inflight is correct and accurate and not
    based on stale data.
    
    In vgic_vcpu_inject_irq, if the target is a vcpu running on another
    pcpu, we are already sending an SGI to the other pcpu so that it would
    pick up the new IRQ to inject.  Now also send an SGI to the other pcpu
    even if the IRQ is already inflight, so that it can clear the LR
    corresponding to the previous injection as well as injecting the new
    interrupt.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c        |  136 +++++++++++++++++++++------------------------
 xen/arch/arm/traps.c      |   10 +++
 xen/arch/arm/vgic.c       |    3 +-
 xen/include/asm-arm/gic.h |    1 +
 4 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index d455031..302c031 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -66,6 +66,8 @@ static DEFINE_PER_CPU(u8, gic_cpu_id);
 /* Maximum cpu interface per GIC */
 #define NR_GIC_CPU_IF 8
 
+static void gic_update_one_lr(struct vcpu *v, int i);
+
 static unsigned int gic_cpu_mask(const cpumask_t *cpumask)
 {
     unsigned int cpu;
@@ -549,16 +551,18 @@ void gic_disable_cpu(void)
 static inline void gic_set_lr(int lr, struct pending_irq *p,
         unsigned int state)
 {
-    int maintenance_int = GICH_LR_MAINTENANCE_IRQ;
+    uint32_t lr_val;
 
     BUG_ON(lr >= nr_lrs);
     BUG_ON(lr < 0);
     BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
 
-    GICH[GICH_LR + lr] = state |
-        maintenance_int |
-        ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
+    lr_val = state | ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
         ((p->irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT);
+    if ( p->desc != NULL )
+        lr_val |= GICH_LR_HW | (p->desc->irq << GICH_LR_PHYSICAL_SHIFT);
+
+    GICH[GICH_LR + lr] = lr_val;
 
     set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
     clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
@@ -618,6 +622,55 @@ out:
     return;
 }
 
+static void gic_update_one_lr(struct vcpu *v, int i)
+{
+    struct pending_irq *p;
+    uint32_t lr;
+    int irq;
+
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
+    lr = GICH[GICH_LR + i];
+    if ( !(lr & (GICH_LR_PENDING|GICH_LR_ACTIVE)) )
+    {
+        GICH[GICH_LR + i] = 0;
+        clear_bit(i, &this_cpu(lr_mask));
+
+        irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
+        p = irq_to_pending(v, irq);
+        if ( p->desc != NULL )
+            p->desc->status &= ~IRQ_INPROGRESS;
+        clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
+                test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
+            gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+        else
+            list_del_init(&p->inflight);
+    }
+}
+
+void gic_clear_lrs(struct vcpu *v)
+{
+    int i = 0;
+    unsigned long flags;
+
+    /* The idle domain has no LRs to be cleared. Since gic_restore_state
+     * doesn't write any LR registers for the idle domain they could be
+     * non-zero. */
+    if ( is_idle_vcpu(v) )
+        return;
+
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    while ((i = find_next_bit((const unsigned long *) &this_cpu(lr_mask),
+                              nr_lrs, i)) < nr_lrs ) {
+        gic_update_one_lr(v, i);
+        i++;
+    }
+
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+}
+
 static void gic_restore_pending_irqs(struct vcpu *v)
 {
     int i;
@@ -773,77 +826,14 @@ int gicv_setup(struct domain *d)
 
 }
 
-static void gic_irq_eoi(void *info)
-{
-    int virq = (uintptr_t) info;
-    GICC[GICC_DIR] = virq;
-}
-
 static void maintenance_interrupt(int irq, void *dev_id, struct cpu_user_regs *regs)
 {
-    int i = 0, virq, pirq = -1;
-    uint32_t lr;
-    struct vcpu *v = current;
-    uint64_t eisr = GICH[GICH_EISR0] | (((uint64_t) GICH[GICH_EISR1]) << 32);
-
-    while ((i = find_next_bit((const long unsigned int *) &eisr,
-                              64, i)) < 64) {
-        struct pending_irq *p, *p2;
-        int cpu;
-        bool_t inflight;
-
-        cpu = -1;
-        inflight = 0;
-
-        spin_lock_irq(&gic.lock);
-        lr = GICH[GICH_LR + i];
-        virq = lr & GICH_LR_VIRTUAL_MASK;
-        GICH[GICH_LR + i] = 0;
-        clear_bit(i, &this_cpu(lr_mask));
-
-        p = irq_to_pending(v, virq);
-        if ( p->desc != NULL ) {
-            p->desc->status &= ~IRQ_INPROGRESS;
-            /* Assume only one pcpu needs to EOI the irq */
-            cpu = p->desc->arch.eoi_cpu;
-            pirq = p->desc->irq;
-        }
-        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
-             test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
-        {
-            inflight = 1;
-            gic_add_to_lr_pending(v, p);
-        }
-
-        clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
-
-        if ( !list_empty(&v->arch.vgic.lr_pending) ) {
-            p2 = list_entry(v->arch.vgic.lr_pending.next, typeof(*p2), lr_queue);
-            gic_set_lr(i, p2, GICH_LR_PENDING);
-            list_del_init(&p2->lr_queue);
-            set_bit(i, &this_cpu(lr_mask));
-        }
-        spin_unlock_irq(&gic.lock);
-
-        if ( !inflight )
-        {
-            spin_lock_irq(&v->arch.vgic.lock);
-            list_del_init(&p->inflight);
-            spin_unlock_irq(&v->arch.vgic.lock);
-        }
-
-        if ( p->desc != NULL ) {
-            /* this is not racy because we can't receive another irq of the
-             * same type until we EOI it.  */
-            if ( cpu == smp_processor_id() )
-                gic_irq_eoi((void*)(uintptr_t)pirq);
-            else
-                on_selected_cpus(cpumask_of(cpu),
-                                 gic_irq_eoi, (void*)(uintptr_t)pirq, 0);
-        }
-
-        i++;
-    }
+    /*
+     * This is a dummy interrupt handler.
+     * Receiving the interrupt is going to cause gic_inject to be called
+     * on return to guest that is going to clear the old LRs and inject
+     * new interrupts.
+     */
 }
 
 void gic_dump_info(struct vcpu *v)
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 333d5c0..31127fe 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -1762,10 +1762,18 @@ bad_data_abort:
     inject_dabt_exception(regs, info.gva, hsr.len);
 }
 
+static void enter_hypervisor_head(struct cpu_user_regs *regs)
+{
+    if ( guest_mode(regs) )
+        gic_clear_lrs(current);
+}
+
 asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
 {
     union hsr hsr = { .bits = READ_SYSREG32(ESR_EL2) };
 
+    enter_hypervisor_head(regs);
+
     switch (hsr.ec) {
     case HSR_EC_WFI_WFE:
         if ( !check_conditional_instr(regs, hsr) )
@@ -1858,11 +1866,13 @@ asmlinkage void do_trap_hypervisor(struct cpu_user_regs *regs)
 
 asmlinkage void do_trap_irq(struct cpu_user_regs *regs)
 {
+    enter_hypervisor_head(regs);
     gic_interrupt(regs, 0);
 }
 
 asmlinkage void do_trap_fiq(struct cpu_user_regs *regs)
 {
+    enter_hypervisor_head(regs);
     gic_interrupt(regs, 1);
 }
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index 9838ce5..d5b3a4b 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -720,8 +720,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
         if ( (irq != current->domain->arch.evtchn_irq) ||
              (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
             set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
-        spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
-        return;
+        goto out;
     }
 
     /* vcpu offline */
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 8f75fd3..2ba4802 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -218,6 +218,7 @@ extern unsigned int gic_number_lines(void);
 /* IRQ translation function for the device tree */
 int gic_irq_xlate(const u32 *intspec, unsigned int intsize,
                   unsigned int *out_hwirq, unsigned int *out_type);
+void gic_clear_lrs(struct vcpu *v);
 
 #endif /* __ASSEMBLY__ */
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymF3-0006py-DB; Sun, 22 Jun 2014 18:11:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymF2-0006pg-2j
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:48 +0000
Received: from [193.109.254.147:60464] by server-9.bemta-14.messagelabs.com id
	41/16-03644-36C17A35; Sun, 22 Jun 2014 18:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403460705!12893144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1505 invoked from network); 22 Jun 2014 18:11:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEz-0000Cl-Gc
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEz-0007ZW-Eg
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:45 +0000
Date: Sun, 22 Jun 2014 18:11:45 +0000
Message-Id: <E1WymEz-0007ZW-Eg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: nr_lrs should be uint8_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0623c052fe65fded9489b52f09b58c718242b109
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:13 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: nr_lrs should be uint8_t
    
    A later patch is going to use uint8_t to keep track of LRs.
    Both GICv3 and GICv2 don't need any more than an uint8_t to keep track
    of the number of LRs.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 302c031..eeaf685 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -54,7 +54,7 @@ static struct {
 
 static DEFINE_PER_CPU(uint64_t, lr_mask);
 
-static unsigned nr_lrs;
+static uint8_t nr_lrs;
 #define lr_all_full() (this_cpu(lr_mask) == ((1 << nr_lrs) - 1))
 
 /* The GIC mapping of CPU interfaces does not necessarily match the
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:11:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:11:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymF3-0006py-DB; Sun, 22 Jun 2014 18:11:49 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymF2-0006pg-2j
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:48 +0000
Received: from [193.109.254.147:60464] by server-9.bemta-14.messagelabs.com id
	41/16-03644-36C17A35; Sun, 22 Jun 2014 18:11:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403460705!12893144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1505 invoked from network); 22 Jun 2014 18:11:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEz-0000Cl-Gc
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymEz-0007ZW-Eg
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:45 +0000
Date: Sun, 22 Jun 2014 18:11:45 +0000
Message-Id: <E1WymEz-0007ZW-Eg@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: nr_lrs should be uint8_t
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0623c052fe65fded9489b52f09b58c718242b109
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:13 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: nr_lrs should be uint8_t
    
    A later patch is going to use uint8_t to keep track of LRs.
    Both GICv3 and GICv2 don't need any more than an uint8_t to keep track
    of the number of LRs.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 302c031..eeaf685 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -54,7 +54,7 @@ static struct {
 
 static DEFINE_PER_CPU(uint64_t, lr_mask);
 
-static unsigned nr_lrs;
+static uint8_t nr_lrs;
 #define lr_all_full() (this_cpu(lr_mask) == ((1 << nr_lrs) - 1))
 
 /* The GIC mapping of CPU interfaces does not necessarily match the
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFE-0006rx-G1; Sun, 22 Jun 2014 18:12:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFC-0006ra-Jw
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:58 +0000
Received: from [85.158.143.35:63408] by server-1.bemta-4.messagelabs.com id
	DC/87-09496-D6C17A35; Sun, 22 Jun 2014 18:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1403460716!12990721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21943 invoked from network); 22 Jun 2014 18:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymF9-0000Cr-UM
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymF9-0007a3-Jz
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:55 +0000
Date: Sun, 22 Jun 2014 18:11:55 +0000
Message-Id: <E1WymF9-0007a3-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: keep track of the GICH_LR
	used for the irq in struct pending_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46e3e62ef0e85b81ea13a842f31b439bd002c51a
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:14 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: keep track of the GICH_LR used for the irq in struct pending_irq
    
    Move the irq field in pending_irq to improve packing.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c           |    4 +++-
 xen/include/asm-arm/domain.h |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index eeaf685..1010bee 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -566,6 +566,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
 
     set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
     clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
+    p->lr = lr;
 }
 
 static inline void gic_add_to_lr_pending(struct vcpu *v, struct pending_irq *n)
@@ -641,6 +642,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
         if ( p->desc != NULL )
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+        p->lr = GIC_INVALID_LR;
         if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
                 test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
@@ -853,7 +855,7 @@ void gic_dump_info(struct vcpu *v)
 
     list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight )
     {
-        printk("Inflight irq=%d\n", p->irq);
+        printk("Inflight irq=%d lr=%u\n", p->irq, p->lr);
     }
 
     list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index f6cb1c0..bee798b 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -22,7 +22,6 @@ struct vgic_irq_rank {
 
 struct pending_irq
 {
-    int irq;
     /*
      * The following two states track the lifecycle of the guest irq.
      * However because we are not sure and we don't want to track
@@ -61,6 +60,9 @@ struct pending_irq
 #define GIC_IRQ_GUEST_ENABLED  2
     unsigned long status;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
+    int irq;
+#define GIC_INVALID_LR         ~(uint8_t)0
+    uint8_t lr;
     uint8_t priority;
     /* inflight is used to append instances of pending_irq to
      * vgic.inflight_irqs */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFE-0006rx-G1; Sun, 22 Jun 2014 18:12:00 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFC-0006ra-Jw
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:58 +0000
Received: from [85.158.143.35:63408] by server-1.bemta-4.messagelabs.com id
	DC/87-09496-D6C17A35; Sun, 22 Jun 2014 18:11:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-21.messagelabs.com!1403460716!12990721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21943 invoked from network); 22 Jun 2014 18:11:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:11:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymF9-0000Cr-UM
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymF9-0007a3-Jz
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:11:55 +0000
Date: Sun, 22 Jun 2014 18:11:55 +0000
Message-Id: <E1WymF9-0007a3-Jz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: keep track of the GICH_LR
	used for the irq in struct pending_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 46e3e62ef0e85b81ea13a842f31b439bd002c51a
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:14 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: keep track of the GICH_LR used for the irq in struct pending_irq
    
    Move the irq field in pending_irq to improve packing.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c           |    4 +++-
 xen/include/asm-arm/domain.h |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index eeaf685..1010bee 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -566,6 +566,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
 
     set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
     clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
+    p->lr = lr;
 }
 
 static inline void gic_add_to_lr_pending(struct vcpu *v, struct pending_irq *n)
@@ -641,6 +642,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
         if ( p->desc != NULL )
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+        p->lr = GIC_INVALID_LR;
         if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
                 test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
             gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
@@ -853,7 +855,7 @@ void gic_dump_info(struct vcpu *v)
 
     list_for_each_entry ( p, &v->arch.vgic.inflight_irqs, inflight )
     {
-        printk("Inflight irq=%d\n", p->irq);
+        printk("Inflight irq=%d lr=%u\n", p->irq, p->lr);
     }
 
     list_for_each_entry( p, &v->arch.vgic.lr_pending, lr_queue )
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index f6cb1c0..bee798b 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -22,7 +22,6 @@ struct vgic_irq_rank {
 
 struct pending_irq
 {
-    int irq;
     /*
      * The following two states track the lifecycle of the guest irq.
      * However because we are not sure and we don't want to track
@@ -61,6 +60,9 @@ struct pending_irq
 #define GIC_IRQ_GUEST_ENABLED  2
     unsigned long status;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
+    int irq;
+#define GIC_INVALID_LR         ~(uint8_t)0
+    uint8_t lr;
     uint8_t priority;
     /* inflight is used to append instances of pending_irq to
      * vgic.inflight_irqs */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFN-0006to-KV; Sun, 22 Jun 2014 18:12:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFM-0006tZ-O8
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:08 +0000
Received: from [85.158.139.211:37011] by server-12.bemta-5.messagelabs.com id
	FB/5F-27841-87C17A35; Sun, 22 Jun 2014 18:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403460726!6016715!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3526 invoked from network); 22 Jun 2014 18:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFK-0000DR-4g
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFK-0007as-1Z
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:06 +0000
Date: Sun, 22 Jun 2014 18:12:06 +0000
Message-Id: <E1WymFK-0007as-1Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm:
	s/gic_set_guest_irq/gic_raise_guest_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68dcdf942326ad90ca527831afbee9cd4a867f84
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:15 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: s/gic_set_guest_irq/gic_raise_guest_irq
    
    Rename gic_set_guest_irq to gic_raise_guest_irq and remove the state
    parameter.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |    8 ++++----
 xen/arch/arm/vgic.c       |    4 ++--
 xen/include/asm-arm/gic.h |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1010bee..bb50acd 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -598,8 +598,8 @@ void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
     spin_unlock_irqrestore(&gic.lock, flags);
 }
 
-void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
-        unsigned int state, unsigned int priority)
+void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
+        unsigned int priority)
 {
     int i;
     unsigned long flags;
@@ -611,7 +611,7 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if (i < nr_lrs) {
             set_bit(i, &this_cpu(lr_mask));
-            gic_set_lr(i, irq_to_pending(v, virtual_irq), state);
+            gic_set_lr(i, irq_to_pending(v, virtual_irq), GICH_LR_PENDING);
             goto out;
         }
     }
@@ -645,7 +645,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
         p->lr = GIC_INVALID_LR;
         if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
                 test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
-            gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+            gic_raise_guest_irq(v, irq, p->priority);
         else
             list_del_init(&p->inflight);
     }
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index d5b3a4b..b6c3ebe 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -405,7 +405,7 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         p = irq_to_pending(v, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
-            gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+            gic_raise_guest_irq(v, irq, p->priority);
         if ( p->desc != NULL )
         {
             spin_lock_irqsave(&p->desc->lock, flags);
@@ -738,7 +738,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 
     /* the irq is enabled */
     if ( test_bit(GIC_IRQ_GUEST_ENABLED, &n->status) )
-        gic_set_guest_irq(v, irq, GICH_LR_PENDING, priority);
+        gic_raise_guest_irq(v, irq, priority);
 
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 2ba4802..ee06646 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -179,8 +179,8 @@ extern void gic_clear_pending_irqs(struct vcpu *v);
 extern int gic_events_need_delivery(void);
 
 extern void __cpuinit init_maintenance_interrupt(void);
-extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
-        unsigned int state, unsigned int priority);
+extern void gic_raise_guest_irq(struct vcpu *v, unsigned int irq,
+        unsigned int priority);
 extern void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq);
 
 /* Accept an interrupt from the GIC and dispatch its handler */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFN-0006to-KV; Sun, 22 Jun 2014 18:12:09 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFM-0006tZ-O8
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:08 +0000
Received: from [85.158.139.211:37011] by server-12.bemta-5.messagelabs.com id
	FB/5F-27841-87C17A35; Sun, 22 Jun 2014 18:12:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403460726!6016715!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3526 invoked from network); 22 Jun 2014 18:12:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFK-0000DR-4g
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFK-0007as-1Z
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:06 +0000
Date: Sun, 22 Jun 2014 18:12:06 +0000
Message-Id: <E1WymFK-0007as-1Z@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm:
	s/gic_set_guest_irq/gic_raise_guest_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 68dcdf942326ad90ca527831afbee9cd4a867f84
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:15 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: s/gic_set_guest_irq/gic_raise_guest_irq
    
    Rename gic_set_guest_irq to gic_raise_guest_irq and remove the state
    parameter.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |    8 ++++----
 xen/arch/arm/vgic.c       |    4 ++--
 xen/include/asm-arm/gic.h |    4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 1010bee..bb50acd 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -598,8 +598,8 @@ void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
     spin_unlock_irqrestore(&gic.lock, flags);
 }
 
-void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
-        unsigned int state, unsigned int priority)
+void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
+        unsigned int priority)
 {
     int i;
     unsigned long flags;
@@ -611,7 +611,7 @@ void gic_set_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if (i < nr_lrs) {
             set_bit(i, &this_cpu(lr_mask));
-            gic_set_lr(i, irq_to_pending(v, virtual_irq), state);
+            gic_set_lr(i, irq_to_pending(v, virtual_irq), GICH_LR_PENDING);
             goto out;
         }
     }
@@ -645,7 +645,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
         p->lr = GIC_INVALID_LR;
         if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
                 test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
-            gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+            gic_raise_guest_irq(v, irq, p->priority);
         else
             list_del_init(&p->inflight);
     }
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index d5b3a4b..b6c3ebe 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -405,7 +405,7 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         p = irq_to_pending(v, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
         if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
-            gic_set_guest_irq(v, irq, GICH_LR_PENDING, p->priority);
+            gic_raise_guest_irq(v, irq, p->priority);
         if ( p->desc != NULL )
         {
             spin_lock_irqsave(&p->desc->lock, flags);
@@ -738,7 +738,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 
     /* the irq is enabled */
     if ( test_bit(GIC_IRQ_GUEST_ENABLED, &n->status) )
-        gic_set_guest_irq(v, irq, GICH_LR_PENDING, priority);
+        gic_raise_guest_irq(v, irq, priority);
 
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 2ba4802..ee06646 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -179,8 +179,8 @@ extern void gic_clear_pending_irqs(struct vcpu *v);
 extern int gic_events_need_delivery(void);
 
 extern void __cpuinit init_maintenance_interrupt(void);
-extern void gic_set_guest_irq(struct vcpu *v, unsigned int irq,
-        unsigned int state, unsigned int priority);
+extern void gic_raise_guest_irq(struct vcpu *v, unsigned int irq,
+        unsigned int priority);
 extern void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq);
 
 /* Accept an interrupt from the GIC and dispatch its handler */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFX-0006vT-NC; Sun, 22 Jun 2014 18:12:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFX-0006vH-2V
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:19 +0000
Received: from [85.158.143.35:2394] by server-1.bemta-4.messagelabs.com id
	6D/97-09496-28C17A35; Sun, 22 Jun 2014 18:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1403460736!12997695!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30710 invoked from network); 22 Jun 2014 18:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFU-0000DX-Aj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFU-0007bN-7h
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:16 +0000
Date: Sun, 22 Jun 2014 18:12:16 +0000
Message-Id: <E1WymFU-0007bN-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: rename GIC_IRQ_GUEST_PENDING
	to GIC_IRQ_GUEST_QUEUED
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 229739b36646e657b8f9d75b1e5d249fd36773f8
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:16 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: rename GIC_IRQ_GUEST_PENDING to GIC_IRQ_GUEST_QUEUED
    
    Rename GIC_IRQ_GUEST_PENDING to GIC_IRQ_GUEST_QUEUED and clarify its
    meaning in xen/include/asm-arm/domain.h.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |    4 ++--
 xen/arch/arm/vgic.c          |    4 ++--
 xen/include/asm-arm/domain.h |   23 ++++++++++++-----------
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index bb50acd..54936d7 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -565,7 +565,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
     GICH[GICH_LR + lr] = lr_val;
 
     set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
-    clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
+    clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status);
     p->lr = lr;
 }
 
@@ -643,7 +643,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
         p->lr = GIC_INVALID_LR;
-        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
+        if ( test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) &&
                 test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
             gic_raise_guest_irq(v, irq, p->priority);
         else
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index b6c3ebe..b44937d 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -719,7 +719,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
     {
         if ( (irq != current->domain->arch.evtchn_irq) ||
              (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
-            set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
+            set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
         goto out;
     }
 
@@ -733,7 +733,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
 
     n->irq = irq;
-    set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
+    set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
     n->priority = priority;
 
     /* the irq is enabled */
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index bee798b..65dc3ec 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -28,7 +28,8 @@ struct pending_irq
      * whether an irq added to an LR register is PENDING or ACTIVE, the
      * following states are just an approximation.
      *
-     * GIC_IRQ_GUEST_PENDING: the irq is asserted
+     * GIC_IRQ_GUEST_QUEUED: the irq is asserted and queued for
+     * injection into the guest's LRs.
      *
      * GIC_IRQ_GUEST_VISIBLE: the irq has been added to an LR register,
      * therefore the guest is aware of it. From the guest point of view
@@ -36,16 +37,16 @@ struct pending_irq
      * or active (after acking the irq).
      *
      * In order for the state machine to be fully accurate, for level
-     * interrupts, we should keep the GIC_IRQ_GUEST_PENDING state until
+     * interrupts, we should keep the interrupt's pending state until
      * the guest deactivates the irq. However because we are not sure
-     * when that happens, we simply remove the GIC_IRQ_GUEST_PENDING
-     * state when we add the irq to an LR register. We add it back when
-     * we receive another interrupt notification.
-     * Therefore it is possible to set GIC_IRQ_GUEST_PENDING while the
-     * irq is GIC_IRQ_GUEST_VISIBLE. We could also change the state of
-     * the guest irq in the LR register from active to active and
-     * pending, but for simplicity we simply inject a second irq after
-     * the guest EOIs the first one.
+     * when that happens, we instead track whether there is an interrupt
+     * queued using GIC_IRQ_GUEST_QUEUED. We clear it when we add it to
+     * an LR register. We set it when we receive another interrupt
+     * notification.  Therefore it is possible to set
+     * GIC_IRQ_GUEST_QUEUED while the irq is GIC_IRQ_GUEST_VISIBLE. We
+     * could also change the state of the guest irq in the LR register
+     * from active to active and pending, but for simplicity we simply
+     * inject a second irq after the guest EOIs the first one.
      *
      *
      * An additional state is used to keep track of whether the guest
@@ -55,7 +56,7 @@ struct pending_irq
      * level (GICD_ICENABLER/GICD_ISENABLER).
      *
      */
-#define GIC_IRQ_GUEST_PENDING  0
+#define GIC_IRQ_GUEST_QUEUED   0
 #define GIC_IRQ_GUEST_VISIBLE  1
 #define GIC_IRQ_GUEST_ENABLED  2
     unsigned long status;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFX-0006vT-NC; Sun, 22 Jun 2014 18:12:19 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFX-0006vH-2V
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:19 +0000
Received: from [85.158.143.35:2394] by server-1.bemta-4.messagelabs.com id
	6D/97-09496-28C17A35; Sun, 22 Jun 2014 18:12:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1403460736!12997695!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30710 invoked from network); 22 Jun 2014 18:12:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFU-0000DX-Aj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFU-0007bN-7h
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:16 +0000
Date: Sun, 22 Jun 2014 18:12:16 +0000
Message-Id: <E1WymFU-0007bN-7h@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: rename GIC_IRQ_GUEST_PENDING
	to GIC_IRQ_GUEST_QUEUED
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 229739b36646e657b8f9d75b1e5d249fd36773f8
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:16 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:29:56 2014 +0100

    xen/arm: rename GIC_IRQ_GUEST_PENDING to GIC_IRQ_GUEST_QUEUED
    
    Rename GIC_IRQ_GUEST_PENDING to GIC_IRQ_GUEST_QUEUED and clarify its
    meaning in xen/include/asm-arm/domain.h.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |    4 ++--
 xen/arch/arm/vgic.c          |    4 ++--
 xen/include/asm-arm/domain.h |   23 ++++++++++++-----------
 3 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index bb50acd..54936d7 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -565,7 +565,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
     GICH[GICH_LR + lr] = lr_val;
 
     set_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
-    clear_bit(GIC_IRQ_GUEST_PENDING, &p->status);
+    clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status);
     p->lr = lr;
 }
 
@@ -643,7 +643,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
         p->lr = GIC_INVALID_LR;
-        if ( test_bit(GIC_IRQ_GUEST_PENDING, &p->status) &&
+        if ( test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) &&
                 test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
             gic_raise_guest_irq(v, irq, p->priority);
         else
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index b6c3ebe..b44937d 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -719,7 +719,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
     {
         if ( (irq != current->domain->arch.evtchn_irq) ||
              (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
-            set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
+            set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
         goto out;
     }
 
@@ -733,7 +733,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
 
     n->irq = irq;
-    set_bit(GIC_IRQ_GUEST_PENDING, &n->status);
+    set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
     n->priority = priority;
 
     /* the irq is enabled */
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index bee798b..65dc3ec 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -28,7 +28,8 @@ struct pending_irq
      * whether an irq added to an LR register is PENDING or ACTIVE, the
      * following states are just an approximation.
      *
-     * GIC_IRQ_GUEST_PENDING: the irq is asserted
+     * GIC_IRQ_GUEST_QUEUED: the irq is asserted and queued for
+     * injection into the guest's LRs.
      *
      * GIC_IRQ_GUEST_VISIBLE: the irq has been added to an LR register,
      * therefore the guest is aware of it. From the guest point of view
@@ -36,16 +37,16 @@ struct pending_irq
      * or active (after acking the irq).
      *
      * In order for the state machine to be fully accurate, for level
-     * interrupts, we should keep the GIC_IRQ_GUEST_PENDING state until
+     * interrupts, we should keep the interrupt's pending state until
      * the guest deactivates the irq. However because we are not sure
-     * when that happens, we simply remove the GIC_IRQ_GUEST_PENDING
-     * state when we add the irq to an LR register. We add it back when
-     * we receive another interrupt notification.
-     * Therefore it is possible to set GIC_IRQ_GUEST_PENDING while the
-     * irq is GIC_IRQ_GUEST_VISIBLE. We could also change the state of
-     * the guest irq in the LR register from active to active and
-     * pending, but for simplicity we simply inject a second irq after
-     * the guest EOIs the first one.
+     * when that happens, we instead track whether there is an interrupt
+     * queued using GIC_IRQ_GUEST_QUEUED. We clear it when we add it to
+     * an LR register. We set it when we receive another interrupt
+     * notification.  Therefore it is possible to set
+     * GIC_IRQ_GUEST_QUEUED while the irq is GIC_IRQ_GUEST_VISIBLE. We
+     * could also change the state of the guest irq in the LR register
+     * from active to active and pending, but for simplicity we simply
+     * inject a second irq after the guest EOIs the first one.
      *
      *
      * An additional state is used to keep track of whether the guest
@@ -55,7 +56,7 @@ struct pending_irq
      * level (GICD_ICENABLER/GICD_ISENABLER).
      *
      */
-#define GIC_IRQ_GUEST_PENDING  0
+#define GIC_IRQ_GUEST_QUEUED   0
 #define GIC_IRQ_GUEST_VISIBLE  1
 #define GIC_IRQ_GUEST_ENABLED  2
     unsigned long status;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFi-0006xN-Q5; Sun, 22 Jun 2014 18:12:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFh-0006x6-Fy
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:29 +0000
Received: from [193.109.254.147:4092] by server-2.bemta-14.messagelabs.com id
	C8/E7-21684-C8C17A35; Sun, 22 Jun 2014 18:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1403460746!12912136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29493 invoked from network); 22 Jun 2014 18:12:27 -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 Jun 2014 18:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFe-0000De-FE
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFe-0007bs-Dd
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:26 +0000
Date: Sun, 22 Jun 2014 18:12:26 +0000
Message-Id: <E1WymFe-0007bs-Dd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: second irq injection while
	the first irq is still inflight
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 394b7e587b05d0f4a5fd6f067b38339ab5a77121
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:17 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:31:59 2014 +0100

    xen/arm: second irq injection while the first irq is still inflight
    
    Set GICH_LR_PENDING in the corresponding GICH_LR to inject a second irq
    while the first one is still active.
    If the first irq is already pending (not active), clear
    GIC_IRQ_GUEST_QUEUED because the guest doesn't need a second
    notification.If the irq has already been EOI'ed then just clear the
    GICH_LR right away and move the interrupt to lr_pending so that it is
    going to be reinjected by gic_restore_pending_irqs on return to guest.
    
    If the target cpu is not the current cpu, then set GIC_IRQ_GUEST_QUEUED
    and send an SGI. The target cpu is going to be interrupted and call
    gic_clear_lrs, that is going to take the same actions.
    
    Do not call vgic_vcpu_inject_irq from gic_inject if
    evtchn_upcall_pending is set. If we remove that call, we don't need to
    special case evtchn_irq in vgic_vcpu_inject_irq anymore.
    We need to force the first injection of evtchn_irq (call
    gic_vcpu_inject_irq) from vgic_enable_irqs because evtchn_upcall_pending
    is already set by common code on vcpu creation.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   48 +++++++++++++++++++++++++++++++++++++-------
 xen/arch/arm/vgic.c       |   14 +++++++++---
 xen/include/asm-arm/gic.h |    1 +
 3 files changed, 51 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 54936d7..b7516c0 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -66,6 +66,8 @@ static DEFINE_PER_CPU(u8, gic_cpu_id);
 /* Maximum cpu interface per GIC */
 #define NR_GIC_CPU_IF 8
 
+#undef GIC_DEBUG
+
 static void gic_update_one_lr(struct vcpu *v, int i);
 
 static unsigned int gic_cpu_mask(const cpumask_t *cpumask)
@@ -598,6 +600,22 @@ void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
     spin_unlock_irqrestore(&gic.lock, flags);
 }
 
+void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq)
+{
+    struct pending_irq *n = irq_to_pending(v, virtual_irq);
+
+    if ( list_empty(&n->lr_queue) )
+    {
+        if ( v == current )
+            gic_update_one_lr(v, n->lr);
+    }
+#ifdef GIC_DEBUG
+    else
+        gdprintk(XENLOG_DEBUG, "trying to inject irq=%u into d%dv%d, when it is still lr_pending\n",
+                 virtual_irq, v->domain->domain_id, v->vcpu_id);
+#endif
+}
+
 void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int priority)
 {
@@ -632,19 +650,36 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     ASSERT(spin_is_locked(&v->arch.vgic.lock));
 
     lr = GICH[GICH_LR + i];
-    if ( !(lr & (GICH_LR_PENDING|GICH_LR_ACTIVE)) )
+    irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
+    p = irq_to_pending(v, irq);
+    if ( lr & GICH_LR_ACTIVE )
     {
+        if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
+             test_and_clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
+        {
+            if ( p->desc == NULL )
+                GICH[GICH_LR + i] = lr | GICH_LR_PENDING;
+            else
+                gdprintk(XENLOG_WARNING, "unable to inject hw irq=%d into d%dv%d: already active in LR%d\n",
+                         irq, v->domain->domain_id, v->vcpu_id, i);
+        }
+    } else if ( lr & GICH_LR_PENDING ) {
+        int q __attribute__ ((unused)) = test_and_clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status);
+#ifdef GIC_DEBUG
+        if ( q )
+            gdprintk(XENLOG_DEBUG, "trying to inject irq=%d into d%dv%d, when it is already pending in LR%d\n",
+                    irq, v->domain->domain_id, v->vcpu_id, i);
+#endif
+    } else {
         GICH[GICH_LR + i] = 0;
         clear_bit(i, &this_cpu(lr_mask));
 
-        irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
-        p = irq_to_pending(v, irq);
         if ( p->desc != NULL )
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
         p->lr = GIC_INVALID_LR;
-        if ( test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) &&
-                test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
+        if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
+             test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
             gic_raise_guest_irq(v, irq, p->priority);
         else
             list_del_init(&p->inflight);
@@ -713,9 +748,6 @@ int gic_events_need_delivery(void)
 
 void gic_inject(void)
 {
-    if ( vcpu_info(current, evtchn_upcall_pending) )
-        vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
-
     gic_restore_pending_irqs(current);
 
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index b44937d..c7abf9f 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -404,7 +404,14 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         irq = i + (32 * n);
         p = irq_to_pending(v, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
-        if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
+        /* We need to force the first injection of evtchn_irq because
+         * evtchn_upcall_pending is already set by common code on vcpu
+         * creation. */
+        if ( irq == v->domain->arch.evtchn_irq &&
+             vcpu_info(current, evtchn_upcall_pending) &&
+             list_empty(&p->inflight) )
+            vgic_vcpu_inject_irq(v, irq);
+        else if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
             gic_raise_guest_irq(v, irq, p->priority);
         if ( p->desc != NULL )
         {
@@ -717,9 +724,8 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 
     if ( !list_empty(&n->inflight) )
     {
-        if ( (irq != current->domain->arch.evtchn_irq) ||
-             (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
-            set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
+        set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
+        gic_raise_inflight_irq(v, irq);
         goto out;
     }
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index ee06646..3c4d14e 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -181,6 +181,7 @@ extern int gic_events_need_delivery(void);
 extern void __cpuinit init_maintenance_interrupt(void);
 extern void gic_raise_guest_irq(struct vcpu *v, unsigned int irq,
         unsigned int priority);
+extern void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq);
 extern void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq);
 
 /* Accept an interrupt from the GIC and dispatch its handler */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFi-0006xN-Q5; Sun, 22 Jun 2014 18:12:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFh-0006x6-Fy
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:29 +0000
Received: from [193.109.254.147:4092] by server-2.bemta-14.messagelabs.com id
	C8/E7-21684-C8C17A35; Sun, 22 Jun 2014 18:12:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1403460746!12912136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29493 invoked from network); 22 Jun 2014 18:12:27 -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 Jun 2014 18:12:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFe-0000De-FE
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFe-0007bs-Dd
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:26 +0000
Date: Sun, 22 Jun 2014 18:12:26 +0000
Message-Id: <E1WymFe-0007bs-Dd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: second irq injection while
	the first irq is still inflight
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 394b7e587b05d0f4a5fd6f067b38339ab5a77121
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:17 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:31:59 2014 +0100

    xen/arm: second irq injection while the first irq is still inflight
    
    Set GICH_LR_PENDING in the corresponding GICH_LR to inject a second irq
    while the first one is still active.
    If the first irq is already pending (not active), clear
    GIC_IRQ_GUEST_QUEUED because the guest doesn't need a second
    notification.If the irq has already been EOI'ed then just clear the
    GICH_LR right away and move the interrupt to lr_pending so that it is
    going to be reinjected by gic_restore_pending_irqs on return to guest.
    
    If the target cpu is not the current cpu, then set GIC_IRQ_GUEST_QUEUED
    and send an SGI. The target cpu is going to be interrupted and call
    gic_clear_lrs, that is going to take the same actions.
    
    Do not call vgic_vcpu_inject_irq from gic_inject if
    evtchn_upcall_pending is set. If we remove that call, we don't need to
    special case evtchn_irq in vgic_vcpu_inject_irq anymore.
    We need to force the first injection of evtchn_irq (call
    gic_vcpu_inject_irq) from vgic_enable_irqs because evtchn_upcall_pending
    is already set by common code on vcpu creation.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |   48 +++++++++++++++++++++++++++++++++++++-------
 xen/arch/arm/vgic.c       |   14 +++++++++---
 xen/include/asm-arm/gic.h |    1 +
 3 files changed, 51 insertions(+), 12 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 54936d7..b7516c0 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -66,6 +66,8 @@ static DEFINE_PER_CPU(u8, gic_cpu_id);
 /* Maximum cpu interface per GIC */
 #define NR_GIC_CPU_IF 8
 
+#undef GIC_DEBUG
+
 static void gic_update_one_lr(struct vcpu *v, int i);
 
 static unsigned int gic_cpu_mask(const cpumask_t *cpumask)
@@ -598,6 +600,22 @@ void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
     spin_unlock_irqrestore(&gic.lock, flags);
 }
 
+void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq)
+{
+    struct pending_irq *n = irq_to_pending(v, virtual_irq);
+
+    if ( list_empty(&n->lr_queue) )
+    {
+        if ( v == current )
+            gic_update_one_lr(v, n->lr);
+    }
+#ifdef GIC_DEBUG
+    else
+        gdprintk(XENLOG_DEBUG, "trying to inject irq=%u into d%dv%d, when it is still lr_pending\n",
+                 virtual_irq, v->domain->domain_id, v->vcpu_id);
+#endif
+}
+
 void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int priority)
 {
@@ -632,19 +650,36 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     ASSERT(spin_is_locked(&v->arch.vgic.lock));
 
     lr = GICH[GICH_LR + i];
-    if ( !(lr & (GICH_LR_PENDING|GICH_LR_ACTIVE)) )
+    irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
+    p = irq_to_pending(v, irq);
+    if ( lr & GICH_LR_ACTIVE )
     {
+        if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
+             test_and_clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
+        {
+            if ( p->desc == NULL )
+                GICH[GICH_LR + i] = lr | GICH_LR_PENDING;
+            else
+                gdprintk(XENLOG_WARNING, "unable to inject hw irq=%d into d%dv%d: already active in LR%d\n",
+                         irq, v->domain->domain_id, v->vcpu_id, i);
+        }
+    } else if ( lr & GICH_LR_PENDING ) {
+        int q __attribute__ ((unused)) = test_and_clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status);
+#ifdef GIC_DEBUG
+        if ( q )
+            gdprintk(XENLOG_DEBUG, "trying to inject irq=%d into d%dv%d, when it is already pending in LR%d\n",
+                    irq, v->domain->domain_id, v->vcpu_id, i);
+#endif
+    } else {
         GICH[GICH_LR + i] = 0;
         clear_bit(i, &this_cpu(lr_mask));
 
-        irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
-        p = irq_to_pending(v, irq);
         if ( p->desc != NULL )
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
         p->lr = GIC_INVALID_LR;
-        if ( test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) &&
-                test_bit(GIC_IRQ_GUEST_ENABLED, &p->status))
+        if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
+             test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
             gic_raise_guest_irq(v, irq, p->priority);
         else
             list_del_init(&p->inflight);
@@ -713,9 +748,6 @@ int gic_events_need_delivery(void)
 
 void gic_inject(void)
 {
-    if ( vcpu_info(current, evtchn_upcall_pending) )
-        vgic_vcpu_inject_irq(current, current->domain->arch.evtchn_irq);
-
     gic_restore_pending_irqs(current);
 
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index b44937d..c7abf9f 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -404,7 +404,14 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
         irq = i + (32 * n);
         p = irq_to_pending(v, irq);
         set_bit(GIC_IRQ_GUEST_ENABLED, &p->status);
-        if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
+        /* We need to force the first injection of evtchn_irq because
+         * evtchn_upcall_pending is already set by common code on vcpu
+         * creation. */
+        if ( irq == v->domain->arch.evtchn_irq &&
+             vcpu_info(current, evtchn_upcall_pending) &&
+             list_empty(&p->inflight) )
+            vgic_vcpu_inject_irq(v, irq);
+        else if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
             gic_raise_guest_irq(v, irq, p->priority);
         if ( p->desc != NULL )
         {
@@ -717,9 +724,8 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 
     if ( !list_empty(&n->inflight) )
     {
-        if ( (irq != current->domain->arch.evtchn_irq) ||
-             (!test_bit(GIC_IRQ_GUEST_VISIBLE, &n->status)) )
-            set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
+        set_bit(GIC_IRQ_GUEST_QUEUED, &n->status);
+        gic_raise_inflight_irq(v, irq);
         goto out;
     }
 
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index ee06646..3c4d14e 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -181,6 +181,7 @@ extern int gic_events_need_delivery(void);
 extern void __cpuinit init_maintenance_interrupt(void);
 extern void gic_raise_guest_irq(struct vcpu *v, unsigned int irq,
         unsigned int priority);
+extern void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq);
 extern void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq);
 
 /* Accept an interrupt from the GIC and dispatch its handler */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFs-0006yz-T0; Sun, 22 Jun 2014 18:12:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFr-0006yg-LG
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:39 +0000
Received: from [85.158.143.35:42403] by server-1.bemta-4.messagelabs.com id
	C1/B7-09496-79C17A35; Sun, 22 Jun 2014 18:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1403460756!12973989!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11757 invoked from network); 22 Jun 2014 18:12:37 -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 Jun 2014 18:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFo-0000Dk-Jw
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFo-0007cI-IA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:36 +0000
Date: Sun, 22 Jun 2014 18:12:36 +0000
Message-Id: <E1WymFo-0007cI-IA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: don't protect GICH and
	lr_queue accesses with gic.lock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a81688b13a524210f4ee5b12b324d3367d425af
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:32:10 2014 +0100

    xen/arm: don't protect GICH and lr_queue accesses with gic.lock
    
    GICH is banked, protect accesses by disabling interrupts.
    Protect lr_queue accesses with the vgic.lock only.
    gic.lock only protects accesses to GICD now.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c           |   32 +++++++++++++++++---------------
 xen/arch/arm/vgic.c          |    9 +++++++--
 xen/include/asm-arm/domain.h |    5 ++++-
 3 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index b7516c0..88c2fd3 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -113,6 +113,7 @@ void gic_save_state(struct vcpu *v)
 void gic_restore_state(struct vcpu *v)
 {
     int i;
+    ASSERT(!local_irq_is_enabled());
 
     if ( is_idle_vcpu(v) )
         return;
@@ -555,6 +556,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
 {
     uint32_t lr_val;
 
+    ASSERT(!local_irq_is_enabled());
     BUG_ON(lr >= nr_lrs);
     BUG_ON(lr < 0);
     BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
@@ -575,6 +577,8 @@ static inline void gic_add_to_lr_pending(struct vcpu *v, struct pending_irq *n)
 {
     struct pending_irq *iter;
 
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
     if ( !list_empty(&n->lr_queue) )
         return;
 
@@ -594,16 +598,18 @@ void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
     struct pending_irq *p = irq_to_pending(v, virtual_irq);
     unsigned long flags;
 
-    spin_lock_irqsave(&gic.lock, flags);
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
     if ( !list_empty(&p->lr_queue) )
         list_del_init(&p->lr_queue);
-    spin_unlock_irqrestore(&gic.lock, flags);
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
 void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq)
 {
     struct pending_irq *n = irq_to_pending(v, virtual_irq);
 
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
     if ( list_empty(&n->lr_queue) )
     {
         if ( v == current )
@@ -620,9 +626,8 @@ void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int priority)
 {
     int i;
-    unsigned long flags;
 
-    spin_lock_irqsave(&gic.lock, flags);
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
 
     if ( v == current && list_empty(&v->arch.vgic.lr_pending) )
     {
@@ -630,15 +635,11 @@ void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         if (i < nr_lrs) {
             set_bit(i, &this_cpu(lr_mask));
             gic_set_lr(i, irq_to_pending(v, virtual_irq), GICH_LR_PENDING);
-            goto out;
+            return;
         }
     }
 
     gic_add_to_lr_pending(v, irq_to_pending(v, virtual_irq));
-
-out:
-    spin_unlock_irqrestore(&gic.lock, flags);
-    return;
 }
 
 static void gic_update_one_lr(struct vcpu *v, int i)
@@ -648,6 +649,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     int irq;
 
     ASSERT(spin_is_locked(&v->arch.vgic.lock));
+    ASSERT(!local_irq_is_enabled());
 
     lr = GICH[GICH_LR + i];
     irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
@@ -714,30 +716,28 @@ static void gic_restore_pending_irqs(struct vcpu *v)
     struct pending_irq *p, *t;
     unsigned long flags;
 
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
     {
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if ( i >= nr_lrs ) return;
 
-        spin_lock_irqsave(&gic.lock, flags);
         gic_set_lr(i, p, GICH_LR_PENDING);
         list_del_init(&p->lr_queue);
         set_bit(i, &this_cpu(lr_mask));
-        spin_unlock_irqrestore(&gic.lock, flags);
     }
-
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
 void gic_clear_pending_irqs(struct vcpu *v)
 {
     struct pending_irq *p, *t;
-    unsigned long flags;
 
-    spin_lock_irqsave(&gic.lock, flags);
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
     v->arch.lr_mask = 0;
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
         list_del_init(&p->lr_queue);
-    spin_unlock_irqrestore(&gic.lock, flags);
 }
 
 int gic_events_need_delivery(void)
@@ -748,6 +748,8 @@ int gic_events_need_delivery(void)
 
 void gic_inject(void)
 {
+    ASSERT(!local_irq_is_enabled());
+
     gic_restore_pending_irqs(current);
 
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index c7abf9f..cb8df3a 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -411,8 +411,13 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
              vcpu_info(current, evtchn_upcall_pending) &&
              list_empty(&p->inflight) )
             vgic_vcpu_inject_irq(v, irq);
-        else if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
-            gic_raise_guest_irq(v, irq, p->priority);
+        else {
+            unsigned long flags;
+            spin_lock_irqsave(&v->arch.vgic.lock, flags);
+            if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
+                gic_raise_guest_irq(v, irq, p->priority);
+            spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+        }
         if ( p->desc != NULL )
         {
             spin_lock_irqsave(&p->desc->lock, flags);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 65dc3ec..4900ef3 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -69,7 +69,10 @@ struct pending_irq
      * vgic.inflight_irqs */
     struct list_head inflight;
     /* lr_queue is used to append instances of pending_irq to
-     * gic.lr_pending */
+     * lr_pending. lr_pending is a per vcpu queue, therefore lr_queue
+     * accesses are protected with the vgic lock.
+     * TODO: when implementing irq migration, taking only the current
+     * vgic lock is not going to be enough. */
     struct list_head lr_queue;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymFs-0006yz-T0; Sun, 22 Jun 2014 18:12:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFr-0006yg-LG
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:39 +0000
Received: from [85.158.143.35:42403] by server-1.bemta-4.messagelabs.com id
	C1/B7-09496-79C17A35; Sun, 22 Jun 2014 18:12:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-21.messagelabs.com!1403460756!12973989!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11757 invoked from network); 22 Jun 2014 18:12:37 -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 Jun 2014 18:12:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFo-0000Dk-Jw
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFo-0007cI-IA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:36 +0000
Date: Sun, 22 Jun 2014 18:12:36 +0000
Message-Id: <E1WymFo-0007cI-IA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: don't protect GICH and
	lr_queue accesses with gic.lock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 9a81688b13a524210f4ee5b12b324d3367d425af
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:32:10 2014 +0100

    xen/arm: don't protect GICH and lr_queue accesses with gic.lock
    
    GICH is banked, protect accesses by disabling interrupts.
    Protect lr_queue accesses with the vgic.lock only.
    gic.lock only protects accesses to GICD now.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
---
 xen/arch/arm/gic.c           |   32 +++++++++++++++++---------------
 xen/arch/arm/vgic.c          |    9 +++++++--
 xen/include/asm-arm/domain.h |    5 ++++-
 3 files changed, 28 insertions(+), 18 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index b7516c0..88c2fd3 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -113,6 +113,7 @@ void gic_save_state(struct vcpu *v)
 void gic_restore_state(struct vcpu *v)
 {
     int i;
+    ASSERT(!local_irq_is_enabled());
 
     if ( is_idle_vcpu(v) )
         return;
@@ -555,6 +556,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
 {
     uint32_t lr_val;
 
+    ASSERT(!local_irq_is_enabled());
     BUG_ON(lr >= nr_lrs);
     BUG_ON(lr < 0);
     BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
@@ -575,6 +577,8 @@ static inline void gic_add_to_lr_pending(struct vcpu *v, struct pending_irq *n)
 {
     struct pending_irq *iter;
 
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
     if ( !list_empty(&n->lr_queue) )
         return;
 
@@ -594,16 +598,18 @@ void gic_remove_from_queues(struct vcpu *v, unsigned int virtual_irq)
     struct pending_irq *p = irq_to_pending(v, virtual_irq);
     unsigned long flags;
 
-    spin_lock_irqsave(&gic.lock, flags);
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
     if ( !list_empty(&p->lr_queue) )
         list_del_init(&p->lr_queue);
-    spin_unlock_irqrestore(&gic.lock, flags);
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
 void gic_raise_inflight_irq(struct vcpu *v, unsigned int virtual_irq)
 {
     struct pending_irq *n = irq_to_pending(v, virtual_irq);
 
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
     if ( list_empty(&n->lr_queue) )
     {
         if ( v == current )
@@ -620,9 +626,8 @@ void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         unsigned int priority)
 {
     int i;
-    unsigned long flags;
 
-    spin_lock_irqsave(&gic.lock, flags);
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
 
     if ( v == current && list_empty(&v->arch.vgic.lr_pending) )
     {
@@ -630,15 +635,11 @@ void gic_raise_guest_irq(struct vcpu *v, unsigned int virtual_irq,
         if (i < nr_lrs) {
             set_bit(i, &this_cpu(lr_mask));
             gic_set_lr(i, irq_to_pending(v, virtual_irq), GICH_LR_PENDING);
-            goto out;
+            return;
         }
     }
 
     gic_add_to_lr_pending(v, irq_to_pending(v, virtual_irq));
-
-out:
-    spin_unlock_irqrestore(&gic.lock, flags);
-    return;
 }
 
 static void gic_update_one_lr(struct vcpu *v, int i)
@@ -648,6 +649,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     int irq;
 
     ASSERT(spin_is_locked(&v->arch.vgic.lock));
+    ASSERT(!local_irq_is_enabled());
 
     lr = GICH[GICH_LR + i];
     irq = (lr >> GICH_LR_VIRTUAL_SHIFT) & GICH_LR_VIRTUAL_MASK;
@@ -714,30 +716,28 @@ static void gic_restore_pending_irqs(struct vcpu *v)
     struct pending_irq *p, *t;
     unsigned long flags;
 
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
     {
         i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
         if ( i >= nr_lrs ) return;
 
-        spin_lock_irqsave(&gic.lock, flags);
         gic_set_lr(i, p, GICH_LR_PENDING);
         list_del_init(&p->lr_queue);
         set_bit(i, &this_cpu(lr_mask));
-        spin_unlock_irqrestore(&gic.lock, flags);
     }
-
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
 void gic_clear_pending_irqs(struct vcpu *v)
 {
     struct pending_irq *p, *t;
-    unsigned long flags;
 
-    spin_lock_irqsave(&gic.lock, flags);
+    ASSERT(spin_is_locked(&v->arch.vgic.lock));
+
     v->arch.lr_mask = 0;
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
         list_del_init(&p->lr_queue);
-    spin_unlock_irqrestore(&gic.lock, flags);
 }
 
 int gic_events_need_delivery(void)
@@ -748,6 +748,8 @@ int gic_events_need_delivery(void)
 
 void gic_inject(void)
 {
+    ASSERT(!local_irq_is_enabled());
+
     gic_restore_pending_irqs(current);
 
 
diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index c7abf9f..cb8df3a 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -411,8 +411,13 @@ static void vgic_enable_irqs(struct vcpu *v, uint32_t r, int n)
              vcpu_info(current, evtchn_upcall_pending) &&
              list_empty(&p->inflight) )
             vgic_vcpu_inject_irq(v, irq);
-        else if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
-            gic_raise_guest_irq(v, irq, p->priority);
+        else {
+            unsigned long flags;
+            spin_lock_irqsave(&v->arch.vgic.lock, flags);
+            if ( !list_empty(&p->inflight) && !test_bit(GIC_IRQ_GUEST_VISIBLE, &p->status) )
+                gic_raise_guest_irq(v, irq, p->priority);
+            spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+        }
         if ( p->desc != NULL )
         {
             spin_lock_irqsave(&p->desc->lock, flags);
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 65dc3ec..4900ef3 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -69,7 +69,10 @@ struct pending_irq
      * vgic.inflight_irqs */
     struct list_head inflight;
     /* lr_queue is used to append instances of pending_irq to
-     * gic.lr_pending */
+     * lr_pending. lr_pending is a per vcpu queue, therefore lr_queue
+     * accesses are protected with the vgic lock.
+     * TODO: when implementing irq migration, taking only the current
+     * vgic lock is not going to be enough. */
     struct list_head lr_queue;
 };
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymG3-00070o-1j; Sun, 22 Jun 2014 18:12:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymG1-00070Q-E8
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:49 +0000
Received: from [193.109.254.147:39663] by server-3.bemta-14.messagelabs.com id
	4B/AA-22179-0AC17A35; Sun, 22 Jun 2014 18:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403460767!8254255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18946 invoked from network); 22 Jun 2014 18:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFy-0000Dq-P4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFy-0007dP-Mx
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:46 +0000
Date: Sun, 22 Jun 2014 18:12:46 +0000
Message-Id: <E1WymFy-0007dP-Mx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: introduce GIC_PRI_TO_GUEST
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa707af2d40f1b6fd24e3c19c47d6e70ee7b4678
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:19 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:32:10 2014 +0100

    xen/arm: introduce GIC_PRI_TO_GUEST macro
    
    GICH_LR registers and GICH_VMCR only support 5 bits for guest irq
    priorities.
    Introduce a macro to reduce the 8-bit priority fields to 5 bits; use it
    in gic.c.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |    2 +-
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 88c2fd3..4d044cf 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -561,7 +561,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
     BUG_ON(lr < 0);
     BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
 
-    lr_val = state | ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
+    lr_val = state | (GIC_PRI_TO_GUEST(p->priority) << GICH_LR_PRIORITY_SHIFT) |
         ((p->irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT);
     if ( p->desc != NULL )
         lr_val |= GICH_LR_HW | (p->desc->irq << GICH_LR_PHYSICAL_SHIFT);
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 3c4d14e..a14cd5e 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -149,6 +149,8 @@
 #define GIC_PRI_IRQ        0xa0
 #define GIC_PRI_IPI        0x90 /* IPIs must preempt normal interrupts */
 #define GIC_PRI_HIGHEST    0x80 /* Higher priorities belong to Secure-World */
+#define GIC_PRI_TO_GUEST(pri) (pri >> 3) /* GICH_LR and GICH_VMCR only support
+                                            5 bits for guest irq priority */
 
 
 #ifndef __ASSEMBLY__
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:12:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:12:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymG3-00070o-1j; Sun, 22 Jun 2014 18:12:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymG1-00070Q-E8
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:49 +0000
Received: from [193.109.254.147:39663] by server-3.bemta-14.messagelabs.com id
	4B/AA-22179-0AC17A35; Sun, 22 Jun 2014 18:12:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-27.messagelabs.com!1403460767!8254255!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18946 invoked from network); 22 Jun 2014 18:12:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFy-0000Dq-P4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymFy-0007dP-Mx
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:46 +0000
Date: Sun, 22 Jun 2014 18:12:46 +0000
Message-Id: <E1WymFy-0007dP-Mx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: introduce GIC_PRI_TO_GUEST
	macro
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit fa707af2d40f1b6fd24e3c19c47d6e70ee7b4678
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:19 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:32:10 2014 +0100

    xen/arm: introduce GIC_PRI_TO_GUEST macro
    
    GICH_LR registers and GICH_VMCR only support 5 bits for guest irq
    priorities.
    Introduce a macro to reduce the 8-bit priority fields to 5 bits; use it
    in gic.c.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c        |    2 +-
 xen/include/asm-arm/gic.h |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 88c2fd3..4d044cf 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -561,7 +561,7 @@ static inline void gic_set_lr(int lr, struct pending_irq *p,
     BUG_ON(lr < 0);
     BUG_ON(state & ~(GICH_LR_STATE_MASK<<GICH_LR_STATE_SHIFT));
 
-    lr_val = state | ((p->priority >> 3) << GICH_LR_PRIORITY_SHIFT) |
+    lr_val = state | (GIC_PRI_TO_GUEST(p->priority) << GICH_LR_PRIORITY_SHIFT) |
         ((p->irq & GICH_LR_VIRTUAL_MASK) << GICH_LR_VIRTUAL_SHIFT);
     if ( p->desc != NULL )
         lr_val |= GICH_LR_HW | (p->desc->irq << GICH_LR_PHYSICAL_SHIFT);
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index 3c4d14e..a14cd5e 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -149,6 +149,8 @@
 #define GIC_PRI_IRQ        0xa0
 #define GIC_PRI_IPI        0x90 /* IPIs must preempt normal interrupts */
 #define GIC_PRI_HIGHEST    0x80 /* Higher priorities belong to Secure-World */
+#define GIC_PRI_TO_GUEST(pri) (pri >> 3) /* GICH_LR and GICH_VMCR only support
+                                            5 bits for guest irq priority */
 
 
 #ifndef __ASSEMBLY__
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGI-00072n-4c; Sun, 22 Jun 2014 18:13:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGD-00072S-1a
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:05 +0000
Received: from [85.158.137.68:17415] by server-14.bemta-3.messagelabs.com id
	FE/1D-19846-CAC17A35; Sun, 22 Jun 2014 18:13:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403460777!11604396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10105 invoked from network); 22 Jun 2014 18:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymG8-0000Dw-U2
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymG8-0007dm-S9
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:56 +0000
Date: Sun, 22 Jun 2014 18:12:56 +0000
Message-Id: <E1WymG8-0007dm-S9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic_events_need_delivery and
	irq priorities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72eaf29e8d70784aaf066ead79df1295a25ecfd0
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:20 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:32:10 2014 +0100

    xen/arm: gic_events_need_delivery and irq priorities
    
    Introduce GIC_IRQ_GUEST_ACTIVE to track which irqs are currently
    active in the guest.
    
    gic_events_need_delivery should only return positive if an outstanding
    pending irq has an higher group priority than the currently active group
    priotity and the priority mask.
    Read GICH_APR to find the active group priority.
    Read GICH_VMCR to find the priority mask.
    Find the highest priority non-active enabled irq by going through the
    inflight list.
    
    In gic_restore_pending_irqs replace lower priority pending (and not
    active) irqs in GICH_LRs with higher priority irqs if no more GICH_LRs
    are available.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |   85 ++++++++++++++++++++++++++++++++++++++----
 xen/include/asm-arm/domain.h |    5 +-
 xen/include/asm-arm/gic.h    |    3 +
 3 files changed, 83 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 4d044cf..4d2a92d 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -656,6 +656,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     p = irq_to_pending(v, irq);
     if ( lr & GICH_LR_ACTIVE )
     {
+        set_bit(GIC_IRQ_GUEST_ACTIVE, &p->status);
         if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
              test_and_clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
         {
@@ -679,6 +680,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
         if ( p->desc != NULL )
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+        clear_bit(GIC_IRQ_GUEST_ACTIVE, &p->status);
         p->lr = GIC_INVALID_LR;
         if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
              test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
@@ -712,20 +714,55 @@ void gic_clear_lrs(struct vcpu *v)
 
 static void gic_restore_pending_irqs(struct vcpu *v)
 {
-    int i;
-    struct pending_irq *p, *t;
+    int lr = 0, lrs = nr_lrs;
+    struct pending_irq *p, *t, *p_r;
+    struct list_head *inflight_r;
     unsigned long flags;
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    if ( list_empty(&v->arch.vgic.lr_pending) )
+        goto out;
+
+    inflight_r = &v->arch.vgic.inflight_irqs;
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
     {
-        i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
-        if ( i >= nr_lrs ) return;
+        lr = find_next_zero_bit(&this_cpu(lr_mask), nr_lrs, lr);
+        if ( lr >= nr_lrs )
+        {
+            /* No more free LRs: find a lower priority irq to evict */
+            list_for_each_entry_reverse( p_r, inflight_r, inflight )
+            {
+                if ( p_r->priority == p->priority )
+                    goto out;
+                if ( test_bit(GIC_IRQ_GUEST_VISIBLE, &p_r->status) &&
+                     !test_bit(GIC_IRQ_GUEST_ACTIVE, &p_r->status) )
+                    goto found;
+            }
+            /* We didn't find a victim this time, and we won't next
+             * time, so quit */
+            goto out;
+
+found:
+            lr = p_r->lr;
+            p_r->lr = GIC_INVALID_LR;
+            set_bit(GIC_IRQ_GUEST_QUEUED, &p_r->status);
+            clear_bit(GIC_IRQ_GUEST_VISIBLE, &p_r->status);
+            gic_add_to_lr_pending(v, p_r);
+            inflight_r = &p_r->inflight;
+        }
 
-        gic_set_lr(i, p, GICH_LR_PENDING);
+        gic_set_lr(lr, p, GICH_LR_PENDING);
         list_del_init(&p->lr_queue);
-        set_bit(i, &this_cpu(lr_mask));
+        set_bit(lr, &this_cpu(lr_mask));
+
+        /* We can only evict nr_lrs entries */
+        lrs--;
+        if ( lrs == 0 )
+            break;
     }
+
+out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
@@ -742,8 +779,40 @@ void gic_clear_pending_irqs(struct vcpu *v)
 
 int gic_events_need_delivery(void)
 {
-    return (!list_empty(&current->arch.vgic.lr_pending) ||
-            this_cpu(lr_mask));
+    struct vcpu *v = current;
+    struct pending_irq *p;
+    unsigned long flags;
+    const unsigned long apr = GICH[GICH_APR];
+    int mask_priority;
+    int active_priority;
+    int rc = 0;
+
+    mask_priority = (GICH[GICH_VMCR] >> GICH_VMCR_PRIORITY_SHIFT) & GICH_VMCR_PRIORITY_MASK;
+    active_priority = find_next_bit(&apr, 32, 0);
+
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    /* TODO: We order the guest irqs by priority, but we don't change
+     * the priority of host irqs. */
+
+    /* find the first enabled non-active irq, the queue is already
+     * ordered by priority */
+    list_for_each_entry( p, &v->arch.vgic.inflight_irqs, inflight )
+    {
+        if ( GIC_PRI_TO_GUEST(p->priority) >= mask_priority )
+            goto out;
+        if ( GIC_PRI_TO_GUEST(p->priority) >= active_priority )
+            goto out;
+        if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) )
+        {
+            rc = 1;
+            goto out;
+        }
+    }
+
+out:
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+    return rc;
 }
 
 void gic_inject(void)
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 4900ef3..2cb6837 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -57,8 +57,9 @@ struct pending_irq
      *
      */
 #define GIC_IRQ_GUEST_QUEUED   0
-#define GIC_IRQ_GUEST_VISIBLE  1
-#define GIC_IRQ_GUEST_ENABLED  2
+#define GIC_IRQ_GUEST_ACTIVE   1
+#define GIC_IRQ_GUEST_VISIBLE  2
+#define GIC_IRQ_GUEST_ENABLED  3
     unsigned long status;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
     int irq;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index a14cd5e..8e37ccf 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -129,6 +129,9 @@
 #define GICH_LR_CPUID_SHIFT     9
 #define GICH_VTR_NRLRGS         0x3f
 
+#define GICH_VMCR_PRIORITY_MASK   0x1f
+#define GICH_VMCR_PRIORITY_SHIFT  27
+
 /*
  * The minimum GICC_BPR is required to be in the range 0-3. We set
  * GICC_BPR to 0 but we must expect that it might be 3. This means we
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:06 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:06 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGI-00072n-4c; Sun, 22 Jun 2014 18:13:06 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGD-00072S-1a
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:05 +0000
Received: from [85.158.137.68:17415] by server-14.bemta-3.messagelabs.com id
	FE/1D-19846-CAC17A35; Sun, 22 Jun 2014 18:13:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403460777!11604396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10105 invoked from network); 22 Jun 2014 18:12:58 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:12:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymG8-0000Dw-U2
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymG8-0007dm-S9
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:12:56 +0000
Date: Sun, 22 Jun 2014 18:12:56 +0000
Message-Id: <E1WymG8-0007dm-S9@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: gic_events_need_delivery and
	irq priorities
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 72eaf29e8d70784aaf066ead79df1295a25ecfd0
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Tue Jun 10 15:07:20 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 11:32:10 2014 +0100

    xen/arm: gic_events_need_delivery and irq priorities
    
    Introduce GIC_IRQ_GUEST_ACTIVE to track which irqs are currently
    active in the guest.
    
    gic_events_need_delivery should only return positive if an outstanding
    pending irq has an higher group priority than the currently active group
    priotity and the priority mask.
    Read GICH_APR to find the active group priority.
    Read GICH_VMCR to find the priority mask.
    Find the highest priority non-active enabled irq by going through the
    inflight list.
    
    In gic_restore_pending_irqs replace lower priority pending (and not
    active) irqs in GICH_LRs with higher priority irqs if no more GICH_LRs
    are available.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/gic.c           |   85 ++++++++++++++++++++++++++++++++++++++----
 xen/include/asm-arm/domain.h |    5 +-
 xen/include/asm-arm/gic.h    |    3 +
 3 files changed, 83 insertions(+), 10 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index 4d044cf..4d2a92d 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -656,6 +656,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
     p = irq_to_pending(v, irq);
     if ( lr & GICH_LR_ACTIVE )
     {
+        set_bit(GIC_IRQ_GUEST_ACTIVE, &p->status);
         if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
              test_and_clear_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
         {
@@ -679,6 +680,7 @@ static void gic_update_one_lr(struct vcpu *v, int i)
         if ( p->desc != NULL )
             p->desc->status &= ~IRQ_INPROGRESS;
         clear_bit(GIC_IRQ_GUEST_VISIBLE, &p->status);
+        clear_bit(GIC_IRQ_GUEST_ACTIVE, &p->status);
         p->lr = GIC_INVALID_LR;
         if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) &&
              test_bit(GIC_IRQ_GUEST_QUEUED, &p->status) )
@@ -712,20 +714,55 @@ void gic_clear_lrs(struct vcpu *v)
 
 static void gic_restore_pending_irqs(struct vcpu *v)
 {
-    int i;
-    struct pending_irq *p, *t;
+    int lr = 0, lrs = nr_lrs;
+    struct pending_irq *p, *t, *p_r;
+    struct list_head *inflight_r;
     unsigned long flags;
 
     spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    if ( list_empty(&v->arch.vgic.lr_pending) )
+        goto out;
+
+    inflight_r = &v->arch.vgic.inflight_irqs;
     list_for_each_entry_safe ( p, t, &v->arch.vgic.lr_pending, lr_queue )
     {
-        i = find_first_zero_bit(&this_cpu(lr_mask), nr_lrs);
-        if ( i >= nr_lrs ) return;
+        lr = find_next_zero_bit(&this_cpu(lr_mask), nr_lrs, lr);
+        if ( lr >= nr_lrs )
+        {
+            /* No more free LRs: find a lower priority irq to evict */
+            list_for_each_entry_reverse( p_r, inflight_r, inflight )
+            {
+                if ( p_r->priority == p->priority )
+                    goto out;
+                if ( test_bit(GIC_IRQ_GUEST_VISIBLE, &p_r->status) &&
+                     !test_bit(GIC_IRQ_GUEST_ACTIVE, &p_r->status) )
+                    goto found;
+            }
+            /* We didn't find a victim this time, and we won't next
+             * time, so quit */
+            goto out;
+
+found:
+            lr = p_r->lr;
+            p_r->lr = GIC_INVALID_LR;
+            set_bit(GIC_IRQ_GUEST_QUEUED, &p_r->status);
+            clear_bit(GIC_IRQ_GUEST_VISIBLE, &p_r->status);
+            gic_add_to_lr_pending(v, p_r);
+            inflight_r = &p_r->inflight;
+        }
 
-        gic_set_lr(i, p, GICH_LR_PENDING);
+        gic_set_lr(lr, p, GICH_LR_PENDING);
         list_del_init(&p->lr_queue);
-        set_bit(i, &this_cpu(lr_mask));
+        set_bit(lr, &this_cpu(lr_mask));
+
+        /* We can only evict nr_lrs entries */
+        lrs--;
+        if ( lrs == 0 )
+            break;
     }
+
+out:
     spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
 }
 
@@ -742,8 +779,40 @@ void gic_clear_pending_irqs(struct vcpu *v)
 
 int gic_events_need_delivery(void)
 {
-    return (!list_empty(&current->arch.vgic.lr_pending) ||
-            this_cpu(lr_mask));
+    struct vcpu *v = current;
+    struct pending_irq *p;
+    unsigned long flags;
+    const unsigned long apr = GICH[GICH_APR];
+    int mask_priority;
+    int active_priority;
+    int rc = 0;
+
+    mask_priority = (GICH[GICH_VMCR] >> GICH_VMCR_PRIORITY_SHIFT) & GICH_VMCR_PRIORITY_MASK;
+    active_priority = find_next_bit(&apr, 32, 0);
+
+    spin_lock_irqsave(&v->arch.vgic.lock, flags);
+
+    /* TODO: We order the guest irqs by priority, but we don't change
+     * the priority of host irqs. */
+
+    /* find the first enabled non-active irq, the queue is already
+     * ordered by priority */
+    list_for_each_entry( p, &v->arch.vgic.inflight_irqs, inflight )
+    {
+        if ( GIC_PRI_TO_GUEST(p->priority) >= mask_priority )
+            goto out;
+        if ( GIC_PRI_TO_GUEST(p->priority) >= active_priority )
+            goto out;
+        if ( test_bit(GIC_IRQ_GUEST_ENABLED, &p->status) )
+        {
+            rc = 1;
+            goto out;
+        }
+    }
+
+out:
+    spin_unlock_irqrestore(&v->arch.vgic.lock, flags);
+    return rc;
 }
 
 void gic_inject(void)
diff --git a/xen/include/asm-arm/domain.h b/xen/include/asm-arm/domain.h
index 4900ef3..2cb6837 100644
--- a/xen/include/asm-arm/domain.h
+++ b/xen/include/asm-arm/domain.h
@@ -57,8 +57,9 @@ struct pending_irq
      *
      */
 #define GIC_IRQ_GUEST_QUEUED   0
-#define GIC_IRQ_GUEST_VISIBLE  1
-#define GIC_IRQ_GUEST_ENABLED  2
+#define GIC_IRQ_GUEST_ACTIVE   1
+#define GIC_IRQ_GUEST_VISIBLE  2
+#define GIC_IRQ_GUEST_ENABLED  3
     unsigned long status;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
     int irq;
diff --git a/xen/include/asm-arm/gic.h b/xen/include/asm-arm/gic.h
index a14cd5e..8e37ccf 100644
--- a/xen/include/asm-arm/gic.h
+++ b/xen/include/asm-arm/gic.h
@@ -129,6 +129,9 @@
 #define GICH_LR_CPUID_SHIFT     9
 #define GICH_VTR_NRLRGS         0x3f
 
+#define GICH_VMCR_PRIORITY_MASK   0x1f
+#define GICH_VMCR_PRIORITY_SHIFT  27
+
 /*
  * The minimum GICC_BPR is required to be in the range 0-3. We set
  * GICC_BPR to 0 but we must expect that it might be 3. This means we
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGN-00073i-7M; Sun, 22 Jun 2014 18:13:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGM-00073W-6t
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:10 +0000
Received: from [85.158.137.68:17598] by server-5.bemta-3.messagelabs.com id
	0E/1E-27487-5BC17A35; Sun, 22 Jun 2014 18:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1403460787!11629770!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8291 invoked from network); 22 Jun 2014 18:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGJ-0000ES-2y
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGJ-0007f4-1V
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:07 +0000
Date: Sun, 22 Jun 2014 18:13:07 +0000
Message-Id: <E1WymGJ-0007f4-1V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84c340ba4c3eb99278b6ba885616bb183b88ad67
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Wed Jun 18 15:50:02 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:50:02 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    3 ++-
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 44e7693..0b301b3 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -164,7 +164,7 @@ static void amd_iommu_setup_domain_device(
          !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
         if ( devfn == pdev->devfn )
-            enable_ats_device(iommu->seg, bus, devfn);
+            enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index cf649d4..000e76d 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #define ATS_REG_CAP    4
@@ -34,7 +35,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 431adb4..500fc3b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1442,7 +1442,7 @@ static int domain_context_mapping(
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1930,7 +1930,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGN-00073i-7M; Sun, 22 Jun 2014 18:13:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGM-00073W-6t
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:10 +0000
Received: from [85.158.137.68:17598] by server-5.bemta-3.messagelabs.com id
	0E/1E-27487-5BC17A35; Sun, 22 Jun 2014 18:13:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-31.messagelabs.com!1403460787!11629770!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8291 invoked from network); 22 Jun 2014 18:13:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:13:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGJ-0000ES-2y
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGJ-0007f4-1V
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:07 +0000
Date: Sun, 22 Jun 2014 18:13:07 +0000
Message-Id: <E1WymGJ-0007f4-1V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 84c340ba4c3eb99278b6ba885616bb183b88ad67
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Wed Jun 18 15:50:02 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:50:02 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    3 ++-
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 44e7693..0b301b3 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -164,7 +164,7 @@ static void amd_iommu_setup_domain_device(
          !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
         if ( devfn == pdev->devfn )
-            enable_ats_device(iommu->seg, bus, devfn);
+            enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index cf649d4..000e76d 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #define ATS_REG_CAP    4
@@ -34,7 +35,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 431adb4..500fc3b 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1442,7 +1442,7 @@ static int domain_context_mapping(
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1930,7 +1930,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGX-00075W-A6; Sun, 22 Jun 2014 18:13:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGW-00075C-1B
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:20 +0000
Received: from [193.109.254.147:5632] by server-16.bemta-14.messagelabs.com id
	47/90-16986-FBC17A35; Sun, 22 Jun 2014 18:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1403460797!9559168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32059 invoked from network); 22 Jun 2014 18:13:18 -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;
	22 Jun 2014 18:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGT-0000Eb-89
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGT-0007fo-65
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:17 +0000
Date: Sun, 22 Jun 2014 18:13:17 +0000
Message-Id: <E1WymGT-0007fo-65@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mce: sanitise the #MC entry path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af9505932c0e00233fa2d060f1607ac0b174ac6b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 15:51:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:51:28 2014 +0200

    x86/mce: sanitise the #MC entry path
    
    The 'error_code' function parameters are not used at all; drop it from the
    call chain.  If it is needed at some point in the future, it is available via
    cpu_user_regs.
    
    Having do_machine_check() call the non-inlineable machine_check_vector() just
    to get at the static function pointer '_machine_check_vector' is silly.  Move
    do_machine_check() from traps.c to mce.c and do away with
    machine_check_vector() entirely.
    
    Both {intel,amd}_init_mce() register their own local function as the #MC
    handler, each of which call mcheck_cmn_handler() in an identical way.  Fix
    this craziness by actually turning mcheck_cmn_handler() into a valid #MC
    handler (as its comments already state), and have {intel,amd}_init_mce()
    register it instead of their own private handlers.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mce.c       |   11 ++++++-----
 xen/arch/x86/cpu/mcheck/mce.h       |    5 ++---
 xen/arch/x86/cpu/mcheck/mce_amd.c   |    9 +--------
 xen/arch/x86/cpu/mcheck/mce_intel.c |    8 +-------
 xen/arch/x86/traps.c                |    5 -----
 xen/include/asm-x86/traps.h         |    2 --
 6 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 13e5547..812daf6 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -70,7 +70,7 @@ static void __init mce_set_verbosity(char *str)
 custom_param("mce_verbosity", mce_set_verbosity);
 
 /* Handle unconfigured int18 (should never happen) */
-static void unexpected_machine_check(const struct cpu_user_regs *regs, long error_code)
+static void unexpected_machine_check(const struct cpu_user_regs *regs)
 {
     console_force_unlock();
     printk("Unexpected Machine Check Exception\n");
@@ -88,9 +88,9 @@ void x86_mce_vector_register(x86_mce_vector_t hdlr)
 
 /* Call the installed machine check handler for this CPU setup. */
 
-void machine_check_vector(const struct cpu_user_regs *regs, long error_code)
+void do_machine_check(const struct cpu_user_regs *regs)
 {
-    _machine_check_vector(regs, error_code);
+    _machine_check_vector(regs);
 }
 
 /* Init machine check callback handler
@@ -459,9 +459,10 @@ static int mce_urgent_action(const struct cpu_user_regs *regs,
 }
 
 /* Shared #MC handler. */
-void mcheck_cmn_handler(const struct cpu_user_regs *regs, long error_code,
-    struct mca_banks *bankmask, struct mca_banks *clear_bank)
+void mcheck_cmn_handler(const struct cpu_user_regs *regs)
 {
+    struct mca_banks *bankmask = mca_allbanks;
+    struct mca_banks *clear_bank = __get_cpu_var(mce_clear_banks);
     uint64_t gstatus;
     mctelem_cookie_t mctc = NULL;
     struct mca_summary bs;
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index 0397f80..e83d431 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -62,13 +62,12 @@ void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
 			 uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
 /* Register a handler for machine check exceptions. */
-typedef void (*x86_mce_vector_t)(const struct cpu_user_regs *, long);
+typedef void (*x86_mce_vector_t)(const struct cpu_user_regs *regs);
 extern void x86_mce_vector_register(x86_mce_vector_t);
 
 /* Common generic MCE handler that implementations may nominate
  * via x86_mce_vector_register. */
-extern void mcheck_cmn_handler(const struct cpu_user_regs *, long,
-    struct mca_banks *, struct mca_banks *);
+extern void mcheck_cmn_handler(const struct cpu_user_regs *regs);
 
 /* Register a handler for judging whether mce is recoverable. */
 typedef int (*mce_recoverable_t)(uint64_t status);
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 9daa461..4e8ad38 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -241,13 +241,6 @@ amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
     return mc_ext;
 }
 
-/* Common AMD Machine Check Handler for AMD K8 and higher */
-static void amd_cmn_machine_check(const struct cpu_user_regs *regs, long error_code)
-{
-    mcheck_cmn_handler(regs, error_code, mca_allbanks,
-                       __get_cpu_var(mce_clear_banks));
-}
-
 static int amd_need_clearbank_scan(enum mca_source who, uint64_t status)
 {
     if ( who != MCA_MCE_SCAN )
@@ -287,7 +280,7 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
     /* Assume that machine check support is available.
      * The minimum provided support is at least the K8. */
     mce_handler_init();
-    x86_mce_vector_register(amd_cmn_machine_check);
+    x86_mce_vector_register(mcheck_cmn_handler);
     mce_need_clearbank_register(amd_need_clearbank_scan);
 
     for ( i = 0; i < nr_mce_banks; i++ )
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index bb4ce47..94db396 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -392,12 +392,6 @@ static const struct mca_error_handler intel_mce_uhandlers[] = {
     {intel_default_check, intel_default_mce_uhandler}
 };
 
-static void intel_machine_check(const struct cpu_user_regs * regs, long error_code)
-{
-    mcheck_cmn_handler(regs, error_code, mca_allbanks,
-        __get_cpu_var(mce_clear_banks));
-}
-
 /* According to MCA OS writer guide, CMCI handler need to clear bank when
  * 1) CE (UC = 0)
  * 2) ser_support = 1, Superious error, OVER = 0, EN = 0, [UC = 1]
@@ -780,7 +774,7 @@ static void intel_init_mce(void)
     if (firstbank) /* if cmci enabled, firstbank = 0 */
         wrmsrl(MSR_IA32_MC0_STATUS, 0x0ULL);
 
-    x86_mce_vector_register(intel_machine_check);
+    x86_mce_vector_register(mcheck_cmn_handler);
     mce_recoverable_register(intel_recoverable_scan);
     mce_need_clearbank_register(intel_need_clearbank_scan);
     mce_register_addrcheck(intel_checkaddr);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 5897928..677074b 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1086,11 +1086,6 @@ void do_int3(struct cpu_user_regs *regs)
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-void do_machine_check(const struct cpu_user_regs *regs)
-{
-    machine_check_vector(regs, regs->error_code);
-}
-
 static void reserved_bit_page_fault(
     unsigned long addr, struct cpu_user_regs *regs)
 {
diff --git a/xen/include/asm-x86/traps.h b/xen/include/asm-x86/traps.h
index 47b7ab9..ebb6378 100644
--- a/xen/include/asm-x86/traps.h
+++ b/xen/include/asm-x86/traps.h
@@ -28,8 +28,6 @@ struct softirq_trap {
 
 struct cpu_user_regs;
 
-extern void machine_check_vector(const struct cpu_user_regs *regs, long error_code);
-
 void async_exception_cleanup(struct vcpu *);
  
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:21 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGX-00075W-A6; Sun, 22 Jun 2014 18:13:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGW-00075C-1B
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:20 +0000
Received: from [193.109.254.147:5632] by server-16.bemta-14.messagelabs.com id
	47/90-16986-FBC17A35; Sun, 22 Jun 2014 18:13:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1403460797!9559168!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32059 invoked from network); 22 Jun 2014 18:13:18 -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;
	22 Jun 2014 18:13:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGT-0000Eb-89
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGT-0007fo-65
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:17 +0000
Date: Sun, 22 Jun 2014 18:13:17 +0000
Message-Id: <E1WymGT-0007fo-65@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mce: sanitise the #MC entry path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit af9505932c0e00233fa2d060f1607ac0b174ac6b
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 15:51:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:51:28 2014 +0200

    x86/mce: sanitise the #MC entry path
    
    The 'error_code' function parameters are not used at all; drop it from the
    call chain.  If it is needed at some point in the future, it is available via
    cpu_user_regs.
    
    Having do_machine_check() call the non-inlineable machine_check_vector() just
    to get at the static function pointer '_machine_check_vector' is silly.  Move
    do_machine_check() from traps.c to mce.c and do away with
    machine_check_vector() entirely.
    
    Both {intel,amd}_init_mce() register their own local function as the #MC
    handler, each of which call mcheck_cmn_handler() in an identical way.  Fix
    this craziness by actually turning mcheck_cmn_handler() into a valid #MC
    handler (as its comments already state), and have {intel,amd}_init_mce()
    register it instead of their own private handlers.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
---
 xen/arch/x86/cpu/mcheck/mce.c       |   11 ++++++-----
 xen/arch/x86/cpu/mcheck/mce.h       |    5 ++---
 xen/arch/x86/cpu/mcheck/mce_amd.c   |    9 +--------
 xen/arch/x86/cpu/mcheck/mce_intel.c |    8 +-------
 xen/arch/x86/traps.c                |    5 -----
 xen/include/asm-x86/traps.h         |    2 --
 6 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 13e5547..812daf6 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -70,7 +70,7 @@ static void __init mce_set_verbosity(char *str)
 custom_param("mce_verbosity", mce_set_verbosity);
 
 /* Handle unconfigured int18 (should never happen) */
-static void unexpected_machine_check(const struct cpu_user_regs *regs, long error_code)
+static void unexpected_machine_check(const struct cpu_user_regs *regs)
 {
     console_force_unlock();
     printk("Unexpected Machine Check Exception\n");
@@ -88,9 +88,9 @@ void x86_mce_vector_register(x86_mce_vector_t hdlr)
 
 /* Call the installed machine check handler for this CPU setup. */
 
-void machine_check_vector(const struct cpu_user_regs *regs, long error_code)
+void do_machine_check(const struct cpu_user_regs *regs)
 {
-    _machine_check_vector(regs, error_code);
+    _machine_check_vector(regs);
 }
 
 /* Init machine check callback handler
@@ -459,9 +459,10 @@ static int mce_urgent_action(const struct cpu_user_regs *regs,
 }
 
 /* Shared #MC handler. */
-void mcheck_cmn_handler(const struct cpu_user_regs *regs, long error_code,
-    struct mca_banks *bankmask, struct mca_banks *clear_bank)
+void mcheck_cmn_handler(const struct cpu_user_regs *regs)
 {
+    struct mca_banks *bankmask = mca_allbanks;
+    struct mca_banks *clear_bank = __get_cpu_var(mce_clear_banks);
     uint64_t gstatus;
     mctelem_cookie_t mctc = NULL;
     struct mca_summary bs;
diff --git a/xen/arch/x86/cpu/mcheck/mce.h b/xen/arch/x86/cpu/mcheck/mce.h
index 0397f80..e83d431 100644
--- a/xen/arch/x86/cpu/mcheck/mce.h
+++ b/xen/arch/x86/cpu/mcheck/mce.h
@@ -62,13 +62,12 @@ void x86_mc_get_cpu_info(unsigned, uint32_t *, uint16_t *, uint16_t *,
 			 uint32_t *, uint32_t *, uint32_t *, uint32_t *);
 
 /* Register a handler for machine check exceptions. */
-typedef void (*x86_mce_vector_t)(const struct cpu_user_regs *, long);
+typedef void (*x86_mce_vector_t)(const struct cpu_user_regs *regs);
 extern void x86_mce_vector_register(x86_mce_vector_t);
 
 /* Common generic MCE handler that implementations may nominate
  * via x86_mce_vector_register. */
-extern void mcheck_cmn_handler(const struct cpu_user_regs *, long,
-    struct mca_banks *, struct mca_banks *);
+extern void mcheck_cmn_handler(const struct cpu_user_regs *regs);
 
 /* Register a handler for judging whether mce is recoverable. */
 typedef int (*mce_recoverable_t)(uint64_t status);
diff --git a/xen/arch/x86/cpu/mcheck/mce_amd.c b/xen/arch/x86/cpu/mcheck/mce_amd.c
index 9daa461..4e8ad38 100644
--- a/xen/arch/x86/cpu/mcheck/mce_amd.c
+++ b/xen/arch/x86/cpu/mcheck/mce_amd.c
@@ -241,13 +241,6 @@ amd_f10_handler(struct mc_info *mi, uint16_t bank, uint64_t status)
     return mc_ext;
 }
 
-/* Common AMD Machine Check Handler for AMD K8 and higher */
-static void amd_cmn_machine_check(const struct cpu_user_regs *regs, long error_code)
-{
-    mcheck_cmn_handler(regs, error_code, mca_allbanks,
-                       __get_cpu_var(mce_clear_banks));
-}
-
 static int amd_need_clearbank_scan(enum mca_source who, uint64_t status)
 {
     if ( who != MCA_MCE_SCAN )
@@ -287,7 +280,7 @@ amd_mcheck_init(struct cpuinfo_x86 *ci)
     /* Assume that machine check support is available.
      * The minimum provided support is at least the K8. */
     mce_handler_init();
-    x86_mce_vector_register(amd_cmn_machine_check);
+    x86_mce_vector_register(mcheck_cmn_handler);
     mce_need_clearbank_register(amd_need_clearbank_scan);
 
     for ( i = 0; i < nr_mce_banks; i++ )
diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index bb4ce47..94db396 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -392,12 +392,6 @@ static const struct mca_error_handler intel_mce_uhandlers[] = {
     {intel_default_check, intel_default_mce_uhandler}
 };
 
-static void intel_machine_check(const struct cpu_user_regs * regs, long error_code)
-{
-    mcheck_cmn_handler(regs, error_code, mca_allbanks,
-        __get_cpu_var(mce_clear_banks));
-}
-
 /* According to MCA OS writer guide, CMCI handler need to clear bank when
  * 1) CE (UC = 0)
  * 2) ser_support = 1, Superious error, OVER = 0, EN = 0, [UC = 1]
@@ -780,7 +774,7 @@ static void intel_init_mce(void)
     if (firstbank) /* if cmci enabled, firstbank = 0 */
         wrmsrl(MSR_IA32_MC0_STATUS, 0x0ULL);
 
-    x86_mce_vector_register(intel_machine_check);
+    x86_mce_vector_register(mcheck_cmn_handler);
     mce_recoverable_register(intel_recoverable_scan);
     mce_need_clearbank_register(intel_need_clearbank_scan);
     mce_register_addrcheck(intel_checkaddr);
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 5897928..677074b 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -1086,11 +1086,6 @@ void do_int3(struct cpu_user_regs *regs)
     do_guest_trap(TRAP_int3, regs, 0);
 }
 
-void do_machine_check(const struct cpu_user_regs *regs)
-{
-    machine_check_vector(regs, regs->error_code);
-}
-
 static void reserved_bit_page_fault(
     unsigned long addr, struct cpu_user_regs *regs)
 {
diff --git a/xen/include/asm-x86/traps.h b/xen/include/asm-x86/traps.h
index 47b7ab9..ebb6378 100644
--- a/xen/include/asm-x86/traps.h
+++ b/xen/include/asm-x86/traps.h
@@ -28,8 +28,6 @@ struct softirq_trap {
 
 struct cpu_user_regs;
 
-extern void machine_check_vector(const struct cpu_user_regs *regs, long error_code);
-
 void async_exception_cleanup(struct vcpu *);
  
 /**
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGh-000779-Ct; Sun, 22 Jun 2014 18:13:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGg-00076o-03
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:30 +0000
Content-Length: 2538
Received: from [85.158.139.211:57506] by server-16.bemta-5.messagelabs.com id
	EC/0D-18862-9CC17A35; Sun, 22 Jun 2014 18:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1403460807!11358833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24068 invoked from network); 22 Jun 2014 18:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGd-0000Eh-Cx
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGd-0007gB-BG
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:27 +0000
Date: Sun, 22 Jun 2014 18:13:27 +0000
Message-Id: <E1WymGd-0007gB-BG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: prevent PVH Dom0 from having
	pages with more than one ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8844156818687023713=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8844156818687023713==
Content-Length: 2139
Content-Transfer-Encoding: quoted-printable

commit 86104258d36a2d3b0c92aabd2147c731b792f501
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jun 18 15:52:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:52:25 2014 +0200

    x86: prevent PVH Dom0 from having pages with more than one ref
    
    On PV guests a reference is taken when a page gets added to the page
    tables, which makes pages added to the page tables have two
    references, but this is not suitable for PVH that doesn't use the
    PVMMU. In the PVH case only one reference has to be taken or else the
    page would not be freed when the memory of the domain is decreased.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index ba42fc9..d4473c1 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1137,10 +1137,13 @@ int __init construct_dom0(
                                     L1_PROT : COMPAT_L1_PROT));
         l1tab++;
 
-        page =3D mfn_to_page(mfn);
-        if ( (page->u.inuse.type_info =3D=3D 0) &&
-             !get_page_and_type(page, d, PGT_writable_page) )
-            BUG();
+        if ( !paging_mode_translate(d) )
+        {
+            page =3D mfn_to_page(mfn);
+            if ( !page->u.inuse.type_info &&
+                 !get_page_and_type(page, d, PGT_writable_page) )
+                BUG();
+        }
     }
 
     if ( is_pv_32on64_domain(d) )
@@ -1300,7 +1303,7 @@ int __init construct_dom0(
         if ( get_gpfn_from_mfn(mfn) >=3D count )
         {
             BUG_ON(is_pv_32bit_domain(d));
-            if ( !page->u.inuse.type_info &&
+            if ( !paging_mode_translate(d) && !page->u.inuse.type_info &&
                  !get_page_and_type(page, d, PGT_writable_page) )
                 BUG();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:31 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGh-000779-Ct; Sun, 22 Jun 2014 18:13:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGg-00076o-03
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:30 +0000
Content-Length: 2538
Received: from [85.158.139.211:57506] by server-16.bemta-5.messagelabs.com id
	EC/0D-18862-9CC17A35; Sun, 22 Jun 2014 18:13:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-206.messagelabs.com!1403460807!11358833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24068 invoked from network); 22 Jun 2014 18:13:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:13:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGd-0000Eh-Cx
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGd-0007gB-BG
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:27 +0000
Date: Sun, 22 Jun 2014 18:13:27 +0000
Message-Id: <E1WymGd-0007gB-BG@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86: prevent PVH Dom0 from having
	pages with more than one ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8844156818687023713=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8844156818687023713==
Content-Length: 2139
Content-Transfer-Encoding: quoted-printable

commit 86104258d36a2d3b0c92aabd2147c731b792f501
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Wed Jun 18 15:52:25 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:52:25 2014 +0200

    x86: prevent PVH Dom0 from having pages with more than one ref
    
    On PV guests a reference is taken when a page gets added to the page
    tables, which makes pages added to the page tables have two
    references, but this is not suitable for PVH that doesn't use the
    PVMMU. In the PVH case only one reference has to be taken or else the
    page would not be freed when the memory of the domain is decreased.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 xen/arch/x86/domain_build.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index ba42fc9..d4473c1 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1137,10 +1137,13 @@ int __init construct_dom0(
                                     L1_PROT : COMPAT_L1_PROT));
         l1tab++;
 
-        page =3D mfn_to_page(mfn);
-        if ( (page->u.inuse.type_info =3D=3D 0) &&
-             !get_page_and_type(page, d, PGT_writable_page) )
-            BUG();
+        if ( !paging_mode_translate(d) )
+        {
+            page =3D mfn_to_page(mfn);
+            if ( !page->u.inuse.type_info &&
+                 !get_page_and_type(page, d, PGT_writable_page) )
+                BUG();
+        }
     }
 
     if ( is_pv_32on64_domain(d) )
@@ -1300,7 +1303,7 @@ int __init construct_dom0(
         if ( get_gpfn_from_mfn(mfn) >=3D count )
         {
             BUG_ON(is_pv_32bit_domain(d));
-            if ( !page->u.inuse.type_info &&
+            if ( !paging_mode_translate(d) && !page->u.inuse.type_info &&
                  !get_page_and_type(page, d, PGT_writable_page) )
                 BUG();
 
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGr-000794-Hz; Sun, 22 Jun 2014 18:13:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGp-00078g-Uf
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:40 +0000
Received: from [193.109.254.147:41086] by server-15.bemta-14.messagelabs.com
	id B5/98-15813-3DC17A35; Sun, 22 Jun 2014 18:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1403460817!9559196!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32755 invoked from network); 22 Jun 2014 18:13:38 -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;
	22 Jun 2014 18:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGn-0000En-HC
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGn-0007ga-GA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:37 +0000
Date: Sun, 22 Jun 2014 18:13:37 +0000
Message-Id: <E1WymGn-0007ga-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: allow FPU/XMM use in runtime
	service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0fe297dabc96d8161d568f19a99722c4739b9f9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 18 15:53:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:53:27 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index d7c884b..166852d 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -45,8 +47,14 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -82,6 +90,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index bd72138..a372e0b 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -266,10 +266,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -284,9 +284,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 38dbcae..150a09e 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymGr-000794-Hz; Sun, 22 Jun 2014 18:13:41 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGp-00078g-Uf
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:40 +0000
Received: from [193.109.254.147:41086] by server-15.bemta-14.messagelabs.com
	id B5/98-15813-3DC17A35; Sun, 22 Jun 2014 18:13:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-27.messagelabs.com!1403460817!9559196!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32755 invoked from network); 22 Jun 2014 18:13:38 -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;
	22 Jun 2014 18:13:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGn-0000En-HC
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGn-0007ga-GA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:37 +0000
Date: Sun, 22 Jun 2014 18:13:37 +0000
Message-Id: <E1WymGn-0007ga-GA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/EFI: allow FPU/XMM use in runtime
	service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e0fe297dabc96d8161d568f19a99722c4739b9f9
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Wed Jun 18 15:53:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Wed Jun 18 15:53:27 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index d7c884b..166852d 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -45,8 +47,14 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -82,6 +90,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index bd72138..a372e0b 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -266,10 +266,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -284,9 +284,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 38dbcae..150a09e 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymH1-0007Ae-Kw; Sun, 22 Jun 2014 18:13:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGz-0007AQ-UZ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:50 +0000
Received: from [193.109.254.147:41326] by server-5.bemta-14.messagelabs.com id
	CE/CB-26413-DDC17A35; Sun, 22 Jun 2014 18:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403460827!12890698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27954 invoked from network); 22 Jun 2014 18:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGx-0000Et-Lj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGx-0007hj-K0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:47 +0000
Date: Sun, 22 Jun 2014 18:13:47 +0000
Message-Id: <E1WymGx-0007hj-K0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Drop cpuinfo_x86 structure
	definition
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b70cb9ff8a17ab2e965cbf139ccac9e027a2985
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jun 16 21:41:34 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:02:54 2014 +0100

    xen/arm: Drop cpuinfo_x86 structure definition
    
    I'm not sure why this structure were defined in ARM specific include...
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/processor.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 9267c1b..ebc683d 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -474,10 +474,6 @@ void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
 void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
                            const struct vcpu_guest_core_regs *regs);
 
-struct cpuinfo_x86 {
-    uint32_t pfr32[2];
-};
-
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_ARM_PROCESSOR_H */
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:13:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:13:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymH1-0007Ae-Kw; Sun, 22 Jun 2014 18:13:51 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGz-0007AQ-UZ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:50 +0000
Received: from [193.109.254.147:41326] by server-5.bemta-14.messagelabs.com id
	CE/CB-26413-DDC17A35; Sun, 22 Jun 2014 18:13:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403460827!12890698!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27954 invoked from network); 22 Jun 2014 18:13:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:13:48 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGx-0000Et-Lj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymGx-0007hj-K0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:47 +0000
Date: Sun, 22 Jun 2014 18:13:47 +0000
Message-Id: <E1WymGx-0007hj-K0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Drop cpuinfo_x86 structure
	definition
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6b70cb9ff8a17ab2e965cbf139ccac9e027a2985
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jun 16 21:41:34 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:02:54 2014 +0100

    xen/arm: Drop cpuinfo_x86 structure definition
    
    I'm not sure why this structure were defined in ARM specific include...
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/include/asm-arm/processor.h |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/xen/include/asm-arm/processor.h b/xen/include/asm-arm/processor.h
index 9267c1b..ebc683d 100644
--- a/xen/include/asm-arm/processor.h
+++ b/xen/include/asm-arm/processor.h
@@ -474,10 +474,6 @@ void vcpu_regs_hyp_to_user(const struct vcpu *vcpu,
 void vcpu_regs_user_to_hyp(struct vcpu *vcpu,
                            const struct vcpu_guest_core_regs *regs);
 
-struct cpuinfo_x86 {
-    uint32_t pfr32[2];
-};
-
 #endif /* __ASSEMBLY__ */
 #endif /* __ASM_ARM_PROCESSOR_H */
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHE-0007CL-OO; Sun, 22 Jun 2014 18:14:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHC-0007CB-HL
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:03 +0000
Received: from [85.158.143.35:46762] by server-1.bemta-4.messagelabs.com id
	89/18-09496-9EC17A35; Sun, 22 Jun 2014 18:14:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403460838!13027633!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3998 invoked from network); 22 Jun 2014 18:13:58 -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;
	22 Jun 2014 18:13:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymH7-0000Ez-RA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymH7-0007iU-Om
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:57 +0000
Date: Sun, 22 Jun 2014 18:13:57 +0000
Message-Id: <E1WymH7-0007iU-Om@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/python: Remove some legacy
	scripts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1747fc59d66157dff33476fe252c08fbba1d7cfa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 17 18:26:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:03:54 2014 +0100

    tools/python: Remove some legacy scripts
    
    Nothing in scripts/ is referenced by the current Xen build system.  It is a
    legacy version of the XenAPI bindings, other parts of which have already been
    removed from the tree.
    
    Additionally, prevent the install target from creating an $(SBINDIR) directory
    but putting nothing in it.  This appears to be something missed when removing
    Xend.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/python/Makefile                   |    2 -
 tools/python/README.XendConfig          |  160 ------
 tools/python/README.sxpcfg              |  114 ----
 tools/python/scripts/README             |   49 --
 tools/python/scripts/README.lifecycle   |  136 -----
 tools/python/scripts/test_hvm_create.py |  178 -------
 tools/python/scripts/test_vm_create.py  |  211 --------
 tools/python/scripts/xapi.domcfg.py     |   37 --
 tools/python/scripts/xapi.py            |  854 -------------------------------
 tools/python/scripts/xapi.vbdcfg.py     |   12 -
 tools/python/scripts/xapi.vdicfg.py     |    6 -
 tools/python/scripts/xapi.vifcfg.py     |   10 -
 tools/python/scripts/xapi.vtpmcfg.py    |    3 -
 13 files changed, 0 insertions(+), 1772 deletions(-)

diff --git a/tools/python/Makefile b/tools/python/Makefile
index c433cbe..eee746d 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -23,8 +23,6 @@ install:
 	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
 
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-
 .PHONY: test
 test:
 	export LD_LIBRARY_PATH=$$(readlink -f ../libxc):$$(readlink -f ../xenstore); $(PYTHON) test.py -b -u
diff --git a/tools/python/README.XendConfig b/tools/python/README.XendConfig
deleted file mode 100644
index 338715b..0000000
--- a/tools/python/README.XendConfig
+++ /dev/null
@@ -1,160 +0,0 @@
-XendConfig parameters
-=====================
-
-Things that are empty means there is no direct mapping.
-
-In order to make the XendConfig fully backwards compatible, it needs a
-representation of all the below parameters. Where both columns have
-values, it means we can have a direct translation.
-
-Where the Legacy Config value does not exist, it means we have to make
-up the value on whether we supported it or not.
-
-Where the Legacy config value is prefixed with an '!', it means it is
-not a direct mapping and needs a translation function.
-
-Where the Xen API config value does not exist, it means we have to add
-a parameter outside of the Xen API Configuration to support it.
-
-
-Xen API Config                  Legacy Config
---------------                  -------------
-uuid                            uuid
-power_state                     !state (and xc_getinfo)
-name_label                      name
-name_description
-user_version
-is_a_template
-auto_power_on
-resident_on
-memory_static_min               memory
-memory_static_max               maxmem
-memory_actual
-memory_dynamic_min
-memory_dynamic_max
-vcpus_policy                    !set_credit/set_sedf
-vcpus_params                    !set_credit/set_sedf
-vcpus_number                    vcpus
-vcpus_utilisation               
-vcpus_features_required
-vcpus_features_can_use
-vcpus_features_force_on
-vcpus_features_force_off
-actions_after_shutdown          on_poweroff
-actions_after_reboot            on_reboot
-actions_after_suspend           
-actions_after_crash             on_crash
-
-vifs                            !(devices.vifs)
- - uuid                         dev.uuid
- - name
- - type                         vif.type
- - device
- - network
- - vm
- - MAC                          vif.mac
- - MTU
- - io_read_kbs                  !vif.rate
- - io_write_kbs                 !vif.rate
-                                vif.bridge
-                                vif.script
-                                vif.ip
-                                vif.vifname (backend name)
-
-vbds                            !(devices.vbds)
- - uuid
- - vm
- - vdi
- - device                       vbd.uname
- - mode                         !vbd.mode
- - driver                       vbd.driver
- - io_read_kbs
- - io_write_kbs
-
-bios_boot                       image.boot?
-platform_std_VGA                image.stdvga
-platform_serial                 image.serial
-platform_localtime              !localtime (bool)
-platform_clock_offset           
-platform_enable_audio           !image.soundhw (bool)
-builder                         (sxp root name)
-boot_method                     
-kernel_kernel                   kernel.kernel
-kernel_initrd                   kernel.ramdisk
-kernel_args                     !kernel.args
-grub_cmdline                    bootloader_args
-PCI_bus                         
-tools_version
-
-otherConfig
- - image                        image (see image.*)
- - shadow_memory                shadow_memory
- - security                     security
- - vcpu_avail                   vcpu_avail
- - features                     features
- - on_xend_stop                 on_xend_stop
- - on_xend_start                on_xend_start
- - start_time                   start_time
- - cpus                         cpus (?)
-                                max_vcpu_id
-
- >> only from xc
- - online_vcpus                 xc.online_vcpus
- - status                       xc.status
- - cpu_time                     xc.cpu_time
- - shutdown_reason              xc.shutdown_reason
- - up_time                      xc.uptime
- - crashed                      xc.crashed
- - dying                        xc.dying
- - shutdown                     xc.shutdown
-
-                                image.type (linux or hvm)
-                                image.root
-                                image.ip
-                                image.nographic
-                                image.vnc
-                                image.sdl
-                                image.monitor
-                                image.vncdisplay
-                                image.vncunused
-                                image.hvm.device_model
-                                image.hvm.display
-                                image.hvm.xauthority
-                                image.hvm.vncconsole
-                                image.hvm.pae
-                                image.hvm.acpi (also in image.devices)
-                                image.hvm.apic
-                                image.hvm.devices.boot
-                                image.hvm.devices.fda
-                                image.hvm.devices.fdb
-                                image.hvm.devices.soundhw
-                                image.hvm.devices.isa
-                                image.hvm.devices.vcpus?
-                                image.hvm.devices.acpi
-                                image.hvm.devices.usb
-                                image.hvm.devices.usbdevice
-
-
-                                dev.backend
-                                dev.dom
-                                dev.id
-                                
-                                pci.domain
-                                pci.bus
-                                pci.slot
-                                pci.func
-
-                                pciquirk.pci_ids
-                                pciquirk.pci_config_space_fields
-                                pciquirk.unconstrained_dev_ids
-
-                                irq.irq
-
-- vcpu (probably not needed, only in XM and generated dynamically)
-                                vcpu.number
-                                vcpu.online
-                                vcpu.blocked
-                                vcpu.running
-                                vcpu.cpu_time
-                                vcpu.cpu
-                                vcpu.cpumap
diff --git a/tools/python/README.sxpcfg b/tools/python/README.sxpcfg
deleted file mode 100644
index a4762fe..0000000
--- a/tools/python/README.sxpcfg
+++ /dev/null
@@ -1,114 +0,0 @@
-Map of all supported SXP configuration options
-----------------------------------------------
-
-uuid
-vcpus
-maxmem
-memory
-name
-on_poweroff
-on_reboot
-on_crash
-bootloader
-kernel_kernel
-kernel_initrd
-kernel_args
-localtime
-
-shadow_memory
-security
-ssidref (deprecated)
-vcpu_avail
-cpu_weight (deprecated)
-bootloader_args
-features
-on_xend_stop
-on_xend_start
-start_time
-cpu (deprecated)
-cpus
-
-(xc getinfo)
-domid
-online_vcpus
-status
-cpu_time
-shutdown_reason
-(xm list --long)
-up_time
-
-image 
-  - kernel
-  - ramdisk
-  - args
-  - ip
-  - root
-  (configVNC)
-  - nographic
-  - vnc
-  - sdl
-  - vncdisplay
-  - vncunused
-  (HVM)
-  - device_model
-  - display
-  - xauthority
-  - vncconsole
-  - pae
-  - acpi
-  - apic
-  (parseDeviceModel)
-  - boot
-  - fda
-  - fdb
-  - soundhw
-  - localtime
-  - monitor
-  - serial
-  - stdvga
-  - isa
-  - vcpus
-  - acpi
-  - usb
-  - usbdevice
-
-(all devices)
-  - backend
-  - dom
-  - id
-  - uuid
-
-vbd
-  - uname
-  - dev (ioemu:, .. etc)
-  - mode (r, w. w!)
-
-vif
-  - type
-  - mac
-  - bridge
-  - model
-  - rate
-  - vifname
-  - script
-  - ip
-
-pci
-  - domain
-  - bus
-  - slot
-  - func
-  (Xen 2.0)
-  - dev
-
-io
-  - from
-  - to
-
-pciquirk
-  - pci_ids
-  - pci_config_space_fields
-  - unconstrained_dev_ids
-
-irq
-  - irq
diff --git a/tools/python/scripts/README b/tools/python/scripts/README
deleted file mode 100644
index a5d8759..0000000
--- a/tools/python/scripts/README
+++ /dev/null
@@ -1,49 +0,0 @@
-Xen API Test
-============
-
-xapi.py is a simple command line tool to test the functionality of a
-domain lifecycle supporting, Xen API talking version of Xend.
-
-Creating a VM is slightly more work under the Xen API. The differences
-with this and xm is:
-
-1. None of the devices are created during vm-create. You must use
-   vbd-create and vif-create to attach a new device to the VM.
-
-2. VM's that are created using vm-create will not start by
-   default. You must use vm-start to "start" the domain.
-
-3. VM's that are created using vm-create will not be removed on
-   shutdown. You must remove it using vm-delete.
-
-Example Configuration Files
----------------------------
-
-xapi.py uses a simple python configuration file similar to xm in the
-face of the lack of any other reasonable format.
-
-All the fields are directly mapped to the arguments that are in the
-Xen API constructore for the respective classes.
-
-xapi.domcfg.py: example configuration for a paravirtualised domain.
-xapi.vbdcfg.py: example configuration for a file based block device.
-xapi.vifcfg.py: example configuration for a simple bridged network
-                device.
-
-Example Session
----------------
-
-xapi.py vm-list
-xapi.py vm-create xapi.domcfg.py
-xapi.py vbd-create <DomainName> xapi.vbdcfg.py
-xapi.py vif-create <DomainName> xapi.vifcfg.py
-
-Notes
------
-
-Currently lacking:
-
-1. Any real authentication. XendAuthSessions need to be filled in with
-   a proper authentication implementation either using PAM or other
-   means.
-
diff --git a/tools/python/scripts/README.lifecycle b/tools/python/scripts/README.lifecycle
deleted file mode 100644
index 1e24cc0..0000000
--- a/tools/python/scripts/README.lifecycle
+++ /dev/null
@@ -1,136 +0,0 @@
-Xend Lifecycle/XenAPI Implementation Changes
-============================================
-
-Summary of what has changed in this branch of Xend:
-
-Managed Domains
----------------
-
-The concept of managed domains is that Xend now has the ability to
-manage the lifecycle of a domain from when it is created to being
-shutdown. 
-
-XendDomain
-~~~~~~~~~~
-
-In order to support managed domains, XendDomain has been modified to
-keep the configuration in /var/lib/xend/domains/.
-
-The configuration is stored in SXP format so that it can be easily
-loaded by the current Xend. In the future, we may switch to an XML
-format similar to how XenAPI defines a VM configuration.
-
-TODO: There are still places where the device configuration or VM
-configuration can be altered but the managed domain does not save it.
-
-XendDomainInfo
-~~~~~~~~~~~~~~
-
-XendDomainInfo has changed to support this mode of operation,
-especially with domain construction and assumptions about the domain
-when it shuts down.
-
-All configuration option parsing and validation has been moved from
-XendDomainInfo to XendConfig. The purpose is so that we can abstract
-away the knowledge of SXP in XendDomainInfo. The goal is to do away
-with the bulky way of accessing SXP in Xend and moving that all to a
-more pythonic interface.
-
-The DevController stuff at the end of XendDomainInfo has also been
-moved to XendDevices because now it is needed in both XendConfig and
-XendDomainInfo.
-
-Many of the constants are moved to XendConstants which reduces the
-amount of recursive or scoped imports that occur in the code.
-
-XendConfig
-~~~~~~~~~~
-
-XendConfig is the beginnings of an interface for configuration options
-so that other parts of Xend do not need to know what format the
-configuration in. It can accept configuration passed in as parsed SXP
-format, python filename or a Xen API struct.
-
-It is a subclass of a python dictionary, and hence access to its
-functions are via the __getitem__ accessor. 
-
-TODO: Define a proper interface to the XendConfig which is based on
-either the Xen API or some other flexible format.
-
-XMLRPCServer
-~~~~~~~~~~~~
-
-Changes to the busy loop in here and SrvServer so that the daemon
-shuts down cleanly. This also allows us to catch the shutdown and
-perform maintanence tasks on the domains. 
-
-Replacing xendomains init.d script 
-==================================
-
-Some work has gone into catching Xend's shutdown so that we can do the
-same tasks that xendomains init.d script does but natively in Xend.
-
-For instance, a new configuration option, 'on_xend_start' and
-'on_xend_stop' will allow domains that are managed by Xend to start up
-when Xend starts, and correspondingly stop when Xend stops.
-
-Xen API
-=======
-
-The new Xen API gives a standard interface to creating, configuring,
-controlling and destroying VMs and the virtual devices that belong to
-it.
-
-It also introduces the concept of Storage Repositories (SR) which are
-factories for creating disk images.
-
-XendDomain
-~~~~~~~~~~
-
-XendDomain has now separated the section for the Legacy XM XMLRPC API
-and the new Xen API.
-
-Since many things have a UUID, these are stored and represented as
-close to the existing configuration. 
-
-XendDomainInfo
-~~~~~~~~~~~~~~
-
-XendDomainInfo now supports UUIDs being assigned to devices and the
-domain itself. It will preserve the UUID for managed domains.
-
-A number of new functions are now in XendDomainInfo to provide an
-interface to devices.
-
-XendNode
-~~~~~~~~
-
-Represents the Host class in the Xen API and also contains an
-incomplete representation of the physical CPUs availabel for the host.
-
-XendAuthSessions
-~~~~~~~~~~~~~~~~
-
-An abstract authenticator for the Xen API. Currently it is an empty
-implementation with rudimentary support for users. The plan is the add
-PAM based authentication.
-
-XendAPI
-~~~~~~~
-
-The guts of the Xen API implementation. Implements all the supported
-functionality of the Xen API by placing calls to the relevent objects
-like XendDomain and XendDomanInfo.
-
-The initialisation of the XendAPI object will actually install a
-number of validation decorators in order to ensure the input is
-correct. It is using some features of introspection and
-metaprogramming in Python to reduce the amount of replication in the
-code.
-
-XMLRPCServer
-~~~~~~~~~~~~
-
-The XMLRPC Server will support both the new Xen API and the old XM
-XMLRPC API. The support is clearly marked in the code.
-
diff --git a/tools/python/scripts/test_hvm_create.py b/tools/python/scripts/test_hvm_create.py
deleted file mode 100644
index 5020363..0000000
--- a/tools/python/scripts/test_hvm_create.py
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/usr/bin/python
-
-vm_cfg = {
-    'name_label': 'API_HVM',
-    'user_version': 1,
-    'is_a_template': False,
-    'auto_power_on': False, # TODO
-
-    'memory_static_min': 64,    
-    'memory_static_max': 128,
-    #'memory_dynamic_min': 64,
-    #'memory_dynamic_max': 128,
-    
-    
-    'VCPUs_policy': 'credit',
-    'VCPUs_params': {},
-    'VCPUs_number': 2,
-
-    'actions_after_shutdown': 'destroy',
-    'actions_after_reboot': 'restart',
-    'actions_after_crash': 'destroy',
-    
-    'PV_bootloader': '',
-    'PV_bootloader_args': '',
-    
-    'PV_kernel': '',
-    'PV_ramdisk': '',
-    'PV_args': '',
-
-    'HVM_boot': 'cda',
-    'platform_std_VGA': False,
-    'platform_serial': '',
-    'platform_localtime': False,
-    'platform_clock_offset': False,
-    'platform_enable_audio': False,
-    'PCI_bus': ''
-}
-
-local_vdi_cfg = {
-    'name_label': 'gentoo.hvm',
-    'name_description': '',
-    'virtual_size': 0,
-    'type': 'system',
-    'parent': '',
-    'SR_name': 'Local',
-    'sharable': False,
-    'read_only': False,
-    'other_config': {'location': 'file:/root/gentoo.amd64.hvm.img'},
-}    
-
-local_vbd_cfg = {
-    'VDI': '',
-    'VM': '',
-    'device': 'hda',
-    'mode': 'RW',
-    'type': 'disk',
-    'driver': 'ioemu',
-}
-
-vif_cfg = {
-    'name': 'API_VIF',
-    'type': 'ioemu',
-    'device': '',
-    'network': '',
-    'MAC': '',
-    'MTU': 1500,
-}    
-
-console_cfg = {
-    'protocol': 'rfb',
-    'other_config': {'vncunused': 1, 'vncpasswd': 'testing'},
-}
-
-
-import sys
-import time
-
-from xapi import connect, execute
-
-def test_vm_create():
-    server, session = connect()
-    vm_uuid = None
-    local_vdi_uuid = None
-    local_vbd_uuid = None
-    vif_uuid = None
-    
-    # List all VMs
-    vm_list = execute(server, 'VM.get_all', (session,))
-    vm_names = []
-    for vm_uuid in vm_list:
-        vm_record = execute(server, 'VM.get_record', (session, vm_uuid))
-        vm_names.append(vm_record['name_label'])
-
-    # Get default SR
-    local_sr_list = execute(server, 'SR.get_by_name_label',
-                            (session, local_vdi_cfg['SR_name']))
-    local_sr_uuid = local_sr_list[0]
-
-    # Get default network
-    net_list = execute(server, 'network.get_all', (session,))
-    net_uuid = net_list[0]
-
-    try:
-        # Create a new VM
-        print 'Create VM'
-        vm_uuid = execute(server, 'VM.create', (session, vm_cfg))
-
-        print 'Create VDI'
-        # Create a new VDI (Local)
-        local_vdi_cfg['SR'] = local_sr_uuid
-        local_vdi_uuid = execute(server, 'VDI.create',
-                                 (session, local_vdi_cfg))
-
-        print 'Create VBD'
-        # Create a new VBD (Local)
-        local_vbd_cfg['VM'] = vm_uuid
-        local_vbd_cfg['VDI'] = local_vdi_uuid
-        local_vbd_uuid = execute(server, 'VBD.create',
-                                 (session, local_vbd_cfg))
-
-        print 'Craete VIF'
-        # Create a new VIF
-        vif_cfg['network'] = net_uuid
-        vif_cfg['VM'] = vm_uuid
-        vif_uuid = execute(server, 'VIF.create', (session, vif_cfg))
-
-        # Create a console
-        console_cfg['VM'] = vm_uuid
-        console_uuid = execute(server, 'console.create',
-                               (session, console_cfg))
-        print console_uuid
-
-        # Start the VM
-        execute(server, 'VM.start', (session, vm_uuid, False))
-
-        time.sleep(30)
-
-        test_suspend = False
-        if test_suspend:
-            print 'Suspending VM..'
-            execute(server, 'VM.suspend', (session, vm_uuid))
-            print 'Suspended VM.'
-            time.sleep(5)
-            print 'Resuming VM ...'
-            execute(server, 'VM.resume', (session, vm_uuid, False))
-            print 'Resumed VM.'
-
-        # Wait for user to say we're good to shut it down
-        while True:
-            destroy = raw_input('destroy VM? ')
-            if destroy[0] in ('y', 'Y'):
-                break
-
-    finally:
-        # Clean up
-        if vif_uuid:
-            execute(server, 'VIF.destroy', (session, vif_uuid))
-            
-        if local_vbd_uuid:
-            execute(server, 'VBD.destroy', (session, local_vbd_uuid))
-        if local_vdi_uuid:
-            execute(server, 'VDI.destroy', (session, local_vdi_uuid))
-            
-        if vm_uuid:
-            try:
-                execute(server, 'VM.hard_shutdown', (session, vm_uuid))
-                time.sleep(2)
-            except:
-                pass
-            try:    
-                execute(server, 'VM.destroy', (session, vm_uuid))
-            except:
-                pass
-
-
-if __name__ == "__main__":
-    test_vm_create()
-    
diff --git a/tools/python/scripts/test_vm_create.py b/tools/python/scripts/test_vm_create.py
deleted file mode 100644
index 9ac8a6e..0000000
--- a/tools/python/scripts/test_vm_create.py
+++ /dev/null
@@ -1,211 +0,0 @@
-#!/usr/bin/python
-
-vm_cfg = {
-    'name_label': 'APIVM',
-    'user_version': 1,
-    'is_a_template': False,
-    'auto_power_on': False, # TODO
-
-    'memory_static_min': 64,    
-    'memory_static_max': 128,
-    #'memory_dynamic_min': 64,
-    #'memory_dynamic_max': 128,
-    
-    
-    'VCPUs_policy': 'credit',
-    'VCPUs_params': '',
-    'VCPUs_number': 2,
-
-    'actions_after_shutdown': 'destroy',
-    'actions_after_reboot': 'restart',
-    'actions_after_crash': 'destroy',
-    
-    'PV_bootloader': '',
-    'PV_bootloader_args': '',
-    
-    'PV_kernel': '/boot/vmlinuz-2.6.18-xenU',
-    'PV_ramdisk': '',
-    'PV_args': 'root=/dev/sda1 ro',
-
-    #'HVM_boot': '',
-    'platform_std_VGA': False,
-    'platform_serial': '',
-    'platform_localtime': False,
-    'platform_clock_offset': False,
-    'platform_enable_audio': False,
-    'PCI_bus': ''
-}
-
-vdi_cfg = {
-    'name_label': 'API_VDI',
-    'name_description': '',
-    'virtual_size': 100 * 1024 * 1024 * 1024,
-    'type': 'system',
-    'parent': '',
-    'SR_name': 'QCoW',
-    'sharable': False,
-    'read_only': False,
-}
-
-vbd_cfg = {
-    'VDI': '',
-    'VM': '',
-    'device': 'sda2',
-    'mode': 'RW',
-    'type': 'disk',
-    'driver': 'paravirtualised',
-}
-
-local_vdi_cfg = {
-    'name_label': 'gentoo.amd64.img',
-    'name_description': '',
-    'virtual_size': 0,
-    'type': 'system',
-    'parent': '',
-    'SR_name': 'Local',
-    'sharable': False,
-    'read_only': False,
-    'other_config': {'location': 'file:/root/gentoo.amd64.img'},
-}    
-
-local_vbd_cfg = {
-    'VDI': '',
-    'VM': '',
-    'device': 'sda1',
-    'mode': 'RW',
-    'type': 'disk',
-    'driver': 'paravirtualised',
-}
-
-vif_cfg = {
-    'name': 'API_VIF',
-    'type': 'paravirtualised',
-    'device': '',
-    'network': '',
-    'MAC': '',
-    'MTU': 1500,
-}
-
-console_cfg = {
-    'protocol': 'rfb',
-    'other_config': {'vncunused': 1, 'vncpasswd': 'testing'},
-}    
-
-import sys
-import time
-
-from xapi import connect, execute
-
-def test_vm_create():
-    server, session = connect()
-    vm_uuid = None
-    vdi_uuid = None
-    local_vdi_uuid = None
-    local_vbd_uuid = None
-    vbd_uuid = None
-    vif_uuid = None
-    
-    # List all VMs
-    vm_list = execute(server, 'VM.get_all', (session,))
-    vm_names = []
-    for vm_uuid in vm_list:
-        vm_record = execute(server, 'VM.get_record', (session, vm_uuid))
-        vm_names.append(vm_record['name_label'])
-
-    # Get default SR
-    sr_list = execute(server, 'SR.get_by_name_label', (session,
-                                                       vdi_cfg['SR_name']))
-    sr_uuid = sr_list[0]
-
-    local_sr_list = execute(server, 'SR.get_by_name_label',
-                            (session, local_vdi_cfg['SR_name']))
-    local_sr_uuid = local_sr_list[0]
-
-    # Get default network
-    net_list = execute(server, 'network.get_all', (session,))
-    net_uuid = net_list[0]
-
-    try:
-        # Create a new VM
-        vm_uuid = execute(server, 'VM.create', (session, vm_cfg))
-        
-        # Create a new VDI
-        vdi_cfg['SR'] = sr_uuid
-        vdi_uuid = execute(server, 'VDI.create', (session, vdi_cfg))
-
-        # Create a VDI backed VBD
-        vbd_cfg['VM'] = vm_uuid
-        vbd_cfg['VDI'] = vdi_uuid
-        vbd_uuid = execute(server, 'VBD.create', (session, vbd_cfg))
-        
-        # Create a new VDI (Local)
-        local_vdi_cfg['SR'] = local_sr_uuid
-        local_vdi_uuid = execute(server, 'VDI.create',
-                                 (session, local_vdi_cfg))
- 
-        # Create a new VBD (Local)
-        local_vbd_cfg['VM'] = vm_uuid
-        local_vbd_cfg['VDI'] = local_vdi_uuid
-        local_vbd_uuid = execute(server, 'VBD.create',
-                                 (session, local_vbd_cfg))
-
-        # Create a new VIF
-        vif_cfg['network'] = net_uuid
-        vif_cfg['VM'] = vm_uuid
-        vif_uuid = execute(server, 'VIF.create', (session, vif_cfg))
-
-        # Create a console
-        console_cfg['VM'] = vm_uuid
-        console_uuid = execute(server, 'console.create',
-                               (session, console_cfg))
-        print console_uuid
-
-        # Start the VM
-        execute(server, 'VM.start', (session, vm_uuid, False))
-
-        time.sleep(30)
-
-        test_suspend = False
-        if test_suspend:
-            print 'Suspending VM..'
-            execute(server, 'VM.suspend', (session, vm_uuid))
-            print 'Suspended VM.'
-            time.sleep(5)
-            print 'Resuming VM ...'
-            execute(server, 'VM.resume', (session, vm_uuid, False))
-            print 'Resumed VM.'
-
-    finally:
-        # Wait for user to say we're good to shut it down
-        while True:
-            destroy = raw_input('destroy VM? ')
-            if destroy[0] in ('y', 'Y'):
-                break
-        
-        # Clean up
-        if vif_uuid:
-            execute(server, 'VIF.destroy', (session, vif_uuid))
-            
-        if local_vbd_uuid:
-            execute(server, 'VBD.destroy', (session, local_vbd_uuid))
-        if local_vdi_uuid:
-            execute(server, 'VDI.destroy', (session, local_vdi_uuid))
-            
-        if vbd_uuid:
-            execute(server, 'VBD.destroy', (session, vbd_uuid))
-        if vdi_uuid:
-            execute(server, 'VDI.destroy', (session, vdi_uuid))
-        
-        if vm_uuid:
-            try:
-                execute(server, 'VM.hard_shutdown', (session, vm_uuid))
-                time.sleep(2)
-            except:
-                pass
-                
-            execute(server, 'VM.destroy', (session, vm_uuid))
-
-
-if __name__ == "__main__":
-    test_vm_create()
-    
diff --git a/tools/python/scripts/xapi.domcfg.py b/tools/python/scripts/xapi.domcfg.py
deleted file mode 100644
index d7b8ae5..0000000
--- a/tools/python/scripts/xapi.domcfg.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# VM Configuration for Xen API
-#
-
-name_label =  'GentooAPI'
-name_description =  'Gentoo VM via API'
-user_version =  1
-is_a_template =  False
-memory_static_max =  32
-memory_dynamic_max =  32
-memory_dynamic_min =  32
-memory_static_min =  32
-VCPUs_policy =  ''
-VCPUs_params =  ''
-VCPUS_features_required =  ''
-VCPUs_features_can_use =  ''
-VCPUs_features_force_on =  ''
-VCPUs_features_force_off =  ''
-actions_after_shutdown =  'destroy'
-actions_after_reboot =  'restart'
-actions_after_suspend =  'destroy'
-actions_after_crash =  'restart'
-bios_boot =  ''
-platform_std_VGA =  False
-platform_serial =  ''
-platform_localtime =  False
-platform_clock_offset =  False
-platform_enable_audio =  False
-builder =  'linux'
-boot_method =  '' # this will remove the kernel/initrd ??
-kernel_kernel =  '/boot/vmlinuz-2.6.16.29-xen'
-kernel_initrd =  '/root/initrd-2.6.16.29-xen.img'
-kernel_args =  'root=/dev/sda1 ro'
-grub_cmdline =  ''
-PCI_bus =  ''
-other_config =  ''
-
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py
deleted file mode 100644
index 0997187..0000000
--- a/tools/python/scripts/xapi.py
+++ /dev/null
@@ -1,854 +0,0 @@
-#!/usr/bin/python
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2006 XenSource Ltd.
-#============================================================================
-
-import sys
-import time
-import re
-import os
-
-from xen.util.xmlrpclib2 import ServerProxy
-from optparse import *
-from pprint import pprint
-from types import DictType
-from getpass import getpass
-
-# Get default values from the environment
-SERVER_URI = os.environ.get('XAPI_SERVER_URI', 'http://localhost:9363/')
-SERVER_USER = os.environ.get('XAPI_SERVER_USER', '')
-SERVER_PASS = os.environ.get('XAPI_SERVER_PASS', '')
-
-MB = 1024 * 1024
-
-HOST_INFO_FORMAT = '%-20s: %-50s'
-VM_LIST_FORMAT = '%(name_label)-18s %(memory_actual)-5s %(VCPUs_number)-5s'\
-                 ' %(power_state)-10s %(uuid)-36s'
-SR_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(physical_size)-10s' \
-                 '%(type)-10s'
-VDI_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(virtual_size)-8s'
-VBD_LIST_FORMAT = '%(device)-6s %(uuid)-36s %(VDI)-8s'
-TASK_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(status)-8s %(progress)-4s'
-VIF_LIST_FORMAT = '%(name)-8s %(device)-7s %(uuid)-36s %(MAC)-10s'
-CONSOLE_LIST_FORMAT = '%(uuid)-36s %(protocol)-8s %(location)-32s'
-
-COMMANDS = {
-    'host-info': ('', 'Get Xen Host Info'),
-    'host-set-name': ('', 'Set host name'),
-    'pif-list': ('', 'List all PIFs'),
-    'sr-list':   ('', 'List all SRs'),
-    'vbd-list':  ('', 'List all VBDs'),
-    'vbd-create': ('<domname> <pycfg> [opts]',
-                   'Create VBD attached to domname'),
-    'vdi-create': ('<pycfg> [opts]', 'Create a VDI'),
-    'vdi-list'  : ('', 'List all VDI'),
-    'vdi-rename': ('<vdi_uuid> <new_name>', 'Rename VDI'),
-    'vdi-destroy': ('<vdi_uuid>', 'Delete VDI'),
-    'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
-
-    'vm-create': ('<pycfg>', 'Create VM with python config'),
-    'vm-destroy': ('<domname>', 'Delete VM'),
-    
-    'vm-list':   ('[--long]', 'List all domains.'),
-    'vm-name':   ('<uuid>', 'Name of UUID.'),
-    'vm-shutdown': ('<name> [opts]', 'Shutdown VM with name'),
-    'vm-start':  ('<name>', 'Start VM with name'),
-    'vm-uuid':   ('<name>', 'UUID of a domain by name.'),
-    'async-vm-start': ('<name>', 'Start VM asynchronously'),
-}
-
-OPTIONS = {
-    'sr-list': [(('-l', '--long'),
-                 {'action':'store_true',
-                  'help':'List all properties of SR'})
-               ],
-
-    'vdi-list': [(('-l', '--long'),
-                  {'action':'store_true',
-                   'help':'List all properties of VDI'})
-                 ],
-    'vif-list': [(('-l', '--long'),
-                  {'action':'store_true',
-                   'help':'List all properties of VIF'})
-                 ],            
-    'vm-list': [(('-l', '--long'),
-                 {'action':'store_true',
-                  'help':'List all properties of VMs'})
-               ],
-    'vm-shutdown': [(('-f', '--force'), {'help': 'Shutdown Forcefully',
-                                         'action': 'store_true'})],
-    
-    'vdi-create': [(('--name-label',), {'help': 'Name for VDI'}),
-                   (('--name-description',), {'help': 'Description for VDI'}),
-                   (('--virtual-size',), {'type': 'int',
-                                          'default': 0,
-                                          'help': 'Size of VDI in bytes'}),
-                   (('--type',), {'choices': ['system', 'user', 'ephemeral'],
-                                  'default': 'system',
-                                  'help': 'VDI type'}),
-                   (('--sharable',), {'action': 'store_true',
-                                      'help': 'VDI sharable'}),
-                   (('--read-only',), {'action': 'store_true',
-                                       'help': 'Read only'}),
-                   (('--sr',), {})],
-    
-    'vbd-create': [(('--VDI',), {'help': 'UUID of VDI to attach to.'}),
-                   (('--mode',), {'choices': ['RO', 'RW'],
-                                  'help': 'device mount mode'}),
-                   (('--driver',), {'choices':['paravirtualised', 'ioemu'],
-                                    'help': 'Driver for VBD'}),
-                   (('--device',), {'help': 'Device name on guest domain'})]
-                   
-}
-
-class OptionError(Exception):
-    pass
-
-class XenAPIError(Exception):
-    pass
-
-# 
-# Extra utility functions
-#
-
-class IterableValues(Values):
-    """Better interface to the list of values from optparse."""
-
-    def __iter__(self):
-        for opt, val in self.__dict__.items():
-            if opt[0] == '_' or callable(val):
-                continue
-            yield opt, val        
-
-
-def parse_args(cmd_name, args, set_defaults = False):
-    argstring, desc = COMMANDS[cmd_name]
-    parser = OptionParser(usage = 'xapi %s %s' % (cmd_name, argstring),
-                          description = desc)
-    if cmd_name in OPTIONS:
-        for optargs, optkwds in OPTIONS[cmd_name]:
-            parser.add_option(*optargs, **optkwds)
-
-    if set_defaults:
-        default_values = parser.get_default_values()
-        defaults = IterableValues(default_values.__dict__)
-    else:
-        defaults = IterableValues()
-    (opts, extraargs) = parser.parse_args(args = list(args),
-                                          values = defaults)
-    return opts, extraargs
-
-def execute(server, fn, args, async = False):
-    if async:
-        func = eval('server.Async.%s' % fn)
-    else:
-        func = eval('server.%s' % fn)
-        
-    result = func(*args)
-    if type(result) != DictType:
-        raise TypeError("Function returned object of type: %s" %
-                        str(type(result)))
-    if 'Value' not in result:
-        raise XenAPIError(*result['ErrorDescription'])
-    return result['Value']
-
-_initialised = False
-_server = None
-_session = None
-def connect(*args):
-    global _server, _session, _initialised
-    
-    if not _initialised:
-        # try without password or default credentials
-        try:
-            _server = ServerProxy(SERVER_URI)
-            _session = execute(_server.session, 'login_with_password',
-                               (SERVER_USER, SERVER_PASS))
-        except:
-            login = raw_input("Login: ")
-            password = getpass()
-            creds = (login, password)            
-            _server = ServerProxy(SERVER_URI)
-            _session = execute(_server.session, 'login_with_password',
-                               creds)
-
-        _initialised = True
-    return (_server, _session)
-
-def _stringify(adict):
-    return dict([(k, str(v)) for k, v in adict.items()])
-
-def _read_python_cfg(filename):
-    cfg = {}
-    execfile(filename, {}, cfg)
-    return cfg
-
-def resolve_vm(server, session, vm_name):
-    vm_uuid = execute(server, 'VM.get_by_name_label', (session, vm_name))
-    if not vm_uuid:
-        return None
-    else:
-        return vm_uuid[0]
-
-def resolve_vdi(server, session, vdi_name):
-    vdi_uuid = execute(server, 'VDI.get_by_name_label', (session, vdi_name))
-    if not vdi_uuid:
-        return None
-    else:
-        return vdi_uuid[0]
-
-#
-# Actual commands
-#
-
-def xapi_host_info(args, async = False):
-    server, session = connect()
-    hosts = execute(server, 'host.get_all', (session,))
-    for host in hosts: # there is only one, but ..
-        hostinfo = execute(server, 'host.get_record', (session, host))
-        print HOST_INFO_FORMAT % ('Name', hostinfo['name_label'])
-        print HOST_INFO_FORMAT % ('Version', hostinfo['software_version'])
-        print HOST_INFO_FORMAT % ('CPUs', len(hostinfo['host_CPUs']))
-        print HOST_INFO_FORMAT % ('VMs', len(hostinfo['resident_VMs']))
-        print HOST_INFO_FORMAT % ('UUID', host)        
-
-        for host_cpu_uuid in hostinfo['host_CPUs']:
-            host_cpu = execute(server, 'host_cpu.get_record',
-                               (session, host_cpu_uuid))
-            print 'CPU %s Util: %.2f' % (host_cpu['number'],
-                                         float(host_cpu['utilisation']))
-        
-def xapi_host_set_name(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No hostname specified")
-    
-    server, session = connect()
-    hosts = execute(server, 'host.get_all', (session,))
-    if len(hosts) > 0:
-        execute(server, 'host.set_name_label', (session, hosts[0], args[0]))
-        print 'Hostname: %s' % execute(server, 'host.get_name_label',
-                                       (session, hosts[0]))
-
-def xapi_vm_uuid(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No domain name specified")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print vm_uuid
-
-def xapi_vm_name(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No UUID specified")
-    
-    server, session = connect()
-    vm_name = execute(server, 'VM.get_name_label', (session, args[0]))
-    print vm_name
-
-def xapi_vm_list(args, async = False):
-    opts, args = parse_args('vm-list', args, set_defaults = True)
-    is_long = opts and opts.long
-
-    list_only = args
-    
-    server, session = connect()
-    vm_uuids = execute(server, 'VM.get_all', (session,))
-    if not is_long:
-        print VM_LIST_FORMAT % {'name_label':'Name',
-                                'memory_actual':'Mem',
-                                'VCPUs_number': 'VCPUs',
-                                'power_state': 'State',
-                                'uuid': 'UUID'}
-
-    for uuid in vm_uuids:
-        vm_info = execute(server, 'VM.get_record', (session, uuid))
-
-        # skip domain if we don't want
-        if list_only and vm_info['name_label'] not in list_only:
-            continue
-        
-        if is_long:
-            vbds = vm_info['VBDs']
-            vifs = vm_info['VIFs']
-            vif_infos = []
-            vbd_infos = []
-            for vbd in vbds:
-                vbd_info = execute(server, 'VBD.get_record', (session, vbd))
-                vbd_infos.append(vbd_info)
-            for vif in vifs:
-                vif_info = execute(server, 'VIF.get_record', (session, vif))
-                vif_infos.append(vif_info)
-            vm_info['VBDs'] = vbd_infos
-            vm_info['VIFs'] = vif_infos
-            pprint(vm_info)
-        else:
-            print VM_LIST_FORMAT % _stringify(vm_info)
-
-def xapi_vm_create(args, async = False):
-    if len(args) < 1:
-        raise OptionError("Configuration file not specified")
-
-    filename = args[0]
-    cfg = _read_python_cfg(filename)
-
-    print 'Creating VM from %s ..' % filename
-    server, session = connect()
-    uuid = execute(server, 'VM.create', (session, cfg), async = async)
-    print 'Done. (%s)' % uuid
-    print uuid
-
-def xapi_vm_destroy(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])    
-    print 'Destroying VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.destroy', (session, vm_uuid), async = async)
-    print 'Done.'
-    
-
-def xapi_vm_start(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Starting VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.start', (session, vm_uuid, False), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vm_suspend(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Suspending VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.suspend', (session, vm_uuid), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'        
-
-
-def xapi_vm_resume(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Resuming VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.resume', (session, vm_uuid, False), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vm_pause(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Pausing VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.pause', (session, vm_uuid), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vm_unpause(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Pausing VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.unpause', (session, vm_uuid), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'                        
-
-def xapi_task_list(args, async = False):
-    server, session = connect()
-    all_tasks = execute(server, 'task.get_all', (session,))
-
-    print TASK_LIST_FORMAT % {'name_label': 'Task Name',
-                              'uuid': 'UUID',
-                              'status': 'Status',
-                              'progress': '%'}
-    
-    for task_uuid in all_tasks:
-        task = execute(server, 'task.get_record', (session, task_uuid))
-        print TASK_LIST_FORMAT % task
-
-def xapi_task_clear(args, async = False):
-    server, session = connect()
-    all_tasks = execute(server, 'task.get_all', (session,))
-    for task_uuid in all_tasks:
-        success = execute(server, 'task.destroy', (session, task_uuid))
-        print 'Destroyed Task %s' % task_uuid
-
-def xapi_vm_shutdown(args, async = False):
-    opts, args = parse_args("vm-shutdown", args, set_defaults = True)
-    
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    if opts.force:
-        print 'Forcefully shutting down VM %s (%s)' % (args[0], vm_uuid)
-        success = execute(server, 'VM.hard_shutdown', (session, vm_uuid), async = async)
-    else:
-        print 'Shutting down VM %s (%s)' % (args[0], vm_uuid)
-        success = execute(server, 'VM.clean_shutdown', (session, vm_uuid), async = async)
-
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vbd_create(args, async = False):
-    opts, args = parse_args('vbd-create', args)
-
-    if len(args) < 2:
-        raise OptionError("Configuration file and domain not specified")
-
-    domname = args[0]
-
-    if len(args) > 1:
-        filename = args[1]
-        cfg = _read_python_cfg(filename)
-    else:
-        cfg = {}
-        
-    for opt, val in opts:
-        cfg[opt] = val
-    
-    print 'Creating VBD ...',
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, domname)
-    cfg['VM'] = vm_uuid
-    vbd_uuid = execute(server, 'VBD.create', (session, cfg), async = async)
-    if async:
-        print 'Task started: %s' % vbd_uuid
-    else:
-        print 'Done. (%s)' % vbd_uuid
-
-def xapi_vif_create(args, async = False):
-    if len(args) < 2:
-        raise OptionError("Configuration file not specified")
-
-    domname = args[0]
-    filename = args[1]
-    cfg = _read_python_cfg(filename)
-    
-    print 'Creating VIF from %s ..' % filename
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, domname)
-    cfg['VM'] = vm_uuid
-    vif_uuid = execute(server, 'VIF.create', (session, cfg), async = async)
-    if async:
-        print 'Task started: %s' % vif_uuid
-    else:
-        print 'Done. (%s)' % vif_uuid
-
-def xapi_vbd_list(args, async = False):
-    server, session = connect()
-    domname = args[0]
-    
-    dom_uuid = resolve_vm(server, session, domname)
-    vbds = execute(server, 'VM.get_VBDs', (session, dom_uuid))
-    
-    print VBD_LIST_FORMAT % {'device': 'Device',
-                             'uuid' : 'UUID',
-                             'VDI': 'VDI'}
-    
-    for vbd in vbds:
-        vbd_struct = execute(server, 'VBD.get_record', (session, vbd))
-        print VBD_LIST_FORMAT % vbd_struct
-        
-        
-def xapi_vbd_stats(args, async = False):
-    server, session = connect()
-    domname = args[0]
-    dom_uuid = resolve_vm(server, session, domname)
-
-    vbds = execute(server, 'VM.get_VBDs', (session, dom_uuid))
-    for vbd_uuid in vbds:
-        print execute(server, 'VBD.get_io_read_kbs', (session, vbd_uuid))
- 
-def xapi_vif_list(args, async = False):
-    server, session = connect()
-    opts, args = parse_args('vdi-list', args, set_defaults = True)
-    is_long = opts and opts.long
-    
-    domname = args[0]
-    
-    dom_uuid = resolve_vm(server, session, domname)
-    vifs = execute(server, 'VM.get_VIFs', (session, dom_uuid))
-
-    if not is_long:
-        print VIF_LIST_FORMAT % {'name': 'Name',
-                                 'device': 'Device',
-                                 'uuid' : 'UUID',
-                                 'MAC': 'MAC'}
-        
-        for vif in vifs:
-            vif_struct = execute(server, 'VIF.get_record', (session, vif))
-            print VIF_LIST_FORMAT % vif_struct
-    else:
-        for vif in vifs:
-            vif_struct = execute(server, 'VIF.get_record', (session, vif))
-            pprint(vif_struct)
-
-def xapi_console_list(args, async = False):
-    server, session = connect()
-    opts, args = parse_args('vdi-list', args, set_defaults = True)
-    is_long = opts and opts.long
-    
-    domname = args[0]
-    
-    dom_uuid = resolve_vm(server, session, domname)
-    consoles = execute(server, 'VM.get_consoles', (session, dom_uuid))
-
-    if not is_long:
-        print CONSOLE_LIST_FORMAT % {'protocol': 'Protocol',
-                                     'location': 'Location',
-                                     'uuid': 'UUID'}
-
-        for console in consoles:
-            console_struct = execute(server, 'console.get_record',
-                                     (session, console))
-            print CONSOLE_LIST_FORMAT % console_struct
-    else:
-        for console in consoles:
-            console_struct = execute(server, 'console.get_record',
-                                     (session, console))
-            pprint(console_struct)            
-
-
-def xapi_vdi_list(args, async = False):
-    opts, args = parse_args('vdi-list', args, set_defaults = True)
-    is_long = opts and opts.long
-
-    server, session = connect()
-    vdis = execute(server, 'VDI.get_all', (session,))
-
-    if not is_long:
-        print VDI_LIST_FORMAT % {'name_label': 'VDI Label',
-                                 'uuid' : 'UUID',
-                                 'virtual_size': 'Bytes'}
-        
-        for vdi in vdis:
-            vdi_struct = execute(server, 'VDI.get_record', (session, vdi))
-            print VDI_LIST_FORMAT % vdi_struct
-
-    else:
-        for vdi in vdis:
-            vdi_struct = execute(server, 'VDI.get_record', (session, vdi))
-            pprint(vdi_struct)
-
-def xapi_sr_list(args, async = False):
-    opts, args = parse_args('sr-list', args, set_defaults = True)
-    is_long = opts and opts.long
-    
-    server, session = connect()
-    srs = execute(server, 'SR.get_all', (session,))
-    if not is_long:
-        print SR_LIST_FORMAT % {'name_label': 'SR Label',
-                                'uuid' : 'UUID',
-                                'physical_size': 'Size (MB)',
-                                'type': 'Type'}
-        
-        for sr in srs:
-            sr_struct = execute(server, 'SR.get_record', (session, sr))
-            sr_struct['physical_size'] = int(sr_struct['physical_size'])/MB
-            print SR_LIST_FORMAT % sr_struct
-    else:
-        for sr in srs:
-            sr_struct = execute(server, 'SR.get_record', (session, sr))  
-            pprint(sr_struct)
-
-def xapi_sr_rename(args, async = False):
-    server, session = connect()
-    sr = execute(server, 'SR.get_by_name_label', (session, args[0]))
-    execute(server, 'SR.set_name_label', (session, sr[0], args[1]))
-
-def xapi_vdi_create(args, async = False):
-    opts, args = parse_args('vdi-create', args)
-
-    if len(args) > 0:
-        cfg = _read_python_cfg(args[0])
-    else:
-        cfg = {}
-        
-    for opt, val in opts:
-        cfg[opt] = val
-
-    server, session = connect()
-    srs = []
-    if cfg.get('SR'):    
-        srs = execute(server, 'SR.get_by_name_label', (session, cfg['SR']))
-    else:
-        srs = execute(server, 'SR.get_all', (session,))
-
-    sr = srs[0]
-    cfg['SR'] = sr
-
-    size = cfg['virtual_size']/MB
-    print 'Creating VDI of size: %dMB ..' % size,
-    uuid = execute(server, 'VDI.create', (session, cfg), async = async)
-    if async:
-        print 'Task started: %s' % uuid
-    else:
-        print 'Done. (%s)' % uuid
-    
-
-def xapi_vdi_destroy(args, async = False):
-    server, session = connect()
-    if len(args) < 1:
-        raise OptionError('Not enough arguments')
-
-    vdi_uuid = args[0]
-    print 'Deleting VDI %s' % vdi_uuid
-    result = execute(server, 'VDI.destroy', (session, vdi_uuid), async = async)
-    if async:
-        print 'Task started: %s' % result
-    else:
-        print 'Done.'
-
-def xapi_vdi_rename(args, async = False):
-    server, session = connect()
-    if len(args) < 2:
-        raise OptionError('Not enough arguments')
-
-    vdi_uuid = execute(server, 'VDI.get_by_name_label', session, args[0])
-    vdi_name = args[1]
-    
-    print 'Renaming VDI %s to %s' % (vdi_uuid[0], vdi_name)
-    result = execute(server, 'VDI.set_name_label',
-                     (session, vdi_uuid[0], vdi_name), async = async)
-    if async:
-        print 'Task started: %s' % result
-    else:
-        print 'Done.'
-
-
-def xapi_pif_list(args, async = False):
-    server, session = connect()
-    pif_uuids = execute(server, 'PIF.get_all', (session,))
-    for pif_uuid in pif_uuids:
-        pif = execute(server, 'PIF.get_record', (session, pif_uuid))
-        print pif
-
-
-def xapi_debug_wait(args, async = False):
-    secs = 10
-    if len(args) > 0:
-        secs = int(args[0])
-    server, session = connect()
-    task_uuid = execute(server, 'debug.wait', (session, secs), async=async)
-    print 'Task UUID: %s' % task_uuid
-
-def xapi_vm_stat(args, async = False):
-    domname = args[0]
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, domname)
-    vif_uuids = execute(server, 'VM.get_VIFs', (session, vm_uuid))
-    vbd_uuids = execute(server, 'VM.get_VBDs', (session, vm_uuid))
-    vcpus_utils = execute(server, 'VM.get_VCPUs_utilisation',
-                          (session, vm_uuid))
-
-    for vcpu_num in sorted(vcpus_utils.keys()):
-        print 'CPU %s : %5.2f%%' % (vcpu_num, vcpus_utils[vcpu_num] * 100)
-        
-    for vif_uuid in vif_uuids:
-        vif = execute(server, 'VIF.get_record', (session, vif_uuid))
-        print '%(device)s: rx: %(io_read_kbs)10.2f tx: %(io_write_kbs)10.2f' \
-              % vif
-    for vbd_uuid in vbd_uuids:
-        vbd = execute(server, 'VBD.get_record', (session, vbd_uuid))
-        print '%(device)s: rd: %(io_read_kbs)10.2f wr: %(io_write_kbs)10.2f' \
-              % vbd
-        
-#
-# Command Line Utils
-#
-import cmd
-import shlex
-
-class XenAPICmd(cmd.Cmd):
-    def __init__(self, server, session):
-        cmd.Cmd.__init__(self)
-        self.server = server
-        self.session = session
-        self.prompt = ">>> "
-
-    def default(self, line):
-        words = shlex.split(line)
-        if len(words) > 0:
-            cmd_name = words[0].replace('-', '_')
-            is_async = 'async' in cmd_name
-            if is_async:
-                cmd_name = re.sub('async_', '', cmd_name)
-                
-            func_name = 'xapi_%s' % cmd_name
-            func = globals().get(func_name)
-            
-            if func:
-                try:
-                    args = tuple(words[1:])
-                    func(args, async = is_async)
-                    return True
-                except SystemExit:
-                    return False
-                except OptionError, e:
-                    print 'Error:', str(e)
-                    return False
-                except Exception, e:
-                    import traceback
-                    traceback.print_exc()
-                    return False
-        print '*** Unknown command: %s' % words[0]
-        return False
-
-    def do_EOF(self, line):
-        print
-        sys.exit(0)
-
-    def do_help(self, line):
-        usage(print_usage = False)
-
-    def emptyline(self):
-        pass
-
-    def postcmd(self, stop, line):
-        return False
-
-    def precmd(self, line):
-        words = shlex.split(line)
-        if len(words) > 0:
-            words0 = words[0].replace('-', '_')
-            return ' '.join([words0] + words[1:])
-        else:
-            return line
-
-def shell():
-    server, session = connect()
-    x = XenAPICmd(server, session)
-    x.cmdloop('Xen API Prompt. Type "help" for a list of functions')
-
-def usage(command = None, print_usage = True):
-    if not command:
-        if print_usage:
-            print 'Usage: xapi <subcommand> [options] [args]'
-            print
-            print 'Subcommands:'
-            print
-
-        for func in sorted(globals().keys()):
-            if func.startswith('xapi_'):
-                command = func[5:].replace('_', '-')
-                args, description = COMMANDS.get(command, ('', ''))
-                print '%-16s  %-40s' % (command, description)
-        print
-    else:
-        parse_args(command, ['-h'])
-
-def main(args):
-    
-    # poor man's optparse that doesn't abort on unrecognised opts
-
-    options = {}
-    remaining = []
-    
-    arg_n = 0
-    while args:
-        arg = args.pop(0)
-        
-        if arg in ('--help', '-h'):
-            options['help'] = True
-        elif arg in ('--server', '-s') and args:
-            options['server'] = args.pop(0)
-        elif arg in ('--user', '-u') and args:
-            options['user'] = args.pop(0)
-        elif arg in ('--password', '-p') and args:
-            options['password'] = args.pop(0)
-        else:
-            remaining.append(arg)
-
-    # abort here if these conditions are true
-
-    if options.get('help') and not remaining:
-        usage()
-        sys.exit(1)
-
-    if options.get('help') and remaining:
-        usage(remaining[0])
-        sys.exit(1)
-
-    if not remaining:
-        usage()
-        sys.exit(1)
-
-    if options.get('server'):
-        # it is ugly to use a global, but it is simple
-        global SERVER_URI
-        SERVER_URI = options['server']
-
-    if options.get('user'):
-        global SERVER_USER
-        SERVER_USER = options['user']
-
-    if options.get('password'):
-        global SERVER_PASS
-        SERVER_PASS = options['password']
-
-    subcmd = remaining[0].replace('-', '_')
-    is_async = 'async' in subcmd
-    if is_async:
-        subcmd = re.sub('async_', '', subcmd)
-    subcmd_func_name = 'xapi_' + subcmd
-    subcmd_func = globals().get(subcmd_func_name, None)
-
-    if subcmd == 'shell':
-        shell()
-    elif not subcmd_func or not callable(subcmd_func):
-        print 'Error: Unable to find subcommand \'%s\'' % subcmd
-        usage()
-        sys.exit(1)
-
-    try:
-        subcmd_func(remaining[1:], async = is_async)
-    except XenAPIError, e:
-        print 'Error: %s' % str(e.args[0])
-        sys.exit(2)
-    except OptionError, e:
-        print 'Error: %s' % e
-
-    sys.exit(0)
-    
-if __name__ == "__main__":
-    import sys
-    main(sys.argv[1:])
diff --git a/tools/python/scripts/xapi.vbdcfg.py b/tools/python/scripts/xapi.vbdcfg.py
deleted file mode 100644
index 82dcaf8..0000000
--- a/tools/python/scripts/xapi.vbdcfg.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Virtual Block Device (VBD) Xen API Configuration
-# 
-# Note: There is a non-API field here called "image" which is a backwards
-#       compat addition so you can mount to old images.
-# 
-
-VDI =  ''
-device = 'sda1'
-mode = 'RW'
-driver = 'paravirtualised'
-image = 'file:/root/gentoo.amd64.img'
diff --git a/tools/python/scripts/xapi.vdicfg.py b/tools/python/scripts/xapi.vdicfg.py
deleted file mode 100644
index cb63653..0000000
--- a/tools/python/scripts/xapi.vdicfg.py
+++ /dev/null
@@ -1,6 +0,0 @@
-name_label = 'VDI 1'
-name_description = ''
-virtual_size = 10 * 1024 * 1024 * 1024
-type = 'system'
-sharable = False
-read_only = False
diff --git a/tools/python/scripts/xapi.vifcfg.py b/tools/python/scripts/xapi.vifcfg.py
deleted file mode 100644
index f421224..0000000
--- a/tools/python/scripts/xapi.vifcfg.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Virtual Network Interface Configuration for the Xen API
-#
-
-name = ''
-type = 'paravirtualised'
-#device = 'eth0' # this is the dom0 device, not domU!
-network = '' # ignored
-MAC = ''
-MTU = '1500'
diff --git a/tools/python/scripts/xapi.vtpmcfg.py b/tools/python/scripts/xapi.vtpmcfg.py
deleted file mode 100644
index 7c419ba..0000000
--- a/tools/python/scripts/xapi.vtpmcfg.py
+++ /dev/null
@@ -1,3 +0,0 @@
-type = 'paravirtualised'
-backend = 'Domain-0'
-instance = 1
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHE-0007CL-OO; Sun, 22 Jun 2014 18:14:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHC-0007CB-HL
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:03 +0000
Received: from [85.158.143.35:46762] by server-1.bemta-4.messagelabs.com id
	89/18-09496-9EC17A35; Sun, 22 Jun 2014 18:14:01 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403460838!13027633!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3998 invoked from network); 22 Jun 2014 18:13:58 -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;
	22 Jun 2014 18:13:58 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymH7-0000Ez-RA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymH7-0007iU-Om
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:13:57 +0000
Date: Sun, 22 Jun 2014 18:13:57 +0000
Message-Id: <E1WymH7-0007iU-Om@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/python: Remove some legacy
	scripts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 1747fc59d66157dff33476fe252c08fbba1d7cfa
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 17 18:26:18 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:03:54 2014 +0100

    tools/python: Remove some legacy scripts
    
    Nothing in scripts/ is referenced by the current Xen build system.  It is a
    legacy version of the XenAPI bindings, other parts of which have already been
    removed from the tree.
    
    Additionally, prevent the install target from creating an $(SBINDIR) directory
    but putting nothing in it.  This appears to be something missed when removing
    Xend.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/python/Makefile                   |    2 -
 tools/python/README.XendConfig          |  160 ------
 tools/python/README.sxpcfg              |  114 ----
 tools/python/scripts/README             |   49 --
 tools/python/scripts/README.lifecycle   |  136 -----
 tools/python/scripts/test_hvm_create.py |  178 -------
 tools/python/scripts/test_vm_create.py  |  211 --------
 tools/python/scripts/xapi.domcfg.py     |   37 --
 tools/python/scripts/xapi.py            |  854 -------------------------------
 tools/python/scripts/xapi.vbdcfg.py     |   12 -
 tools/python/scripts/xapi.vdicfg.py     |    6 -
 tools/python/scripts/xapi.vifcfg.py     |   10 -
 tools/python/scripts/xapi.vtpmcfg.py    |    3 -
 13 files changed, 0 insertions(+), 1772 deletions(-)

diff --git a/tools/python/Makefile b/tools/python/Makefile
index c433cbe..eee746d 100644
--- a/tools/python/Makefile
+++ b/tools/python/Makefile
@@ -23,8 +23,6 @@ install:
 	CC="$(CC)" CFLAGS="$(CFLAGS) $(APPEND_LDFLAGS)" $(PYTHON) setup.py install \
 		$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
 
-	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
-
 .PHONY: test
 test:
 	export LD_LIBRARY_PATH=$$(readlink -f ../libxc):$$(readlink -f ../xenstore); $(PYTHON) test.py -b -u
diff --git a/tools/python/README.XendConfig b/tools/python/README.XendConfig
deleted file mode 100644
index 338715b..0000000
--- a/tools/python/README.XendConfig
+++ /dev/null
@@ -1,160 +0,0 @@
-XendConfig parameters
-=====================
-
-Things that are empty means there is no direct mapping.
-
-In order to make the XendConfig fully backwards compatible, it needs a
-representation of all the below parameters. Where both columns have
-values, it means we can have a direct translation.
-
-Where the Legacy Config value does not exist, it means we have to make
-up the value on whether we supported it or not.
-
-Where the Legacy config value is prefixed with an '!', it means it is
-not a direct mapping and needs a translation function.
-
-Where the Xen API config value does not exist, it means we have to add
-a parameter outside of the Xen API Configuration to support it.
-
-
-Xen API Config                  Legacy Config
---------------                  -------------
-uuid                            uuid
-power_state                     !state (and xc_getinfo)
-name_label                      name
-name_description
-user_version
-is_a_template
-auto_power_on
-resident_on
-memory_static_min               memory
-memory_static_max               maxmem
-memory_actual
-memory_dynamic_min
-memory_dynamic_max
-vcpus_policy                    !set_credit/set_sedf
-vcpus_params                    !set_credit/set_sedf
-vcpus_number                    vcpus
-vcpus_utilisation               
-vcpus_features_required
-vcpus_features_can_use
-vcpus_features_force_on
-vcpus_features_force_off
-actions_after_shutdown          on_poweroff
-actions_after_reboot            on_reboot
-actions_after_suspend           
-actions_after_crash             on_crash
-
-vifs                            !(devices.vifs)
- - uuid                         dev.uuid
- - name
- - type                         vif.type
- - device
- - network
- - vm
- - MAC                          vif.mac
- - MTU
- - io_read_kbs                  !vif.rate
- - io_write_kbs                 !vif.rate
-                                vif.bridge
-                                vif.script
-                                vif.ip
-                                vif.vifname (backend name)
-
-vbds                            !(devices.vbds)
- - uuid
- - vm
- - vdi
- - device                       vbd.uname
- - mode                         !vbd.mode
- - driver                       vbd.driver
- - io_read_kbs
- - io_write_kbs
-
-bios_boot                       image.boot?
-platform_std_VGA                image.stdvga
-platform_serial                 image.serial
-platform_localtime              !localtime (bool)
-platform_clock_offset           
-platform_enable_audio           !image.soundhw (bool)
-builder                         (sxp root name)
-boot_method                     
-kernel_kernel                   kernel.kernel
-kernel_initrd                   kernel.ramdisk
-kernel_args                     !kernel.args
-grub_cmdline                    bootloader_args
-PCI_bus                         
-tools_version
-
-otherConfig
- - image                        image (see image.*)
- - shadow_memory                shadow_memory
- - security                     security
- - vcpu_avail                   vcpu_avail
- - features                     features
- - on_xend_stop                 on_xend_stop
- - on_xend_start                on_xend_start
- - start_time                   start_time
- - cpus                         cpus (?)
-                                max_vcpu_id
-
- >> only from xc
- - online_vcpus                 xc.online_vcpus
- - status                       xc.status
- - cpu_time                     xc.cpu_time
- - shutdown_reason              xc.shutdown_reason
- - up_time                      xc.uptime
- - crashed                      xc.crashed
- - dying                        xc.dying
- - shutdown                     xc.shutdown
-
-                                image.type (linux or hvm)
-                                image.root
-                                image.ip
-                                image.nographic
-                                image.vnc
-                                image.sdl
-                                image.monitor
-                                image.vncdisplay
-                                image.vncunused
-                                image.hvm.device_model
-                                image.hvm.display
-                                image.hvm.xauthority
-                                image.hvm.vncconsole
-                                image.hvm.pae
-                                image.hvm.acpi (also in image.devices)
-                                image.hvm.apic
-                                image.hvm.devices.boot
-                                image.hvm.devices.fda
-                                image.hvm.devices.fdb
-                                image.hvm.devices.soundhw
-                                image.hvm.devices.isa
-                                image.hvm.devices.vcpus?
-                                image.hvm.devices.acpi
-                                image.hvm.devices.usb
-                                image.hvm.devices.usbdevice
-
-
-                                dev.backend
-                                dev.dom
-                                dev.id
-                                
-                                pci.domain
-                                pci.bus
-                                pci.slot
-                                pci.func
-
-                                pciquirk.pci_ids
-                                pciquirk.pci_config_space_fields
-                                pciquirk.unconstrained_dev_ids
-
-                                irq.irq
-
-- vcpu (probably not needed, only in XM and generated dynamically)
-                                vcpu.number
-                                vcpu.online
-                                vcpu.blocked
-                                vcpu.running
-                                vcpu.cpu_time
-                                vcpu.cpu
-                                vcpu.cpumap
diff --git a/tools/python/README.sxpcfg b/tools/python/README.sxpcfg
deleted file mode 100644
index a4762fe..0000000
--- a/tools/python/README.sxpcfg
+++ /dev/null
@@ -1,114 +0,0 @@
-Map of all supported SXP configuration options
-----------------------------------------------
-
-uuid
-vcpus
-maxmem
-memory
-name
-on_poweroff
-on_reboot
-on_crash
-bootloader
-kernel_kernel
-kernel_initrd
-kernel_args
-localtime
-
-shadow_memory
-security
-ssidref (deprecated)
-vcpu_avail
-cpu_weight (deprecated)
-bootloader_args
-features
-on_xend_stop
-on_xend_start
-start_time
-cpu (deprecated)
-cpus
-
-(xc getinfo)
-domid
-online_vcpus
-status
-cpu_time
-shutdown_reason
-(xm list --long)
-up_time
-
-image 
-  - kernel
-  - ramdisk
-  - args
-  - ip
-  - root
-  (configVNC)
-  - nographic
-  - vnc
-  - sdl
-  - vncdisplay
-  - vncunused
-  (HVM)
-  - device_model
-  - display
-  - xauthority
-  - vncconsole
-  - pae
-  - acpi
-  - apic
-  (parseDeviceModel)
-  - boot
-  - fda
-  - fdb
-  - soundhw
-  - localtime
-  - monitor
-  - serial
-  - stdvga
-  - isa
-  - vcpus
-  - acpi
-  - usb
-  - usbdevice
-
-(all devices)
-  - backend
-  - dom
-  - id
-  - uuid
-
-vbd
-  - uname
-  - dev (ioemu:, .. etc)
-  - mode (r, w. w!)
-
-vif
-  - type
-  - mac
-  - bridge
-  - model
-  - rate
-  - vifname
-  - script
-  - ip
-
-pci
-  - domain
-  - bus
-  - slot
-  - func
-  (Xen 2.0)
-  - dev
-
-io
-  - from
-  - to
-
-pciquirk
-  - pci_ids
-  - pci_config_space_fields
-  - unconstrained_dev_ids
-
-irq
-  - irq
diff --git a/tools/python/scripts/README b/tools/python/scripts/README
deleted file mode 100644
index a5d8759..0000000
--- a/tools/python/scripts/README
+++ /dev/null
@@ -1,49 +0,0 @@
-Xen API Test
-============
-
-xapi.py is a simple command line tool to test the functionality of a
-domain lifecycle supporting, Xen API talking version of Xend.
-
-Creating a VM is slightly more work under the Xen API. The differences
-with this and xm is:
-
-1. None of the devices are created during vm-create. You must use
-   vbd-create and vif-create to attach a new device to the VM.
-
-2. VM's that are created using vm-create will not start by
-   default. You must use vm-start to "start" the domain.
-
-3. VM's that are created using vm-create will not be removed on
-   shutdown. You must remove it using vm-delete.
-
-Example Configuration Files
----------------------------
-
-xapi.py uses a simple python configuration file similar to xm in the
-face of the lack of any other reasonable format.
-
-All the fields are directly mapped to the arguments that are in the
-Xen API constructore for the respective classes.
-
-xapi.domcfg.py: example configuration for a paravirtualised domain.
-xapi.vbdcfg.py: example configuration for a file based block device.
-xapi.vifcfg.py: example configuration for a simple bridged network
-                device.
-
-Example Session
----------------
-
-xapi.py vm-list
-xapi.py vm-create xapi.domcfg.py
-xapi.py vbd-create <DomainName> xapi.vbdcfg.py
-xapi.py vif-create <DomainName> xapi.vifcfg.py
-
-Notes
------
-
-Currently lacking:
-
-1. Any real authentication. XendAuthSessions need to be filled in with
-   a proper authentication implementation either using PAM or other
-   means.
-
diff --git a/tools/python/scripts/README.lifecycle b/tools/python/scripts/README.lifecycle
deleted file mode 100644
index 1e24cc0..0000000
--- a/tools/python/scripts/README.lifecycle
+++ /dev/null
@@ -1,136 +0,0 @@
-Xend Lifecycle/XenAPI Implementation Changes
-============================================
-
-Summary of what has changed in this branch of Xend:
-
-Managed Domains
----------------
-
-The concept of managed domains is that Xend now has the ability to
-manage the lifecycle of a domain from when it is created to being
-shutdown. 
-
-XendDomain
-~~~~~~~~~~
-
-In order to support managed domains, XendDomain has been modified to
-keep the configuration in /var/lib/xend/domains/.
-
-The configuration is stored in SXP format so that it can be easily
-loaded by the current Xend. In the future, we may switch to an XML
-format similar to how XenAPI defines a VM configuration.
-
-TODO: There are still places where the device configuration or VM
-configuration can be altered but the managed domain does not save it.
-
-XendDomainInfo
-~~~~~~~~~~~~~~
-
-XendDomainInfo has changed to support this mode of operation,
-especially with domain construction and assumptions about the domain
-when it shuts down.
-
-All configuration option parsing and validation has been moved from
-XendDomainInfo to XendConfig. The purpose is so that we can abstract
-away the knowledge of SXP in XendDomainInfo. The goal is to do away
-with the bulky way of accessing SXP in Xend and moving that all to a
-more pythonic interface.
-
-The DevController stuff at the end of XendDomainInfo has also been
-moved to XendDevices because now it is needed in both XendConfig and
-XendDomainInfo.
-
-Many of the constants are moved to XendConstants which reduces the
-amount of recursive or scoped imports that occur in the code.
-
-XendConfig
-~~~~~~~~~~
-
-XendConfig is the beginnings of an interface for configuration options
-so that other parts of Xend do not need to know what format the
-configuration in. It can accept configuration passed in as parsed SXP
-format, python filename or a Xen API struct.
-
-It is a subclass of a python dictionary, and hence access to its
-functions are via the __getitem__ accessor. 
-
-TODO: Define a proper interface to the XendConfig which is based on
-either the Xen API or some other flexible format.
-
-XMLRPCServer
-~~~~~~~~~~~~
-
-Changes to the busy loop in here and SrvServer so that the daemon
-shuts down cleanly. This also allows us to catch the shutdown and
-perform maintanence tasks on the domains. 
-
-Replacing xendomains init.d script 
-==================================
-
-Some work has gone into catching Xend's shutdown so that we can do the
-same tasks that xendomains init.d script does but natively in Xend.
-
-For instance, a new configuration option, 'on_xend_start' and
-'on_xend_stop' will allow domains that are managed by Xend to start up
-when Xend starts, and correspondingly stop when Xend stops.
-
-Xen API
-=======
-
-The new Xen API gives a standard interface to creating, configuring,
-controlling and destroying VMs and the virtual devices that belong to
-it.
-
-It also introduces the concept of Storage Repositories (SR) which are
-factories for creating disk images.
-
-XendDomain
-~~~~~~~~~~
-
-XendDomain has now separated the section for the Legacy XM XMLRPC API
-and the new Xen API.
-
-Since many things have a UUID, these are stored and represented as
-close to the existing configuration. 
-
-XendDomainInfo
-~~~~~~~~~~~~~~
-
-XendDomainInfo now supports UUIDs being assigned to devices and the
-domain itself. It will preserve the UUID for managed domains.
-
-A number of new functions are now in XendDomainInfo to provide an
-interface to devices.
-
-XendNode
-~~~~~~~~
-
-Represents the Host class in the Xen API and also contains an
-incomplete representation of the physical CPUs availabel for the host.
-
-XendAuthSessions
-~~~~~~~~~~~~~~~~
-
-An abstract authenticator for the Xen API. Currently it is an empty
-implementation with rudimentary support for users. The plan is the add
-PAM based authentication.
-
-XendAPI
-~~~~~~~
-
-The guts of the Xen API implementation. Implements all the supported
-functionality of the Xen API by placing calls to the relevent objects
-like XendDomain and XendDomanInfo.
-
-The initialisation of the XendAPI object will actually install a
-number of validation decorators in order to ensure the input is
-correct. It is using some features of introspection and
-metaprogramming in Python to reduce the amount of replication in the
-code.
-
-XMLRPCServer
-~~~~~~~~~~~~
-
-The XMLRPC Server will support both the new Xen API and the old XM
-XMLRPC API. The support is clearly marked in the code.
-
diff --git a/tools/python/scripts/test_hvm_create.py b/tools/python/scripts/test_hvm_create.py
deleted file mode 100644
index 5020363..0000000
--- a/tools/python/scripts/test_hvm_create.py
+++ /dev/null
@@ -1,178 +0,0 @@
-#!/usr/bin/python
-
-vm_cfg = {
-    'name_label': 'API_HVM',
-    'user_version': 1,
-    'is_a_template': False,
-    'auto_power_on': False, # TODO
-
-    'memory_static_min': 64,    
-    'memory_static_max': 128,
-    #'memory_dynamic_min': 64,
-    #'memory_dynamic_max': 128,
-    
-    
-    'VCPUs_policy': 'credit',
-    'VCPUs_params': {},
-    'VCPUs_number': 2,
-
-    'actions_after_shutdown': 'destroy',
-    'actions_after_reboot': 'restart',
-    'actions_after_crash': 'destroy',
-    
-    'PV_bootloader': '',
-    'PV_bootloader_args': '',
-    
-    'PV_kernel': '',
-    'PV_ramdisk': '',
-    'PV_args': '',
-
-    'HVM_boot': 'cda',
-    'platform_std_VGA': False,
-    'platform_serial': '',
-    'platform_localtime': False,
-    'platform_clock_offset': False,
-    'platform_enable_audio': False,
-    'PCI_bus': ''
-}
-
-local_vdi_cfg = {
-    'name_label': 'gentoo.hvm',
-    'name_description': '',
-    'virtual_size': 0,
-    'type': 'system',
-    'parent': '',
-    'SR_name': 'Local',
-    'sharable': False,
-    'read_only': False,
-    'other_config': {'location': 'file:/root/gentoo.amd64.hvm.img'},
-}    
-
-local_vbd_cfg = {
-    'VDI': '',
-    'VM': '',
-    'device': 'hda',
-    'mode': 'RW',
-    'type': 'disk',
-    'driver': 'ioemu',
-}
-
-vif_cfg = {
-    'name': 'API_VIF',
-    'type': 'ioemu',
-    'device': '',
-    'network': '',
-    'MAC': '',
-    'MTU': 1500,
-}    
-
-console_cfg = {
-    'protocol': 'rfb',
-    'other_config': {'vncunused': 1, 'vncpasswd': 'testing'},
-}
-
-
-import sys
-import time
-
-from xapi import connect, execute
-
-def test_vm_create():
-    server, session = connect()
-    vm_uuid = None
-    local_vdi_uuid = None
-    local_vbd_uuid = None
-    vif_uuid = None
-    
-    # List all VMs
-    vm_list = execute(server, 'VM.get_all', (session,))
-    vm_names = []
-    for vm_uuid in vm_list:
-        vm_record = execute(server, 'VM.get_record', (session, vm_uuid))
-        vm_names.append(vm_record['name_label'])
-
-    # Get default SR
-    local_sr_list = execute(server, 'SR.get_by_name_label',
-                            (session, local_vdi_cfg['SR_name']))
-    local_sr_uuid = local_sr_list[0]
-
-    # Get default network
-    net_list = execute(server, 'network.get_all', (session,))
-    net_uuid = net_list[0]
-
-    try:
-        # Create a new VM
-        print 'Create VM'
-        vm_uuid = execute(server, 'VM.create', (session, vm_cfg))
-
-        print 'Create VDI'
-        # Create a new VDI (Local)
-        local_vdi_cfg['SR'] = local_sr_uuid
-        local_vdi_uuid = execute(server, 'VDI.create',
-                                 (session, local_vdi_cfg))
-
-        print 'Create VBD'
-        # Create a new VBD (Local)
-        local_vbd_cfg['VM'] = vm_uuid
-        local_vbd_cfg['VDI'] = local_vdi_uuid
-        local_vbd_uuid = execute(server, 'VBD.create',
-                                 (session, local_vbd_cfg))
-
-        print 'Craete VIF'
-        # Create a new VIF
-        vif_cfg['network'] = net_uuid
-        vif_cfg['VM'] = vm_uuid
-        vif_uuid = execute(server, 'VIF.create', (session, vif_cfg))
-
-        # Create a console
-        console_cfg['VM'] = vm_uuid
-        console_uuid = execute(server, 'console.create',
-                               (session, console_cfg))
-        print console_uuid
-
-        # Start the VM
-        execute(server, 'VM.start', (session, vm_uuid, False))
-
-        time.sleep(30)
-
-        test_suspend = False
-        if test_suspend:
-            print 'Suspending VM..'
-            execute(server, 'VM.suspend', (session, vm_uuid))
-            print 'Suspended VM.'
-            time.sleep(5)
-            print 'Resuming VM ...'
-            execute(server, 'VM.resume', (session, vm_uuid, False))
-            print 'Resumed VM.'
-
-        # Wait for user to say we're good to shut it down
-        while True:
-            destroy = raw_input('destroy VM? ')
-            if destroy[0] in ('y', 'Y'):
-                break
-
-    finally:
-        # Clean up
-        if vif_uuid:
-            execute(server, 'VIF.destroy', (session, vif_uuid))
-            
-        if local_vbd_uuid:
-            execute(server, 'VBD.destroy', (session, local_vbd_uuid))
-        if local_vdi_uuid:
-            execute(server, 'VDI.destroy', (session, local_vdi_uuid))
-            
-        if vm_uuid:
-            try:
-                execute(server, 'VM.hard_shutdown', (session, vm_uuid))
-                time.sleep(2)
-            except:
-                pass
-            try:    
-                execute(server, 'VM.destroy', (session, vm_uuid))
-            except:
-                pass
-
-
-if __name__ == "__main__":
-    test_vm_create()
-    
diff --git a/tools/python/scripts/test_vm_create.py b/tools/python/scripts/test_vm_create.py
deleted file mode 100644
index 9ac8a6e..0000000
--- a/tools/python/scripts/test_vm_create.py
+++ /dev/null
@@ -1,211 +0,0 @@
-#!/usr/bin/python
-
-vm_cfg = {
-    'name_label': 'APIVM',
-    'user_version': 1,
-    'is_a_template': False,
-    'auto_power_on': False, # TODO
-
-    'memory_static_min': 64,    
-    'memory_static_max': 128,
-    #'memory_dynamic_min': 64,
-    #'memory_dynamic_max': 128,
-    
-    
-    'VCPUs_policy': 'credit',
-    'VCPUs_params': '',
-    'VCPUs_number': 2,
-
-    'actions_after_shutdown': 'destroy',
-    'actions_after_reboot': 'restart',
-    'actions_after_crash': 'destroy',
-    
-    'PV_bootloader': '',
-    'PV_bootloader_args': '',
-    
-    'PV_kernel': '/boot/vmlinuz-2.6.18-xenU',
-    'PV_ramdisk': '',
-    'PV_args': 'root=/dev/sda1 ro',
-
-    #'HVM_boot': '',
-    'platform_std_VGA': False,
-    'platform_serial': '',
-    'platform_localtime': False,
-    'platform_clock_offset': False,
-    'platform_enable_audio': False,
-    'PCI_bus': ''
-}
-
-vdi_cfg = {
-    'name_label': 'API_VDI',
-    'name_description': '',
-    'virtual_size': 100 * 1024 * 1024 * 1024,
-    'type': 'system',
-    'parent': '',
-    'SR_name': 'QCoW',
-    'sharable': False,
-    'read_only': False,
-}
-
-vbd_cfg = {
-    'VDI': '',
-    'VM': '',
-    'device': 'sda2',
-    'mode': 'RW',
-    'type': 'disk',
-    'driver': 'paravirtualised',
-}
-
-local_vdi_cfg = {
-    'name_label': 'gentoo.amd64.img',
-    'name_description': '',
-    'virtual_size': 0,
-    'type': 'system',
-    'parent': '',
-    'SR_name': 'Local',
-    'sharable': False,
-    'read_only': False,
-    'other_config': {'location': 'file:/root/gentoo.amd64.img'},
-}    
-
-local_vbd_cfg = {
-    'VDI': '',
-    'VM': '',
-    'device': 'sda1',
-    'mode': 'RW',
-    'type': 'disk',
-    'driver': 'paravirtualised',
-}
-
-vif_cfg = {
-    'name': 'API_VIF',
-    'type': 'paravirtualised',
-    'device': '',
-    'network': '',
-    'MAC': '',
-    'MTU': 1500,
-}
-
-console_cfg = {
-    'protocol': 'rfb',
-    'other_config': {'vncunused': 1, 'vncpasswd': 'testing'},
-}    
-
-import sys
-import time
-
-from xapi import connect, execute
-
-def test_vm_create():
-    server, session = connect()
-    vm_uuid = None
-    vdi_uuid = None
-    local_vdi_uuid = None
-    local_vbd_uuid = None
-    vbd_uuid = None
-    vif_uuid = None
-    
-    # List all VMs
-    vm_list = execute(server, 'VM.get_all', (session,))
-    vm_names = []
-    for vm_uuid in vm_list:
-        vm_record = execute(server, 'VM.get_record', (session, vm_uuid))
-        vm_names.append(vm_record['name_label'])
-
-    # Get default SR
-    sr_list = execute(server, 'SR.get_by_name_label', (session,
-                                                       vdi_cfg['SR_name']))
-    sr_uuid = sr_list[0]
-
-    local_sr_list = execute(server, 'SR.get_by_name_label',
-                            (session, local_vdi_cfg['SR_name']))
-    local_sr_uuid = local_sr_list[0]
-
-    # Get default network
-    net_list = execute(server, 'network.get_all', (session,))
-    net_uuid = net_list[0]
-
-    try:
-        # Create a new VM
-        vm_uuid = execute(server, 'VM.create', (session, vm_cfg))
-        
-        # Create a new VDI
-        vdi_cfg['SR'] = sr_uuid
-        vdi_uuid = execute(server, 'VDI.create', (session, vdi_cfg))
-
-        # Create a VDI backed VBD
-        vbd_cfg['VM'] = vm_uuid
-        vbd_cfg['VDI'] = vdi_uuid
-        vbd_uuid = execute(server, 'VBD.create', (session, vbd_cfg))
-        
-        # Create a new VDI (Local)
-        local_vdi_cfg['SR'] = local_sr_uuid
-        local_vdi_uuid = execute(server, 'VDI.create',
-                                 (session, local_vdi_cfg))
- 
-        # Create a new VBD (Local)
-        local_vbd_cfg['VM'] = vm_uuid
-        local_vbd_cfg['VDI'] = local_vdi_uuid
-        local_vbd_uuid = execute(server, 'VBD.create',
-                                 (session, local_vbd_cfg))
-
-        # Create a new VIF
-        vif_cfg['network'] = net_uuid
-        vif_cfg['VM'] = vm_uuid
-        vif_uuid = execute(server, 'VIF.create', (session, vif_cfg))
-
-        # Create a console
-        console_cfg['VM'] = vm_uuid
-        console_uuid = execute(server, 'console.create',
-                               (session, console_cfg))
-        print console_uuid
-
-        # Start the VM
-        execute(server, 'VM.start', (session, vm_uuid, False))
-
-        time.sleep(30)
-
-        test_suspend = False
-        if test_suspend:
-            print 'Suspending VM..'
-            execute(server, 'VM.suspend', (session, vm_uuid))
-            print 'Suspended VM.'
-            time.sleep(5)
-            print 'Resuming VM ...'
-            execute(server, 'VM.resume', (session, vm_uuid, False))
-            print 'Resumed VM.'
-
-    finally:
-        # Wait for user to say we're good to shut it down
-        while True:
-            destroy = raw_input('destroy VM? ')
-            if destroy[0] in ('y', 'Y'):
-                break
-        
-        # Clean up
-        if vif_uuid:
-            execute(server, 'VIF.destroy', (session, vif_uuid))
-            
-        if local_vbd_uuid:
-            execute(server, 'VBD.destroy', (session, local_vbd_uuid))
-        if local_vdi_uuid:
-            execute(server, 'VDI.destroy', (session, local_vdi_uuid))
-            
-        if vbd_uuid:
-            execute(server, 'VBD.destroy', (session, vbd_uuid))
-        if vdi_uuid:
-            execute(server, 'VDI.destroy', (session, vdi_uuid))
-        
-        if vm_uuid:
-            try:
-                execute(server, 'VM.hard_shutdown', (session, vm_uuid))
-                time.sleep(2)
-            except:
-                pass
-                
-            execute(server, 'VM.destroy', (session, vm_uuid))
-
-
-if __name__ == "__main__":
-    test_vm_create()
-    
diff --git a/tools/python/scripts/xapi.domcfg.py b/tools/python/scripts/xapi.domcfg.py
deleted file mode 100644
index d7b8ae5..0000000
--- a/tools/python/scripts/xapi.domcfg.py
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# VM Configuration for Xen API
-#
-
-name_label =  'GentooAPI'
-name_description =  'Gentoo VM via API'
-user_version =  1
-is_a_template =  False
-memory_static_max =  32
-memory_dynamic_max =  32
-memory_dynamic_min =  32
-memory_static_min =  32
-VCPUs_policy =  ''
-VCPUs_params =  ''
-VCPUS_features_required =  ''
-VCPUs_features_can_use =  ''
-VCPUs_features_force_on =  ''
-VCPUs_features_force_off =  ''
-actions_after_shutdown =  'destroy'
-actions_after_reboot =  'restart'
-actions_after_suspend =  'destroy'
-actions_after_crash =  'restart'
-bios_boot =  ''
-platform_std_VGA =  False
-platform_serial =  ''
-platform_localtime =  False
-platform_clock_offset =  False
-platform_enable_audio =  False
-builder =  'linux'
-boot_method =  '' # this will remove the kernel/initrd ??
-kernel_kernel =  '/boot/vmlinuz-2.6.16.29-xen'
-kernel_initrd =  '/root/initrd-2.6.16.29-xen.img'
-kernel_args =  'root=/dev/sda1 ro'
-grub_cmdline =  ''
-PCI_bus =  ''
-other_config =  ''
-
diff --git a/tools/python/scripts/xapi.py b/tools/python/scripts/xapi.py
deleted file mode 100644
index 0997187..0000000
--- a/tools/python/scripts/xapi.py
+++ /dev/null
@@ -1,854 +0,0 @@
-#!/usr/bin/python
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2006 XenSource Ltd.
-#============================================================================
-
-import sys
-import time
-import re
-import os
-
-from xen.util.xmlrpclib2 import ServerProxy
-from optparse import *
-from pprint import pprint
-from types import DictType
-from getpass import getpass
-
-# Get default values from the environment
-SERVER_URI = os.environ.get('XAPI_SERVER_URI', 'http://localhost:9363/')
-SERVER_USER = os.environ.get('XAPI_SERVER_USER', '')
-SERVER_PASS = os.environ.get('XAPI_SERVER_PASS', '')
-
-MB = 1024 * 1024
-
-HOST_INFO_FORMAT = '%-20s: %-50s'
-VM_LIST_FORMAT = '%(name_label)-18s %(memory_actual)-5s %(VCPUs_number)-5s'\
-                 ' %(power_state)-10s %(uuid)-36s'
-SR_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(physical_size)-10s' \
-                 '%(type)-10s'
-VDI_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(virtual_size)-8s'
-VBD_LIST_FORMAT = '%(device)-6s %(uuid)-36s %(VDI)-8s'
-TASK_LIST_FORMAT = '%(name_label)-18s %(uuid)-36s %(status)-8s %(progress)-4s'
-VIF_LIST_FORMAT = '%(name)-8s %(device)-7s %(uuid)-36s %(MAC)-10s'
-CONSOLE_LIST_FORMAT = '%(uuid)-36s %(protocol)-8s %(location)-32s'
-
-COMMANDS = {
-    'host-info': ('', 'Get Xen Host Info'),
-    'host-set-name': ('', 'Set host name'),
-    'pif-list': ('', 'List all PIFs'),
-    'sr-list':   ('', 'List all SRs'),
-    'vbd-list':  ('', 'List all VBDs'),
-    'vbd-create': ('<domname> <pycfg> [opts]',
-                   'Create VBD attached to domname'),
-    'vdi-create': ('<pycfg> [opts]', 'Create a VDI'),
-    'vdi-list'  : ('', 'List all VDI'),
-    'vdi-rename': ('<vdi_uuid> <new_name>', 'Rename VDI'),
-    'vdi-destroy': ('<vdi_uuid>', 'Delete VDI'),
-    'vif-create': ('<domname> <pycfg>', 'Create VIF attached to domname'),
-
-    'vm-create': ('<pycfg>', 'Create VM with python config'),
-    'vm-destroy': ('<domname>', 'Delete VM'),
-    
-    'vm-list':   ('[--long]', 'List all domains.'),
-    'vm-name':   ('<uuid>', 'Name of UUID.'),
-    'vm-shutdown': ('<name> [opts]', 'Shutdown VM with name'),
-    'vm-start':  ('<name>', 'Start VM with name'),
-    'vm-uuid':   ('<name>', 'UUID of a domain by name.'),
-    'async-vm-start': ('<name>', 'Start VM asynchronously'),
-}
-
-OPTIONS = {
-    'sr-list': [(('-l', '--long'),
-                 {'action':'store_true',
-                  'help':'List all properties of SR'})
-               ],
-
-    'vdi-list': [(('-l', '--long'),
-                  {'action':'store_true',
-                   'help':'List all properties of VDI'})
-                 ],
-    'vif-list': [(('-l', '--long'),
-                  {'action':'store_true',
-                   'help':'List all properties of VIF'})
-                 ],            
-    'vm-list': [(('-l', '--long'),
-                 {'action':'store_true',
-                  'help':'List all properties of VMs'})
-               ],
-    'vm-shutdown': [(('-f', '--force'), {'help': 'Shutdown Forcefully',
-                                         'action': 'store_true'})],
-    
-    'vdi-create': [(('--name-label',), {'help': 'Name for VDI'}),
-                   (('--name-description',), {'help': 'Description for VDI'}),
-                   (('--virtual-size',), {'type': 'int',
-                                          'default': 0,
-                                          'help': 'Size of VDI in bytes'}),
-                   (('--type',), {'choices': ['system', 'user', 'ephemeral'],
-                                  'default': 'system',
-                                  'help': 'VDI type'}),
-                   (('--sharable',), {'action': 'store_true',
-                                      'help': 'VDI sharable'}),
-                   (('--read-only',), {'action': 'store_true',
-                                       'help': 'Read only'}),
-                   (('--sr',), {})],
-    
-    'vbd-create': [(('--VDI',), {'help': 'UUID of VDI to attach to.'}),
-                   (('--mode',), {'choices': ['RO', 'RW'],
-                                  'help': 'device mount mode'}),
-                   (('--driver',), {'choices':['paravirtualised', 'ioemu'],
-                                    'help': 'Driver for VBD'}),
-                   (('--device',), {'help': 'Device name on guest domain'})]
-                   
-}
-
-class OptionError(Exception):
-    pass
-
-class XenAPIError(Exception):
-    pass
-
-# 
-# Extra utility functions
-#
-
-class IterableValues(Values):
-    """Better interface to the list of values from optparse."""
-
-    def __iter__(self):
-        for opt, val in self.__dict__.items():
-            if opt[0] == '_' or callable(val):
-                continue
-            yield opt, val        
-
-
-def parse_args(cmd_name, args, set_defaults = False):
-    argstring, desc = COMMANDS[cmd_name]
-    parser = OptionParser(usage = 'xapi %s %s' % (cmd_name, argstring),
-                          description = desc)
-    if cmd_name in OPTIONS:
-        for optargs, optkwds in OPTIONS[cmd_name]:
-            parser.add_option(*optargs, **optkwds)
-
-    if set_defaults:
-        default_values = parser.get_default_values()
-        defaults = IterableValues(default_values.__dict__)
-    else:
-        defaults = IterableValues()
-    (opts, extraargs) = parser.parse_args(args = list(args),
-                                          values = defaults)
-    return opts, extraargs
-
-def execute(server, fn, args, async = False):
-    if async:
-        func = eval('server.Async.%s' % fn)
-    else:
-        func = eval('server.%s' % fn)
-        
-    result = func(*args)
-    if type(result) != DictType:
-        raise TypeError("Function returned object of type: %s" %
-                        str(type(result)))
-    if 'Value' not in result:
-        raise XenAPIError(*result['ErrorDescription'])
-    return result['Value']
-
-_initialised = False
-_server = None
-_session = None
-def connect(*args):
-    global _server, _session, _initialised
-    
-    if not _initialised:
-        # try without password or default credentials
-        try:
-            _server = ServerProxy(SERVER_URI)
-            _session = execute(_server.session, 'login_with_password',
-                               (SERVER_USER, SERVER_PASS))
-        except:
-            login = raw_input("Login: ")
-            password = getpass()
-            creds = (login, password)            
-            _server = ServerProxy(SERVER_URI)
-            _session = execute(_server.session, 'login_with_password',
-                               creds)
-
-        _initialised = True
-    return (_server, _session)
-
-def _stringify(adict):
-    return dict([(k, str(v)) for k, v in adict.items()])
-
-def _read_python_cfg(filename):
-    cfg = {}
-    execfile(filename, {}, cfg)
-    return cfg
-
-def resolve_vm(server, session, vm_name):
-    vm_uuid = execute(server, 'VM.get_by_name_label', (session, vm_name))
-    if not vm_uuid:
-        return None
-    else:
-        return vm_uuid[0]
-
-def resolve_vdi(server, session, vdi_name):
-    vdi_uuid = execute(server, 'VDI.get_by_name_label', (session, vdi_name))
-    if not vdi_uuid:
-        return None
-    else:
-        return vdi_uuid[0]
-
-#
-# Actual commands
-#
-
-def xapi_host_info(args, async = False):
-    server, session = connect()
-    hosts = execute(server, 'host.get_all', (session,))
-    for host in hosts: # there is only one, but ..
-        hostinfo = execute(server, 'host.get_record', (session, host))
-        print HOST_INFO_FORMAT % ('Name', hostinfo['name_label'])
-        print HOST_INFO_FORMAT % ('Version', hostinfo['software_version'])
-        print HOST_INFO_FORMAT % ('CPUs', len(hostinfo['host_CPUs']))
-        print HOST_INFO_FORMAT % ('VMs', len(hostinfo['resident_VMs']))
-        print HOST_INFO_FORMAT % ('UUID', host)        
-
-        for host_cpu_uuid in hostinfo['host_CPUs']:
-            host_cpu = execute(server, 'host_cpu.get_record',
-                               (session, host_cpu_uuid))
-            print 'CPU %s Util: %.2f' % (host_cpu['number'],
-                                         float(host_cpu['utilisation']))
-        
-def xapi_host_set_name(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No hostname specified")
-    
-    server, session = connect()
-    hosts = execute(server, 'host.get_all', (session,))
-    if len(hosts) > 0:
-        execute(server, 'host.set_name_label', (session, hosts[0], args[0]))
-        print 'Hostname: %s' % execute(server, 'host.get_name_label',
-                                       (session, hosts[0]))
-
-def xapi_vm_uuid(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No domain name specified")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print vm_uuid
-
-def xapi_vm_name(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No UUID specified")
-    
-    server, session = connect()
-    vm_name = execute(server, 'VM.get_name_label', (session, args[0]))
-    print vm_name
-
-def xapi_vm_list(args, async = False):
-    opts, args = parse_args('vm-list', args, set_defaults = True)
-    is_long = opts and opts.long
-
-    list_only = args
-    
-    server, session = connect()
-    vm_uuids = execute(server, 'VM.get_all', (session,))
-    if not is_long:
-        print VM_LIST_FORMAT % {'name_label':'Name',
-                                'memory_actual':'Mem',
-                                'VCPUs_number': 'VCPUs',
-                                'power_state': 'State',
-                                'uuid': 'UUID'}
-
-    for uuid in vm_uuids:
-        vm_info = execute(server, 'VM.get_record', (session, uuid))
-
-        # skip domain if we don't want
-        if list_only and vm_info['name_label'] not in list_only:
-            continue
-        
-        if is_long:
-            vbds = vm_info['VBDs']
-            vifs = vm_info['VIFs']
-            vif_infos = []
-            vbd_infos = []
-            for vbd in vbds:
-                vbd_info = execute(server, 'VBD.get_record', (session, vbd))
-                vbd_infos.append(vbd_info)
-            for vif in vifs:
-                vif_info = execute(server, 'VIF.get_record', (session, vif))
-                vif_infos.append(vif_info)
-            vm_info['VBDs'] = vbd_infos
-            vm_info['VIFs'] = vif_infos
-            pprint(vm_info)
-        else:
-            print VM_LIST_FORMAT % _stringify(vm_info)
-
-def xapi_vm_create(args, async = False):
-    if len(args) < 1:
-        raise OptionError("Configuration file not specified")
-
-    filename = args[0]
-    cfg = _read_python_cfg(filename)
-
-    print 'Creating VM from %s ..' % filename
-    server, session = connect()
-    uuid = execute(server, 'VM.create', (session, cfg), async = async)
-    print 'Done. (%s)' % uuid
-    print uuid
-
-def xapi_vm_destroy(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])    
-    print 'Destroying VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.destroy', (session, vm_uuid), async = async)
-    print 'Done.'
-    
-
-def xapi_vm_start(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Starting VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.start', (session, vm_uuid, False), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vm_suspend(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Suspending VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.suspend', (session, vm_uuid), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'        
-
-
-def xapi_vm_resume(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Resuming VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.resume', (session, vm_uuid, False), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vm_pause(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Pausing VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.pause', (session, vm_uuid), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vm_unpause(args, async = False):
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    print 'Pausing VM %s (%s)' % (args[0], vm_uuid)
-    success = execute(server, 'VM.unpause', (session, vm_uuid), async = async)
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'                        
-
-def xapi_task_list(args, async = False):
-    server, session = connect()
-    all_tasks = execute(server, 'task.get_all', (session,))
-
-    print TASK_LIST_FORMAT % {'name_label': 'Task Name',
-                              'uuid': 'UUID',
-                              'status': 'Status',
-                              'progress': '%'}
-    
-    for task_uuid in all_tasks:
-        task = execute(server, 'task.get_record', (session, task_uuid))
-        print TASK_LIST_FORMAT % task
-
-def xapi_task_clear(args, async = False):
-    server, session = connect()
-    all_tasks = execute(server, 'task.get_all', (session,))
-    for task_uuid in all_tasks:
-        success = execute(server, 'task.destroy', (session, task_uuid))
-        print 'Destroyed Task %s' % task_uuid
-
-def xapi_vm_shutdown(args, async = False):
-    opts, args = parse_args("vm-shutdown", args, set_defaults = True)
-    
-    if len(args) < 1:
-        raise OptionError("No Domain name specified.")
-
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, args[0])
-    if opts.force:
-        print 'Forcefully shutting down VM %s (%s)' % (args[0], vm_uuid)
-        success = execute(server, 'VM.hard_shutdown', (session, vm_uuid), async = async)
-    else:
-        print 'Shutting down VM %s (%s)' % (args[0], vm_uuid)
-        success = execute(server, 'VM.clean_shutdown', (session, vm_uuid), async = async)
-
-    if async:
-        print 'Task started: %s' % success
-    else:
-        print 'Done.'
-
-def xapi_vbd_create(args, async = False):
-    opts, args = parse_args('vbd-create', args)
-
-    if len(args) < 2:
-        raise OptionError("Configuration file and domain not specified")
-
-    domname = args[0]
-
-    if len(args) > 1:
-        filename = args[1]
-        cfg = _read_python_cfg(filename)
-    else:
-        cfg = {}
-        
-    for opt, val in opts:
-        cfg[opt] = val
-    
-    print 'Creating VBD ...',
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, domname)
-    cfg['VM'] = vm_uuid
-    vbd_uuid = execute(server, 'VBD.create', (session, cfg), async = async)
-    if async:
-        print 'Task started: %s' % vbd_uuid
-    else:
-        print 'Done. (%s)' % vbd_uuid
-
-def xapi_vif_create(args, async = False):
-    if len(args) < 2:
-        raise OptionError("Configuration file not specified")
-
-    domname = args[0]
-    filename = args[1]
-    cfg = _read_python_cfg(filename)
-    
-    print 'Creating VIF from %s ..' % filename
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, domname)
-    cfg['VM'] = vm_uuid
-    vif_uuid = execute(server, 'VIF.create', (session, cfg), async = async)
-    if async:
-        print 'Task started: %s' % vif_uuid
-    else:
-        print 'Done. (%s)' % vif_uuid
-
-def xapi_vbd_list(args, async = False):
-    server, session = connect()
-    domname = args[0]
-    
-    dom_uuid = resolve_vm(server, session, domname)
-    vbds = execute(server, 'VM.get_VBDs', (session, dom_uuid))
-    
-    print VBD_LIST_FORMAT % {'device': 'Device',
-                             'uuid' : 'UUID',
-                             'VDI': 'VDI'}
-    
-    for vbd in vbds:
-        vbd_struct = execute(server, 'VBD.get_record', (session, vbd))
-        print VBD_LIST_FORMAT % vbd_struct
-        
-        
-def xapi_vbd_stats(args, async = False):
-    server, session = connect()
-    domname = args[0]
-    dom_uuid = resolve_vm(server, session, domname)
-
-    vbds = execute(server, 'VM.get_VBDs', (session, dom_uuid))
-    for vbd_uuid in vbds:
-        print execute(server, 'VBD.get_io_read_kbs', (session, vbd_uuid))
- 
-def xapi_vif_list(args, async = False):
-    server, session = connect()
-    opts, args = parse_args('vdi-list', args, set_defaults = True)
-    is_long = opts and opts.long
-    
-    domname = args[0]
-    
-    dom_uuid = resolve_vm(server, session, domname)
-    vifs = execute(server, 'VM.get_VIFs', (session, dom_uuid))
-
-    if not is_long:
-        print VIF_LIST_FORMAT % {'name': 'Name',
-                                 'device': 'Device',
-                                 'uuid' : 'UUID',
-                                 'MAC': 'MAC'}
-        
-        for vif in vifs:
-            vif_struct = execute(server, 'VIF.get_record', (session, vif))
-            print VIF_LIST_FORMAT % vif_struct
-    else:
-        for vif in vifs:
-            vif_struct = execute(server, 'VIF.get_record', (session, vif))
-            pprint(vif_struct)
-
-def xapi_console_list(args, async = False):
-    server, session = connect()
-    opts, args = parse_args('vdi-list', args, set_defaults = True)
-    is_long = opts and opts.long
-    
-    domname = args[0]
-    
-    dom_uuid = resolve_vm(server, session, domname)
-    consoles = execute(server, 'VM.get_consoles', (session, dom_uuid))
-
-    if not is_long:
-        print CONSOLE_LIST_FORMAT % {'protocol': 'Protocol',
-                                     'location': 'Location',
-                                     'uuid': 'UUID'}
-
-        for console in consoles:
-            console_struct = execute(server, 'console.get_record',
-                                     (session, console))
-            print CONSOLE_LIST_FORMAT % console_struct
-    else:
-        for console in consoles:
-            console_struct = execute(server, 'console.get_record',
-                                     (session, console))
-            pprint(console_struct)            
-
-
-def xapi_vdi_list(args, async = False):
-    opts, args = parse_args('vdi-list', args, set_defaults = True)
-    is_long = opts and opts.long
-
-    server, session = connect()
-    vdis = execute(server, 'VDI.get_all', (session,))
-
-    if not is_long:
-        print VDI_LIST_FORMAT % {'name_label': 'VDI Label',
-                                 'uuid' : 'UUID',
-                                 'virtual_size': 'Bytes'}
-        
-        for vdi in vdis:
-            vdi_struct = execute(server, 'VDI.get_record', (session, vdi))
-            print VDI_LIST_FORMAT % vdi_struct
-
-    else:
-        for vdi in vdis:
-            vdi_struct = execute(server, 'VDI.get_record', (session, vdi))
-            pprint(vdi_struct)
-
-def xapi_sr_list(args, async = False):
-    opts, args = parse_args('sr-list', args, set_defaults = True)
-    is_long = opts and opts.long
-    
-    server, session = connect()
-    srs = execute(server, 'SR.get_all', (session,))
-    if not is_long:
-        print SR_LIST_FORMAT % {'name_label': 'SR Label',
-                                'uuid' : 'UUID',
-                                'physical_size': 'Size (MB)',
-                                'type': 'Type'}
-        
-        for sr in srs:
-            sr_struct = execute(server, 'SR.get_record', (session, sr))
-            sr_struct['physical_size'] = int(sr_struct['physical_size'])/MB
-            print SR_LIST_FORMAT % sr_struct
-    else:
-        for sr in srs:
-            sr_struct = execute(server, 'SR.get_record', (session, sr))  
-            pprint(sr_struct)
-
-def xapi_sr_rename(args, async = False):
-    server, session = connect()
-    sr = execute(server, 'SR.get_by_name_label', (session, args[0]))
-    execute(server, 'SR.set_name_label', (session, sr[0], args[1]))
-
-def xapi_vdi_create(args, async = False):
-    opts, args = parse_args('vdi-create', args)
-
-    if len(args) > 0:
-        cfg = _read_python_cfg(args[0])
-    else:
-        cfg = {}
-        
-    for opt, val in opts:
-        cfg[opt] = val
-
-    server, session = connect()
-    srs = []
-    if cfg.get('SR'):    
-        srs = execute(server, 'SR.get_by_name_label', (session, cfg['SR']))
-    else:
-        srs = execute(server, 'SR.get_all', (session,))
-
-    sr = srs[0]
-    cfg['SR'] = sr
-
-    size = cfg['virtual_size']/MB
-    print 'Creating VDI of size: %dMB ..' % size,
-    uuid = execute(server, 'VDI.create', (session, cfg), async = async)
-    if async:
-        print 'Task started: %s' % uuid
-    else:
-        print 'Done. (%s)' % uuid
-    
-
-def xapi_vdi_destroy(args, async = False):
-    server, session = connect()
-    if len(args) < 1:
-        raise OptionError('Not enough arguments')
-
-    vdi_uuid = args[0]
-    print 'Deleting VDI %s' % vdi_uuid
-    result = execute(server, 'VDI.destroy', (session, vdi_uuid), async = async)
-    if async:
-        print 'Task started: %s' % result
-    else:
-        print 'Done.'
-
-def xapi_vdi_rename(args, async = False):
-    server, session = connect()
-    if len(args) < 2:
-        raise OptionError('Not enough arguments')
-
-    vdi_uuid = execute(server, 'VDI.get_by_name_label', session, args[0])
-    vdi_name = args[1]
-    
-    print 'Renaming VDI %s to %s' % (vdi_uuid[0], vdi_name)
-    result = execute(server, 'VDI.set_name_label',
-                     (session, vdi_uuid[0], vdi_name), async = async)
-    if async:
-        print 'Task started: %s' % result
-    else:
-        print 'Done.'
-
-
-def xapi_pif_list(args, async = False):
-    server, session = connect()
-    pif_uuids = execute(server, 'PIF.get_all', (session,))
-    for pif_uuid in pif_uuids:
-        pif = execute(server, 'PIF.get_record', (session, pif_uuid))
-        print pif
-
-
-def xapi_debug_wait(args, async = False):
-    secs = 10
-    if len(args) > 0:
-        secs = int(args[0])
-    server, session = connect()
-    task_uuid = execute(server, 'debug.wait', (session, secs), async=async)
-    print 'Task UUID: %s' % task_uuid
-
-def xapi_vm_stat(args, async = False):
-    domname = args[0]
-    
-    server, session = connect()
-    vm_uuid = resolve_vm(server, session, domname)
-    vif_uuids = execute(server, 'VM.get_VIFs', (session, vm_uuid))
-    vbd_uuids = execute(server, 'VM.get_VBDs', (session, vm_uuid))
-    vcpus_utils = execute(server, 'VM.get_VCPUs_utilisation',
-                          (session, vm_uuid))
-
-    for vcpu_num in sorted(vcpus_utils.keys()):
-        print 'CPU %s : %5.2f%%' % (vcpu_num, vcpus_utils[vcpu_num] * 100)
-        
-    for vif_uuid in vif_uuids:
-        vif = execute(server, 'VIF.get_record', (session, vif_uuid))
-        print '%(device)s: rx: %(io_read_kbs)10.2f tx: %(io_write_kbs)10.2f' \
-              % vif
-    for vbd_uuid in vbd_uuids:
-        vbd = execute(server, 'VBD.get_record', (session, vbd_uuid))
-        print '%(device)s: rd: %(io_read_kbs)10.2f wr: %(io_write_kbs)10.2f' \
-              % vbd
-        
-#
-# Command Line Utils
-#
-import cmd
-import shlex
-
-class XenAPICmd(cmd.Cmd):
-    def __init__(self, server, session):
-        cmd.Cmd.__init__(self)
-        self.server = server
-        self.session = session
-        self.prompt = ">>> "
-
-    def default(self, line):
-        words = shlex.split(line)
-        if len(words) > 0:
-            cmd_name = words[0].replace('-', '_')
-            is_async = 'async' in cmd_name
-            if is_async:
-                cmd_name = re.sub('async_', '', cmd_name)
-                
-            func_name = 'xapi_%s' % cmd_name
-            func = globals().get(func_name)
-            
-            if func:
-                try:
-                    args = tuple(words[1:])
-                    func(args, async = is_async)
-                    return True
-                except SystemExit:
-                    return False
-                except OptionError, e:
-                    print 'Error:', str(e)
-                    return False
-                except Exception, e:
-                    import traceback
-                    traceback.print_exc()
-                    return False
-        print '*** Unknown command: %s' % words[0]
-        return False
-
-    def do_EOF(self, line):
-        print
-        sys.exit(0)
-
-    def do_help(self, line):
-        usage(print_usage = False)
-
-    def emptyline(self):
-        pass
-
-    def postcmd(self, stop, line):
-        return False
-
-    def precmd(self, line):
-        words = shlex.split(line)
-        if len(words) > 0:
-            words0 = words[0].replace('-', '_')
-            return ' '.join([words0] + words[1:])
-        else:
-            return line
-
-def shell():
-    server, session = connect()
-    x = XenAPICmd(server, session)
-    x.cmdloop('Xen API Prompt. Type "help" for a list of functions')
-
-def usage(command = None, print_usage = True):
-    if not command:
-        if print_usage:
-            print 'Usage: xapi <subcommand> [options] [args]'
-            print
-            print 'Subcommands:'
-            print
-
-        for func in sorted(globals().keys()):
-            if func.startswith('xapi_'):
-                command = func[5:].replace('_', '-')
-                args, description = COMMANDS.get(command, ('', ''))
-                print '%-16s  %-40s' % (command, description)
-        print
-    else:
-        parse_args(command, ['-h'])
-
-def main(args):
-    
-    # poor man's optparse that doesn't abort on unrecognised opts
-
-    options = {}
-    remaining = []
-    
-    arg_n = 0
-    while args:
-        arg = args.pop(0)
-        
-        if arg in ('--help', '-h'):
-            options['help'] = True
-        elif arg in ('--server', '-s') and args:
-            options['server'] = args.pop(0)
-        elif arg in ('--user', '-u') and args:
-            options['user'] = args.pop(0)
-        elif arg in ('--password', '-p') and args:
-            options['password'] = args.pop(0)
-        else:
-            remaining.append(arg)
-
-    # abort here if these conditions are true
-
-    if options.get('help') and not remaining:
-        usage()
-        sys.exit(1)
-
-    if options.get('help') and remaining:
-        usage(remaining[0])
-        sys.exit(1)
-
-    if not remaining:
-        usage()
-        sys.exit(1)
-
-    if options.get('server'):
-        # it is ugly to use a global, but it is simple
-        global SERVER_URI
-        SERVER_URI = options['server']
-
-    if options.get('user'):
-        global SERVER_USER
-        SERVER_USER = options['user']
-
-    if options.get('password'):
-        global SERVER_PASS
-        SERVER_PASS = options['password']
-
-    subcmd = remaining[0].replace('-', '_')
-    is_async = 'async' in subcmd
-    if is_async:
-        subcmd = re.sub('async_', '', subcmd)
-    subcmd_func_name = 'xapi_' + subcmd
-    subcmd_func = globals().get(subcmd_func_name, None)
-
-    if subcmd == 'shell':
-        shell()
-    elif not subcmd_func or not callable(subcmd_func):
-        print 'Error: Unable to find subcommand \'%s\'' % subcmd
-        usage()
-        sys.exit(1)
-
-    try:
-        subcmd_func(remaining[1:], async = is_async)
-    except XenAPIError, e:
-        print 'Error: %s' % str(e.args[0])
-        sys.exit(2)
-    except OptionError, e:
-        print 'Error: %s' % e
-
-    sys.exit(0)
-    
-if __name__ == "__main__":
-    import sys
-    main(sys.argv[1:])
diff --git a/tools/python/scripts/xapi.vbdcfg.py b/tools/python/scripts/xapi.vbdcfg.py
deleted file mode 100644
index 82dcaf8..0000000
--- a/tools/python/scripts/xapi.vbdcfg.py
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Virtual Block Device (VBD) Xen API Configuration
-# 
-# Note: There is a non-API field here called "image" which is a backwards
-#       compat addition so you can mount to old images.
-# 
-
-VDI =  ''
-device = 'sda1'
-mode = 'RW'
-driver = 'paravirtualised'
-image = 'file:/root/gentoo.amd64.img'
diff --git a/tools/python/scripts/xapi.vdicfg.py b/tools/python/scripts/xapi.vdicfg.py
deleted file mode 100644
index cb63653..0000000
--- a/tools/python/scripts/xapi.vdicfg.py
+++ /dev/null
@@ -1,6 +0,0 @@
-name_label = 'VDI 1'
-name_description = ''
-virtual_size = 10 * 1024 * 1024 * 1024
-type = 'system'
-sharable = False
-read_only = False
diff --git a/tools/python/scripts/xapi.vifcfg.py b/tools/python/scripts/xapi.vifcfg.py
deleted file mode 100644
index f421224..0000000
--- a/tools/python/scripts/xapi.vifcfg.py
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Virtual Network Interface Configuration for the Xen API
-#
-
-name = ''
-type = 'paravirtualised'
-#device = 'eth0' # this is the dom0 device, not domU!
-network = '' # ignored
-MAC = ''
-MTU = '1500'
diff --git a/tools/python/scripts/xapi.vtpmcfg.py b/tools/python/scripts/xapi.vtpmcfg.py
deleted file mode 100644
index 7c419ba..0000000
--- a/tools/python/scripts/xapi.vtpmcfg.py
+++ /dev/null
@@ -1,3 +0,0 @@
-type = 'paravirtualised'
-backend = 'Domain-0'
-instance = 1
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHL-0007Dk-UA; Sun, 22 Jun 2014 18:14:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHK-0007DY-DG
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:10 +0000
Received: from [85.158.143.35:46954] by server-1.bemta-4.messagelabs.com id
	14/28-09496-1FC17A35; Sun, 22 Jun 2014 18:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403460848!13004886!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24868 invoked from network); 22 Jun 2014 18:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHH-0000FW-Vn
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHH-0007j4-U4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:07 +0000
Date: Sun, 22 Jun 2014 18:14:07 +0000
Message-Id: <E1WymHH-0007j4-U4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Panic when we receive an
	unexpected trap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f5ab681d208993f94553203f4be323b3c929070
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Jun 17 21:44:28 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:05:30 2014 +0100

    xen/arm: Panic when we receive an unexpected trap
    
    The current implementation of do_unexpected_trap make Xen spin forever
    on the current physical CPU. This may lead to stall guests VCPU and print
    unhelpful message (RCU stall...).
    
    Usually when Xen receives an unexpected trap, it means that something goes
    wrong either in the hypervisor or in the CPU. In this case we should
    directly panic to also stop the other CPUs.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 31127fe..7f77c56 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -999,7 +999,7 @@ void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
 {
     printk("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
     show_execution_state(regs);
-    while(1);
+    panic("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
 }
 
 typedef register_t (*arm_hypercall_fn_t)(
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHL-0007Dk-UA; Sun, 22 Jun 2014 18:14:11 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHK-0007DY-DG
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:10 +0000
Received: from [85.158.143.35:46954] by server-1.bemta-4.messagelabs.com id
	14/28-09496-1FC17A35; Sun, 22 Jun 2014 18:14:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403460848!13004886!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24868 invoked from network); 22 Jun 2014 18:14:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHH-0000FW-Vn
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHH-0007j4-U4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:07 +0000
Date: Sun, 22 Jun 2014 18:14:07 +0000
Message-Id: <E1WymHH-0007j4-U4@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: Panic when we receive an
	unexpected trap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f5ab681d208993f94553203f4be323b3c929070
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Tue Jun 17 21:44:28 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:05:30 2014 +0100

    xen/arm: Panic when we receive an unexpected trap
    
    The current implementation of do_unexpected_trap make Xen spin forever
    on the current physical CPU. This may lead to stall guests VCPU and print
    unhelpful message (RCU stall...).
    
    Usually when Xen receives an unexpected trap, it means that something goes
    wrong either in the hypervisor or in the CPU. In this case we should
    directly panic to also stop the other CPUs.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/traps.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 31127fe..7f77c56 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -999,7 +999,7 @@ void do_unexpected_trap(const char *msg, struct cpu_user_regs *regs)
 {
     printk("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
     show_execution_state(regs);
-    while(1);
+    panic("CPU%d: Unexpected Trap: %s\n", smp_processor_id(), msg);
 }
 
 typedef register_t (*arm_hypercall_fn_t)(
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHY-0007Fp-0k; Sun, 22 Jun 2014 18:14:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHV-0007FT-IN
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:21 +0000
Received: from [193.109.254.147:46086] by server-4.bemta-14.messagelabs.com id
	7C/EF-02781-CFC17A35; Sun, 22 Jun 2014 18:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403460858!12877475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27064 invoked from network); 22 Jun 2014 18:14:19 -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 Jun 2014 18:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHS-0000Ff-5U
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHS-0007jQ-3s
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:18 +0000
Date: Sun, 22 Jun 2014 18:14:18 +0000
Message-Id: <E1WymHS-0007jQ-3s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl / libxl: push parsing of SSID and
	CPU pool ID down to libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ab4440112bec31d066df97eab5a0625076e8790a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jun 17 10:32:21 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:07:41 2014 +0100

    xl / libxl: push parsing of SSID and CPU pool ID down to libxl
    
    This patch pushes parsing of "init_seclabel", "seclabel",
    "device_model_stubdomain_seclabel" and "pool" down to libxl level.
    
    Originally the parsing is done in xl level, which is not ideal because
    libxl won't have the truely relevant information. With this patch libxl
    holds important information by itself.
    
    The libxl IDL is extended to hold the string of labels and pool name.
    And if there those strings are present they take precedence over the
    numeric representations.
    
    As all relevant structures (libxl_dominfo etc) have a field called
    X_name / X_label now, a string is also copied there so that callers
    won't have to do ID to name / label translation.
    
    In order to be compatible with users of older versions of libxl, this
    patch also defines LIBXL_HAVE_SSID_LABEL and LIBXL_HAVE_CPUPOOL_NAME. If
    they are defined, the respective strings are available. And if those
    strings are not NULL, libxl will do the parsing and ignore the numeric
    values.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Dario Faggioli <dario.faggioli@citrix.com>
    Cc: Juergen Gross <jgross@suse.com>
    Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c         |   22 +++++++--
 tools/libxl/libxl.h         |   20 ++++++++
 tools/libxl/libxl_create.c  |   57 +++++++++++++++++++++++
 tools/libxl/libxl_dm.c      |    4 ++
 tools/libxl/libxl_types.idl |    6 ++
 tools/libxl/xl_cmdimpl.c    |  107 ++++++++++++-------------------------------
 tools/libxl/xl_sxp.c        |    7 +--
 7 files changed, 137 insertions(+), 86 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9054c3b..b3dca0c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -529,12 +529,18 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
     return 0;
 }
 
-static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
+static void xcinfo2xlinfo(libxl_ctx *ctx,
+                          const xc_domaininfo_t *xcinfo,
                           libxl_dominfo *xlinfo)
 {
+    size_t size;
+
     memcpy(&(xlinfo->uuid), xcinfo->handle, sizeof(xen_domain_handle_t));
     xlinfo->domid = xcinfo->domain;
     xlinfo->ssidref = xcinfo->ssidref;
+    if (libxl_flask_sid_to_context(ctx, xlinfo->ssidref,
+                                   &xlinfo->ssid_label, &size) < 0)
+        xlinfo->ssid_label = NULL;
 
     xlinfo->dying    = !!(xcinfo->flags&XEN_DOMINF_dying);
     xlinfo->shutdown = !!(xcinfo->flags&XEN_DOMINF_shutdown);
@@ -581,7 +587,7 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
     }
 
     for (i = 0; i < ret; i++) {
-        xcinfo2xlinfo(&info[i], &ptr[i]);
+        xcinfo2xlinfo(ctx, &info[i], &ptr[i]);
     }
     *nb_domain_out = ret;
     return ptr;
@@ -600,7 +606,7 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r,
     if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;
 
     if (info_r)
-        xcinfo2xlinfo(&xcinfo, info_r);
+        xcinfo2xlinfo(ctx, &xcinfo, info_r);
     return 0;
 }
 
@@ -628,6 +634,11 @@ static int cpupool_info(libxl__gc *gc,
     }
 
     info->poolid = xcinfo->cpupool_id;
+    info->pool_name = libxl_cpupoolid_to_name(CTX, info->poolid);
+    if (!info->pool_name) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
     info->sched = xcinfo->sched_id;
     info->n_dom = xcinfo->n_dom;
     rc = libxl_cpu_bitmap_alloc(CTX, &info->cpumap, 0);
@@ -4174,10 +4185,13 @@ retry_transaction:
         abort_transaction = 1;
         goto out;
     }
-    xcinfo2xlinfo(&info, &ptr);
+
+    libxl_dominfo_init(&ptr);
+    xcinfo2xlinfo(ctx, &info, &ptr);
     uuid = libxl__uuid2string(gc, ptr.uuid);
     libxl__xs_write(gc, t, libxl__sprintf(gc, "/vm/%s/memory", uuid),
             "%"PRIu32, new_target_memkb / 1024);
+    libxl_dominfo_dispose(&ptr);
 
 out:
     if (!xs_transaction_end(ctx->xsh, t, abort_transaction)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 17b8a7b..8fbfa2d 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -498,6 +498,26 @@
 #define LIBXL_EXTERNAL_CALLERS_ONLY /* disappears for callers outside libxl */
 #endif
 
+/*
+ * LIBXL_HAVE_SSID_LABEL
+ *
+ * If this is defined, then libxl IDL contains string of XSM security
+ * label in all XSM related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_SSID_LABEL 1
+
+/*
+ * LIBXL_HAVE_CPUPOOL_NAME
+ *
+ * If this is defined, then libxl IDL contains string of CPU pool
+ * name in all CPU pool related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_CPUPOOL_NAME 1
+
 typedef uint8_t libxl_mac[6];
 #define LIBXL_MAC_FMT "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"
 #define LIBXL_MAC_FMTLEN ((2*6)+5) /* 6 hex bytes plus 5 colons */
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index d015cf4..fe3bdd2 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -724,6 +724,63 @@ static void initiate_domain_create(libxl__egc *egc,
 
     domid = 0;
 
+    if (d_config->c_info.ssid_label) {
+        char *s = d_config->c_info.ssid_label;
+        ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
+                                         &d_config->c_info.ssidref);
+        if (ret) {
+            if (errno == ENOSYS) {
+                LOG(WARN, "XSM Disabled: init_seclabel not supported");
+                ret = 0;
+            } else {
+                LOG(ERROR, "Invalid init_seclabel: %s", s);
+                goto error_out;
+            }
+        }
+    }
+
+    if (d_config->b_info.exec_ssid_label) {
+        char *s = d_config->b_info.exec_ssid_label;
+        ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
+                                         &d_config->b_info.exec_ssidref);
+        if (ret) {
+            if (errno == ENOSYS) {
+                LOG(WARN, "XSM Disabled: seclabel not supported");
+                ret = 0;
+            } else {
+                LOG(ERROR, "Invalid seclabel: %s", s);
+                goto error_out;
+            }
+        }
+    }
+
+    if (d_config->b_info.device_model_ssid_label) {
+        char *s = d_config->b_info.device_model_ssid_label;
+        ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
+                                         &d_config->b_info.device_model_ssidref);
+        if (ret) {
+            if (errno == ENOSYS) {
+                LOG(WARN,"XSM Disabled: device_model_stubdomain_seclabel not supported");
+                ret = 0;
+            } else {
+                LOG(ERROR, "Invalid device_model_stubdomain_seclabel: %s", s);
+                goto error_out;
+            }
+        }
+    }
+
+    if (d_config->c_info.pool_name) {
+        d_config->c_info.poolid = -1;
+        libxl_cpupool_qualifier_to_cpupoolid(ctx, d_config->c_info.pool_name,
+                                             &d_config->c_info.poolid,
+                                             NULL);
+    }
+    if (!libxl_cpupoolid_is_valid(ctx, d_config->c_info.poolid)) {
+        LOG(ERROR, "Illegal pool specified: %s", d_config->c_info.pool_name);
+        ret = ERROR_INVAL;
+        goto error_out;
+    }
+
     /* If target_memkb is smaller than max_memkb, the subsequent call
      * to libxc when building HVM domain will enable PoD mode.
      */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 51ab2bf..addacdb 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -910,7 +910,11 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     dm_config->c_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config->c_info.name = libxl__stub_dm_name(gc,
                                     libxl__domid_to_name(gc, guest_domid));
+    /* When we are here to launch stubdom, ssidref is a valid value
+     * already, no need to parse it again.
+     */
     dm_config->c_info.ssidref = guest_config->b_info.device_model_ssidref;
+    dm_config->c_info.ssid_label = NULL;
 
     libxl_uuid_generate(&dm_config->c_info.uuid);
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index f0f6e34..1018142 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -215,6 +215,7 @@ libxl_dominfo = Struct("dominfo",[
     ("uuid",        libxl_uuid),
     ("domid",       libxl_domid),
     ("ssidref",     uint32),
+    ("ssid_label",  string),
     ("running",     bool),
     ("blocked",     bool),
     ("paused",      bool),
@@ -240,6 +241,7 @@ libxl_dominfo = Struct("dominfo",[
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
+    ("pool_name",   string),
     ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_bitmap)
@@ -270,11 +272,13 @@ libxl_domain_create_info = Struct("domain_create_info",[
     ("hap",          libxl_defbool),
     ("oos",          libxl_defbool),
     ("ssidref",      uint32),
+    ("ssid_label",   string),
     ("name",         string),
     ("uuid",         libxl_uuid),
     ("xsdata",       libxl_key_value_list),
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
+    ("pool_name",    string),
     ("run_hotplug_scripts",libxl_defbool),
     ("pvh",          libxl_defbool),
     ("driver_domain",libxl_defbool),
@@ -307,6 +311,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
     ("exec_ssidref",    uint32),
+    ("exec_ssid_label", string),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
@@ -317,6 +322,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     # if you set device_model you must set device_model_version too
     ("device_model",     string),
     ("device_model_ssidref", uint32),
+    ("device_model_ssid_label", string),
 
     # extra parameters pass directly to qemu, NULL terminated
     ("extra",            libxl_string_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 64a1c77..be041f2 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -725,35 +725,17 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
-        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
-                                    &c_info->ssidref);
-        if (e) {
-            if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
-            } else {
-                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
-                exit(1);
-            }
-        }
-    }
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0))
+        xlu_cfg_replace_string(config, "init_seclabel",
+                               &c_info->ssid_label, 0);
 
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
-        uint32_t ssidref;
-        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
-                                    &ssidref);
-        if (e) {
-            if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled: seclabel not supported\n");
-            } else {
-                fprintf(stderr, "Invalid seclabel: %s\n", buf);
-                exit(1);
-            }
-        } else if (c_info->ssidref) {
-            b_info->exec_ssidref = ssidref;
-        } else {
-            c_info->ssidref = ssidref;
-        }
+        if (c_info->ssid_label)
+            xlu_cfg_replace_string(config, "seclabel",
+                                   &b_info->exec_ssid_label, 0);
+        else
+            xlu_cfg_replace_string(config, "seclabel",
+                                   &c_info->ssid_label, 0);
     }
 
     libxl_defbool_set(&c_info->run_hotplug_scripts, run_hotplug_scripts);
@@ -781,14 +763,8 @@ static void parse_config_data(const char *config_source,
 
     xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
 
-    if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
-        c_info->poolid = -1;
-        libxl_cpupool_qualifier_to_cpupoolid(ctx, buf, &c_info->poolid, NULL);
-    }
-    if (!libxl_cpupoolid_is_valid(ctx, c_info->poolid)) {
-        fprintf(stderr, "Illegal pool specified\n");
-        exit(1);
-    }
+    if (!xlu_cfg_get_string (config, "pool", &buf, 0))
+        xlu_cfg_replace_string(config, "pool", &c_info->pool_name, 0);
 
     libxl_domain_build_info_init_type(b_info, c_info->type);
     if (blkdev_start)
@@ -1577,20 +1553,10 @@ skip_vfb:
                          &b_info->device_model_stubdomain, 0);
 
     if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
-                             &buf, 0)) {
-        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
-                                    &b_info->device_model_ssidref);
-        if (e) {
-            if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled:"
-                        " device_model_stubdomain_seclabel not supported\n");
-            } else {
-                fprintf(stderr, "Invalid device_model_stubdomain_seclabel:"
-                        " %s\n", buf);
-                exit(1);
-            }
-        }
-    }
+                             &buf, 0))
+        xlu_cfg_replace_string(config, "device_model_stubdomain_seclabel",
+                               &b_info->device_model_ssid_label, 0);
+
 #define parse_extra_args(type)                                            \
     e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
                                     &b_info->extra##type, 0);            \
@@ -3302,15 +3268,8 @@ static void list_domains(int verbose, int context, int claim, int numa,
         }
         if (claim)
             printf(" %5lu", (unsigned long)info[i].outstanding_memkb / 1024);
-        if (verbose || context) {
-            int rc;
-            size_t size;
-            char *buf = NULL;
-            rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf,
-                                            &size);
-            printf(" %16s", rc < 0 ? "-" : buf);
-            free(buf);
-        }
+        if (verbose || context)
+            printf(" %16s", info[i].ssid_label ? : "-");
         if (numa) {
             libxl_domain_get_nodeaffinity(ctx, info[i].domid, &nodemap);
 
@@ -6775,27 +6734,21 @@ int main_cpupoollist(int argc, char **argv)
 
     for (p = 0; p < n_pools; p++) {
         if (!ret && (!pool || (poolinfo[p].poolid == poolid))) {
-            name = libxl_cpupoolid_to_name(ctx, poolinfo[p].poolid);
-            if (!name) {
-                fprintf(stderr, "error getting cpupool info\n");
-                ret = -ERROR_NOMEM;
-            } else {
-                printf("%-19s", name);
-                free(name);
-                n = 0;
-                libxl_for_each_bit(c, poolinfo[p].cpumap)
-                    if (libxl_bitmap_test(&poolinfo[p].cpumap, c)) {
-                        if (n && opt_cpus) printf(",");
-                        if (opt_cpus) printf("%d", c);
-                        n++;
-                    }
-                if (!opt_cpus) {
-                    printf("%3d %9s       y       %4d", n,
-                           libxl_scheduler_to_string(poolinfo[p].sched),
-                           poolinfo[p].n_dom);
+            name = poolinfo[p].pool_name;
+            printf("%-19s", name);
+            n = 0;
+            libxl_for_each_bit(c, poolinfo[p].cpumap)
+                if (libxl_bitmap_test(&poolinfo[p].cpumap, c)) {
+                    if (n && opt_cpus) printf(",");
+                    if (opt_cpus) printf("%d", c);
+                    n++;
                 }
-                printf("\n");
+            if (!opt_cpus) {
+                printf("%3d %9s       y       %4d", n,
+                       libxl_scheduler_to_string(poolinfo[p].sched),
+                       poolinfo[p].n_dom);
             }
+            printf("\n");
         }
     }
 
diff --git a/tools/libxl/xl_sxp.c b/tools/libxl/xl_sxp.c
index a16a025..48eb608 100644
--- a/tools/libxl/xl_sxp.c
+++ b/tools/libxl/xl_sxp.c
@@ -37,7 +37,6 @@ void printf_info_sexp(int domid, libxl_domain_config *d_config)
 
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
-    char *pool;
 
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
@@ -55,10 +54,8 @@ void printf_info_sexp(int domid, libxl_domain_config *d_config)
     } else {
         printf("\t(uuid <unknown>)\n");
     }
-    pool = libxl_cpupoolid_to_name(ctx, c_info->poolid);
-    if (pool)
-        printf("\t(cpupool %s)\n", pool);
-    free(pool);
+    if (c_info->pool_name)
+        printf("\t(cpupool %s)\n", c_info->pool_name);
     if (c_info->xsdata)
         printf("\t(xsdata contains data)\n");
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:24 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHY-0007Fp-0k; Sun, 22 Jun 2014 18:14:24 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHV-0007FT-IN
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:21 +0000
Received: from [193.109.254.147:46086] by server-4.bemta-14.messagelabs.com id
	7C/EF-02781-CFC17A35; Sun, 22 Jun 2014 18:14:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-27.messagelabs.com!1403460858!12877475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27064 invoked from network); 22 Jun 2014 18:14:19 -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 Jun 2014 18:14:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHS-0000Ff-5U
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHS-0007jQ-3s
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:18 +0000
Date: Sun, 22 Jun 2014 18:14:18 +0000
Message-Id: <E1WymHS-0007jQ-3s@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xl / libxl: push parsing of SSID and
	CPU pool ID down to libxl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ab4440112bec31d066df97eab5a0625076e8790a
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jun 17 10:32:21 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:07:41 2014 +0100

    xl / libxl: push parsing of SSID and CPU pool ID down to libxl
    
    This patch pushes parsing of "init_seclabel", "seclabel",
    "device_model_stubdomain_seclabel" and "pool" down to libxl level.
    
    Originally the parsing is done in xl level, which is not ideal because
    libxl won't have the truely relevant information. With this patch libxl
    holds important information by itself.
    
    The libxl IDL is extended to hold the string of labels and pool name.
    And if there those strings are present they take precedence over the
    numeric representations.
    
    As all relevant structures (libxl_dominfo etc) have a field called
    X_name / X_label now, a string is also copied there so that callers
    won't have to do ID to name / label translation.
    
    In order to be compatible with users of older versions of libxl, this
    patch also defines LIBXL_HAVE_SSID_LABEL and LIBXL_HAVE_CPUPOOL_NAME. If
    they are defined, the respective strings are available. And if those
    strings are not NULL, libxl will do the parsing and ignore the numeric
    values.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Cc: Dario Faggioli <dario.faggioli@citrix.com>
    Cc: Juergen Gross <jgross@suse.com>
    Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c         |   22 +++++++--
 tools/libxl/libxl.h         |   20 ++++++++
 tools/libxl/libxl_create.c  |   57 +++++++++++++++++++++++
 tools/libxl/libxl_dm.c      |    4 ++
 tools/libxl/libxl_types.idl |    6 ++
 tools/libxl/xl_cmdimpl.c    |  107 ++++++++++++-------------------------------
 tools/libxl/xl_sxp.c        |    7 +--
 7 files changed, 137 insertions(+), 86 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 9054c3b..b3dca0c 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -529,12 +529,18 @@ int libxl_domain_preserve(libxl_ctx *ctx, uint32_t domid,
     return 0;
 }
 
-static void xcinfo2xlinfo(const xc_domaininfo_t *xcinfo,
+static void xcinfo2xlinfo(libxl_ctx *ctx,
+                          const xc_domaininfo_t *xcinfo,
                           libxl_dominfo *xlinfo)
 {
+    size_t size;
+
     memcpy(&(xlinfo->uuid), xcinfo->handle, sizeof(xen_domain_handle_t));
     xlinfo->domid = xcinfo->domain;
     xlinfo->ssidref = xcinfo->ssidref;
+    if (libxl_flask_sid_to_context(ctx, xlinfo->ssidref,
+                                   &xlinfo->ssid_label, &size) < 0)
+        xlinfo->ssid_label = NULL;
 
     xlinfo->dying    = !!(xcinfo->flags&XEN_DOMINF_dying);
     xlinfo->shutdown = !!(xcinfo->flags&XEN_DOMINF_shutdown);
@@ -581,7 +587,7 @@ libxl_dominfo * libxl_list_domain(libxl_ctx *ctx, int *nb_domain_out)
     }
 
     for (i = 0; i < ret; i++) {
-        xcinfo2xlinfo(&info[i], &ptr[i]);
+        xcinfo2xlinfo(ctx, &info[i], &ptr[i]);
     }
     *nb_domain_out = ret;
     return ptr;
@@ -600,7 +606,7 @@ int libxl_domain_info(libxl_ctx *ctx, libxl_dominfo *info_r,
     if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;
 
     if (info_r)
-        xcinfo2xlinfo(&xcinfo, info_r);
+        xcinfo2xlinfo(ctx, &xcinfo, info_r);
     return 0;
 }
 
@@ -628,6 +634,11 @@ static int cpupool_info(libxl__gc *gc,
     }
 
     info->poolid = xcinfo->cpupool_id;
+    info->pool_name = libxl_cpupoolid_to_name(CTX, info->poolid);
+    if (!info->pool_name) {
+        rc = ERROR_FAIL;
+        goto out;
+    }
     info->sched = xcinfo->sched_id;
     info->n_dom = xcinfo->n_dom;
     rc = libxl_cpu_bitmap_alloc(CTX, &info->cpumap, 0);
@@ -4174,10 +4185,13 @@ retry_transaction:
         abort_transaction = 1;
         goto out;
     }
-    xcinfo2xlinfo(&info, &ptr);
+
+    libxl_dominfo_init(&ptr);
+    xcinfo2xlinfo(ctx, &info, &ptr);
     uuid = libxl__uuid2string(gc, ptr.uuid);
     libxl__xs_write(gc, t, libxl__sprintf(gc, "/vm/%s/memory", uuid),
             "%"PRIu32, new_target_memkb / 1024);
+    libxl_dominfo_dispose(&ptr);
 
 out:
     if (!xs_transaction_end(ctx->xsh, t, abort_transaction)
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 17b8a7b..8fbfa2d 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -498,6 +498,26 @@
 #define LIBXL_EXTERNAL_CALLERS_ONLY /* disappears for callers outside libxl */
 #endif
 
+/*
+ * LIBXL_HAVE_SSID_LABEL
+ *
+ * If this is defined, then libxl IDL contains string of XSM security
+ * label in all XSM related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_SSID_LABEL 1
+
+/*
+ * LIBXL_HAVE_CPUPOOL_NAME
+ *
+ * If this is defined, then libxl IDL contains string of CPU pool
+ * name in all CPU pool related structures.
+ *
+ * If set this string takes precedence over the numeric field.
+ */
+#define LIBXL_HAVE_CPUPOOL_NAME 1
+
 typedef uint8_t libxl_mac[6];
 #define LIBXL_MAC_FMT "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx"
 #define LIBXL_MAC_FMTLEN ((2*6)+5) /* 6 hex bytes plus 5 colons */
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index d015cf4..fe3bdd2 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -724,6 +724,63 @@ static void initiate_domain_create(libxl__egc *egc,
 
     domid = 0;
 
+    if (d_config->c_info.ssid_label) {
+        char *s = d_config->c_info.ssid_label;
+        ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
+                                         &d_config->c_info.ssidref);
+        if (ret) {
+            if (errno == ENOSYS) {
+                LOG(WARN, "XSM Disabled: init_seclabel not supported");
+                ret = 0;
+            } else {
+                LOG(ERROR, "Invalid init_seclabel: %s", s);
+                goto error_out;
+            }
+        }
+    }
+
+    if (d_config->b_info.exec_ssid_label) {
+        char *s = d_config->b_info.exec_ssid_label;
+        ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
+                                         &d_config->b_info.exec_ssidref);
+        if (ret) {
+            if (errno == ENOSYS) {
+                LOG(WARN, "XSM Disabled: seclabel not supported");
+                ret = 0;
+            } else {
+                LOG(ERROR, "Invalid seclabel: %s", s);
+                goto error_out;
+            }
+        }
+    }
+
+    if (d_config->b_info.device_model_ssid_label) {
+        char *s = d_config->b_info.device_model_ssid_label;
+        ret = libxl_flask_context_to_sid(ctx, s, strlen(s),
+                                         &d_config->b_info.device_model_ssidref);
+        if (ret) {
+            if (errno == ENOSYS) {
+                LOG(WARN,"XSM Disabled: device_model_stubdomain_seclabel not supported");
+                ret = 0;
+            } else {
+                LOG(ERROR, "Invalid device_model_stubdomain_seclabel: %s", s);
+                goto error_out;
+            }
+        }
+    }
+
+    if (d_config->c_info.pool_name) {
+        d_config->c_info.poolid = -1;
+        libxl_cpupool_qualifier_to_cpupoolid(ctx, d_config->c_info.pool_name,
+                                             &d_config->c_info.poolid,
+                                             NULL);
+    }
+    if (!libxl_cpupoolid_is_valid(ctx, d_config->c_info.poolid)) {
+        LOG(ERROR, "Illegal pool specified: %s", d_config->c_info.pool_name);
+        ret = ERROR_INVAL;
+        goto error_out;
+    }
+
     /* If target_memkb is smaller than max_memkb, the subsequent call
      * to libxc when building HVM domain will enable PoD mode.
      */
diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
index 51ab2bf..addacdb 100644
--- a/tools/libxl/libxl_dm.c
+++ b/tools/libxl/libxl_dm.c
@@ -910,7 +910,11 @@ void libxl__spawn_stub_dm(libxl__egc *egc, libxl__stub_dm_spawn_state *sdss)
     dm_config->c_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config->c_info.name = libxl__stub_dm_name(gc,
                                     libxl__domid_to_name(gc, guest_domid));
+    /* When we are here to launch stubdom, ssidref is a valid value
+     * already, no need to parse it again.
+     */
     dm_config->c_info.ssidref = guest_config->b_info.device_model_ssidref;
+    dm_config->c_info.ssid_label = NULL;
 
     libxl_uuid_generate(&dm_config->c_info.uuid);
 
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index f0f6e34..1018142 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -215,6 +215,7 @@ libxl_dominfo = Struct("dominfo",[
     ("uuid",        libxl_uuid),
     ("domid",       libxl_domid),
     ("ssidref",     uint32),
+    ("ssid_label",  string),
     ("running",     bool),
     ("blocked",     bool),
     ("paused",      bool),
@@ -240,6 +241,7 @@ libxl_dominfo = Struct("dominfo",[
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
+    ("pool_name",   string),
     ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_bitmap)
@@ -270,11 +272,13 @@ libxl_domain_create_info = Struct("domain_create_info",[
     ("hap",          libxl_defbool),
     ("oos",          libxl_defbool),
     ("ssidref",      uint32),
+    ("ssid_label",   string),
     ("name",         string),
     ("uuid",         libxl_uuid),
     ("xsdata",       libxl_key_value_list),
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
+    ("pool_name",    string),
     ("run_hotplug_scripts",libxl_defbool),
     ("pvh",          libxl_defbool),
     ("driver_domain",libxl_defbool),
@@ -307,6 +311,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("shadow_memkb",    MemKB),
     ("rtc_timeoffset",  uint32),
     ("exec_ssidref",    uint32),
+    ("exec_ssid_label", string),
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
@@ -317,6 +322,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     # if you set device_model you must set device_model_version too
     ("device_model",     string),
     ("device_model_ssidref", uint32),
+    ("device_model_ssid_label", string),
 
     # extra parameters pass directly to qemu, NULL terminated
     ("extra",            libxl_string_list),
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
index 64a1c77..be041f2 100644
--- a/tools/libxl/xl_cmdimpl.c
+++ b/tools/libxl/xl_cmdimpl.c
@@ -725,35 +725,17 @@ static void parse_config_data(const char *config_source,
         exit(1);
     }
 
-    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0)) {
-        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
-                                    &c_info->ssidref);
-        if (e) {
-            if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled: init_seclabel not supported\n");
-            } else {
-                fprintf(stderr, "Invalid init_seclabel: %s\n", buf);
-                exit(1);
-            }
-        }
-    }
+    if (!xlu_cfg_get_string (config, "init_seclabel", &buf, 0))
+        xlu_cfg_replace_string(config, "init_seclabel",
+                               &c_info->ssid_label, 0);
 
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
-        uint32_t ssidref;
-        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
-                                    &ssidref);
-        if (e) {
-            if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled: seclabel not supported\n");
-            } else {
-                fprintf(stderr, "Invalid seclabel: %s\n", buf);
-                exit(1);
-            }
-        } else if (c_info->ssidref) {
-            b_info->exec_ssidref = ssidref;
-        } else {
-            c_info->ssidref = ssidref;
-        }
+        if (c_info->ssid_label)
+            xlu_cfg_replace_string(config, "seclabel",
+                                   &b_info->exec_ssid_label, 0);
+        else
+            xlu_cfg_replace_string(config, "seclabel",
+                                   &c_info->ssid_label, 0);
     }
 
     libxl_defbool_set(&c_info->run_hotplug_scripts, run_hotplug_scripts);
@@ -781,14 +763,8 @@ static void parse_config_data(const char *config_source,
 
     xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
 
-    if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
-        c_info->poolid = -1;
-        libxl_cpupool_qualifier_to_cpupoolid(ctx, buf, &c_info->poolid, NULL);
-    }
-    if (!libxl_cpupoolid_is_valid(ctx, c_info->poolid)) {
-        fprintf(stderr, "Illegal pool specified\n");
-        exit(1);
-    }
+    if (!xlu_cfg_get_string (config, "pool", &buf, 0))
+        xlu_cfg_replace_string(config, "pool", &c_info->pool_name, 0);
 
     libxl_domain_build_info_init_type(b_info, c_info->type);
     if (blkdev_start)
@@ -1577,20 +1553,10 @@ skip_vfb:
                          &b_info->device_model_stubdomain, 0);
 
     if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
-                             &buf, 0)) {
-        e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
-                                    &b_info->device_model_ssidref);
-        if (e) {
-            if (errno == ENOSYS) {
-                fprintf(stderr, "XSM Disabled:"
-                        " device_model_stubdomain_seclabel not supported\n");
-            } else {
-                fprintf(stderr, "Invalid device_model_stubdomain_seclabel:"
-                        " %s\n", buf);
-                exit(1);
-            }
-        }
-    }
+                             &buf, 0))
+        xlu_cfg_replace_string(config, "device_model_stubdomain_seclabel",
+                               &b_info->device_model_ssid_label, 0);
+
 #define parse_extra_args(type)                                            \
     e = xlu_cfg_get_list_as_string_list(config, "device_model_args"#type, \
                                     &b_info->extra##type, 0);            \
@@ -3302,15 +3268,8 @@ static void list_domains(int verbose, int context, int claim, int numa,
         }
         if (claim)
             printf(" %5lu", (unsigned long)info[i].outstanding_memkb / 1024);
-        if (verbose || context) {
-            int rc;
-            size_t size;
-            char *buf = NULL;
-            rc = libxl_flask_sid_to_context(ctx, info[i].ssidref, &buf,
-                                            &size);
-            printf(" %16s", rc < 0 ? "-" : buf);
-            free(buf);
-        }
+        if (verbose || context)
+            printf(" %16s", info[i].ssid_label ? : "-");
         if (numa) {
             libxl_domain_get_nodeaffinity(ctx, info[i].domid, &nodemap);
 
@@ -6775,27 +6734,21 @@ int main_cpupoollist(int argc, char **argv)
 
     for (p = 0; p < n_pools; p++) {
         if (!ret && (!pool || (poolinfo[p].poolid == poolid))) {
-            name = libxl_cpupoolid_to_name(ctx, poolinfo[p].poolid);
-            if (!name) {
-                fprintf(stderr, "error getting cpupool info\n");
-                ret = -ERROR_NOMEM;
-            } else {
-                printf("%-19s", name);
-                free(name);
-                n = 0;
-                libxl_for_each_bit(c, poolinfo[p].cpumap)
-                    if (libxl_bitmap_test(&poolinfo[p].cpumap, c)) {
-                        if (n && opt_cpus) printf(",");
-                        if (opt_cpus) printf("%d", c);
-                        n++;
-                    }
-                if (!opt_cpus) {
-                    printf("%3d %9s       y       %4d", n,
-                           libxl_scheduler_to_string(poolinfo[p].sched),
-                           poolinfo[p].n_dom);
+            name = poolinfo[p].pool_name;
+            printf("%-19s", name);
+            n = 0;
+            libxl_for_each_bit(c, poolinfo[p].cpumap)
+                if (libxl_bitmap_test(&poolinfo[p].cpumap, c)) {
+                    if (n && opt_cpus) printf(",");
+                    if (opt_cpus) printf("%d", c);
+                    n++;
                 }
-                printf("\n");
+            if (!opt_cpus) {
+                printf("%3d %9s       y       %4d", n,
+                       libxl_scheduler_to_string(poolinfo[p].sched),
+                       poolinfo[p].n_dom);
             }
+            printf("\n");
         }
     }
 
diff --git a/tools/libxl/xl_sxp.c b/tools/libxl/xl_sxp.c
index a16a025..48eb608 100644
--- a/tools/libxl/xl_sxp.c
+++ b/tools/libxl/xl_sxp.c
@@ -37,7 +37,6 @@ void printf_info_sexp(int domid, libxl_domain_config *d_config)
 
     libxl_domain_create_info *c_info = &d_config->c_info;
     libxl_domain_build_info *b_info = &d_config->b_info;
-    char *pool;
 
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
@@ -55,10 +54,8 @@ void printf_info_sexp(int domid, libxl_domain_config *d_config)
     } else {
         printf("\t(uuid <unknown>)\n");
     }
-    pool = libxl_cpupoolid_to_name(ctx, c_info->poolid);
-    if (pool)
-        printf("\t(cpupool %s)\n", pool);
-    free(pool);
+    if (c_info->pool_name)
+        printf("\t(cpupool %s)\n", c_info->pool_name);
     if (c_info->xsdata)
         printf("\t(xsdata contains data)\n");
     else
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHg-0007H3-3N; Sun, 22 Jun 2014 18:14:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHf-0007Gr-43
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:31 +0000
Received: from [85.158.137.68:3893] by server-17.bemta-3.messagelabs.com id
	13/DC-22741-60D17A35; Sun, 22 Jun 2014 18:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403460868!11634371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2888 invoked from network); 22 Jun 2014 18:14:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHc-0000Fl-Ar
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHc-0007jq-9n
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:28 +0000
Date: Sun, 22 Jun 2014 18:14:28 +0000
Message-Id: <E1WymHc-0007jq-9n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: libxl_uuid_copy now takes a ctx
	argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6276f66ebe39f0b23880a6d4b82d5fb76b9f58e5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jun 17 10:32:22 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:07:41 2014 +0100

    libxl: libxl_uuid_copy now takes a ctx argument
    
    Make it consistent with existing libxl functions like libxl_bitmap_copy
    etc.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c        |    2 +-
 tools/libxl/libxl.h        |   14 +++++++++++---
 tools/libxl/libxl_create.c |    2 +-
 tools/libxl/libxl_utils.c  |    2 +-
 tools/libxl/libxl_uuid.c   |    8 ++++----
 tools/libxl/libxl_uuid.h   |    7 ++++++-
 6 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index b3dca0c..62e251a 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2019,7 +2019,7 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
         if(devid == vtpms[i].devid) {
             vtpm->backend_domid = vtpms[i].backend_domid;
             vtpm->devid = vtpms[i].devid;
-            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            libxl_uuid_copy(ctx, &vtpm->uuid, &vtpms[i].uuid);
             rc = 0;
             break;
         }
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 8fbfa2d..69ceac8 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -319,13 +319,15 @@
 
 #include <xentoollog.h>
 
+typedef struct libxl__ctx libxl_ctx;
+
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
 /* API compatibility. */
 #ifdef LIBXL_API_VERSION
 #if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
-    LIBXL_API_VERSION != 0x040400
+    LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -499,6 +501,14 @@
 #endif
 
 /*
+ *  LIBXL_HAVE_UUID_COPY_CTX_PARAM
+ *
+ * If this is defined, libxl_uuid_copy has changed to take a libxl_ctx
+ * structure.
+ */
+#define LIBXL_HAVE_UUID_COPY_CTX_PARAM 1
+
+/*
  * LIBXL_HAVE_SSID_LABEL
  *
  * If this is defined, then libxl IDL contains string of XSM security
@@ -594,8 +604,6 @@ bool libxl_defbool_val(libxl_defbool db);
 
 const char *libxl_defbool_to_string(libxl_defbool b);
 
-typedef struct libxl__ctx libxl_ctx;
-
 #define LIBXL_TIMER_MODE_DEFAULT -1
 #define LIBXL_MEMKB_DEFAULT ~0ULL
 
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index fe3bdd2..da1517c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -479,7 +479,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
     *domid = -1;
 
     /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
-    libxl_uuid_copy((libxl_uuid *)handle, &info->uuid);
+    libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid);
 
     ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
     if (ret < 0) {
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 476921e..16b734e 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -536,7 +536,7 @@ int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
         if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
             vtpm->backend_domid = vtpms[i].backend_domid;
             vtpm->devid = vtpms[i].devid;
-            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            libxl_uuid_copy(ctx, &vtpm->uuid, &vtpms[i].uuid);
             rc = 0;
             break;
         }
diff --git a/tools/libxl/libxl_uuid.c b/tools/libxl/libxl_uuid.c
index 6591cb7..172b7d1 100644
--- a/tools/libxl/libxl_uuid.c
+++ b/tools/libxl/libxl_uuid.c
@@ -14,8 +14,6 @@
 
 #include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <libxl_uuid.h>
-
 #include "libxl_internal.h"
 
 #if defined(__linux__)
@@ -35,7 +33,8 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
      return uuid_parse(in, uuid->uuid);
 }
 
-void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src)
+void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
+                     const libxl_uuid *src)
 {
      uuid_copy(dst->uuid, src->uuid);
 }
@@ -87,7 +86,8 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
 }
 #undef LIBXL__UUID_PTRS
 
-void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src)
+void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
+                     const libxl_uuid *src)
 {
      memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
 }
diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index fbde7b6..0c2a1e7 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -56,7 +56,12 @@ typedef struct {
 int libxl_uuid_is_nil(const libxl_uuid *uuid);
 void libxl_uuid_generate(libxl_uuid *uuid);
 int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
-void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src);
+void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
+                     const libxl_uuid *src);
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
+void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
+#endif
+
 void libxl_uuid_clear(libxl_uuid *uuid);
 int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2);
 const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHg-0007H3-3N; Sun, 22 Jun 2014 18:14:32 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHf-0007Gr-43
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:31 +0000
Received: from [85.158.137.68:3893] by server-17.bemta-3.messagelabs.com id
	13/DC-22741-60D17A35; Sun, 22 Jun 2014 18:14:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403460868!11634371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2888 invoked from network); 22 Jun 2014 18:14:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHc-0000Fl-Ar
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHc-0007jq-9n
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:28 +0000
Date: Sun, 22 Jun 2014 18:14:28 +0000
Message-Id: <E1WymHc-0007jq-9n@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: libxl_uuid_copy now takes a ctx
	argument
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6276f66ebe39f0b23880a6d4b82d5fb76b9f58e5
Author:     Wei Liu <wei.liu2@citrix.com>
AuthorDate: Tue Jun 17 10:32:22 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 15:07:41 2014 +0100

    libxl: libxl_uuid_copy now takes a ctx argument
    
    Make it consistent with existing libxl functions like libxl_bitmap_copy
    etc.
    
    Signed-off-by: Wei Liu <wei.liu2@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/libxl.c        |    2 +-
 tools/libxl/libxl.h        |   14 +++++++++++---
 tools/libxl/libxl_create.c |    2 +-
 tools/libxl/libxl_utils.c  |    2 +-
 tools/libxl/libxl_uuid.c   |    8 ++++----
 tools/libxl/libxl_uuid.h   |    7 ++++++-
 6 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index b3dca0c..62e251a 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -2019,7 +2019,7 @@ int libxl_devid_to_device_vtpm(libxl_ctx *ctx,
         if(devid == vtpms[i].devid) {
             vtpm->backend_domid = vtpms[i].backend_domid;
             vtpm->devid = vtpms[i].devid;
-            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            libxl_uuid_copy(ctx, &vtpm->uuid, &vtpms[i].uuid);
             rc = 0;
             break;
         }
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 8fbfa2d..69ceac8 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -319,13 +319,15 @@
 
 #include <xentoollog.h>
 
+typedef struct libxl__ctx libxl_ctx;
+
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
 /* API compatibility. */
 #ifdef LIBXL_API_VERSION
 #if LIBXL_API_VERSION != 0x040200 && LIBXL_API_VERSION != 0x040300 && \
-    LIBXL_API_VERSION != 0x040400
+    LIBXL_API_VERSION != 0x040400 && LIBXL_API_VERSION != 0x040500
 #error Unknown LIBXL_API_VERSION
 #endif
 #endif
@@ -499,6 +501,14 @@
 #endif
 
 /*
+ *  LIBXL_HAVE_UUID_COPY_CTX_PARAM
+ *
+ * If this is defined, libxl_uuid_copy has changed to take a libxl_ctx
+ * structure.
+ */
+#define LIBXL_HAVE_UUID_COPY_CTX_PARAM 1
+
+/*
  * LIBXL_HAVE_SSID_LABEL
  *
  * If this is defined, then libxl IDL contains string of XSM security
@@ -594,8 +604,6 @@ bool libxl_defbool_val(libxl_defbool db);
 
 const char *libxl_defbool_to_string(libxl_defbool b);
 
-typedef struct libxl__ctx libxl_ctx;
-
 #define LIBXL_TIMER_MODE_DEFAULT -1
 #define LIBXL_MEMKB_DEFAULT ~0ULL
 
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index fe3bdd2..da1517c 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -479,7 +479,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_create_info *info,
     *domid = -1;
 
     /* Ultimately, handle is an array of 16 uint8_t, same as uuid */
-    libxl_uuid_copy((libxl_uuid *)handle, &info->uuid);
+    libxl_uuid_copy(ctx, (libxl_uuid *)handle, &info->uuid);
 
     ret = xc_domain_create(ctx->xch, info->ssidref, handle, flags, domid);
     if (ret < 0) {
diff --git a/tools/libxl/libxl_utils.c b/tools/libxl/libxl_utils.c
index 476921e..16b734e 100644
--- a/tools/libxl/libxl_utils.c
+++ b/tools/libxl/libxl_utils.c
@@ -536,7 +536,7 @@ int libxl_uuid_to_device_vtpm(libxl_ctx *ctx, uint32_t domid,
         if(!libxl_uuid_compare(uuid, &vtpms[i].uuid)) {
             vtpm->backend_domid = vtpms[i].backend_domid;
             vtpm->devid = vtpms[i].devid;
-            libxl_uuid_copy(&vtpm->uuid, &vtpms[i].uuid);
+            libxl_uuid_copy(ctx, &vtpm->uuid, &vtpms[i].uuid);
             rc = 0;
             break;
         }
diff --git a/tools/libxl/libxl_uuid.c b/tools/libxl/libxl_uuid.c
index 6591cb7..172b7d1 100644
--- a/tools/libxl/libxl_uuid.c
+++ b/tools/libxl/libxl_uuid.c
@@ -14,8 +14,6 @@
 
 #include "libxl_osdeps.h" /* must come before any other headers */
 
-#include <libxl_uuid.h>
-
 #include "libxl_internal.h"
 
 #if defined(__linux__)
@@ -35,7 +33,8 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
      return uuid_parse(in, uuid->uuid);
 }
 
-void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src)
+void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
+                     const libxl_uuid *src)
 {
      uuid_copy(dst->uuid, src->uuid);
 }
@@ -87,7 +86,8 @@ int libxl_uuid_from_string(libxl_uuid *uuid, const char *in)
 }
 #undef LIBXL__UUID_PTRS
 
-void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src)
+void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
+                     const libxl_uuid *src)
 {
      memcpy(dst->uuid, src->uuid, sizeof(dst->uuid));
 }
diff --git a/tools/libxl/libxl_uuid.h b/tools/libxl/libxl_uuid.h
index fbde7b6..0c2a1e7 100644
--- a/tools/libxl/libxl_uuid.h
+++ b/tools/libxl/libxl_uuid.h
@@ -56,7 +56,12 @@ typedef struct {
 int libxl_uuid_is_nil(const libxl_uuid *uuid);
 void libxl_uuid_generate(libxl_uuid *uuid);
 int libxl_uuid_from_string(libxl_uuid *uuid, const char *in);
-void libxl_uuid_copy(libxl_uuid *dst, const libxl_uuid *src);
+void libxl_uuid_copy(libxl_ctx *ctx_opt, libxl_uuid *dst,
+                     const libxl_uuid *src);
+#if defined(LIBXL_API_VERSION) && LIBXL_API_VERSION < 0x040500
+void libxl_uuid_copy(dst, src) libxl_uuid_copy(NULL, dst, src)
+#endif
+
 void libxl_uuid_clear(libxl_uuid *uuid);
 int libxl_uuid_compare(const libxl_uuid *uuid1, const libxl_uuid *uuid2);
 const uint8_t *libxl_uuid_bytearray_const(const libxl_uuid *uuid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHq-0007J3-7x; Sun, 22 Jun 2014 18:14:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHp-0007Ij-6H
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:41 +0000
Received: from [85.158.139.211:52508] by server-13.bemta-5.messagelabs.com id
	24/33-02995-01D17A35; Sun, 22 Jun 2014 18:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403460878!8430337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28755 invoked from network); 22 Jun 2014 18:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHm-0000Fr-Fs
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHm-0007kk-De
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:38 +0000
Date: Sun, 22 Jun 2014 18:14:38 +0000
Message-Id: <E1WymHm-0007kk-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/pygrub: Fix extlinux when /boot
	is a separate partition from /
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c12e5b7427b4dfd2dfabf21f6b0e6e24bc8e864
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 11 19:31:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:48 2014 +0100

    tools/pygrub: Fix extlinux when /boot is a separate partition from /
    
    Grub and Grub2 already cope with this.
    
    Reported-by: Joseph Hom <jhom@softlayer.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/pygrub/src/pygrub |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 4c35f9d..a4a2423 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -418,7 +418,9 @@ class Grub:
                    map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
                        ["/boot/isolinux/isolinux.cfg",
                         "/boot/extlinux/extlinux.conf",
-                        "/boot/extlinux.conf"]) + \
+                        "/boot/extlinux.conf",
+                        "/extlinux/extlinux.conf",
+                        "/extlinux.conf"]) + \
                    map(lambda x: (x,grub.GrubConf.GrubConfigFile),
                        ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
                         "/grub/menu.lst", "/grub/grub.conf"])
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymHq-0007J3-7x; Sun, 22 Jun 2014 18:14:42 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHp-0007Ij-6H
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:41 +0000
Received: from [85.158.139.211:52508] by server-13.bemta-5.messagelabs.com id
	24/33-02995-01D17A35; Sun, 22 Jun 2014 18:14:40 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403460878!8430337!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28755 invoked from network); 22 Jun 2014 18:14:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHm-0000Fr-Fs
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHm-0007kk-De
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:38 +0000
Date: Sun, 22 Jun 2014 18:14:38 +0000
Message-Id: <E1WymHm-0007kk-De@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/pygrub: Fix extlinux when /boot
	is a separate partition from /
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c12e5b7427b4dfd2dfabf21f6b0e6e24bc8e864
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 11 19:31:55 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:48 2014 +0100

    tools/pygrub: Fix extlinux when /boot is a separate partition from /
    
    Grub and Grub2 already cope with this.
    
    Reported-by: Joseph Hom <jhom@softlayer.com>
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/pygrub/src/pygrub |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub
index 4c35f9d..a4a2423 100644
--- a/tools/pygrub/src/pygrub
+++ b/tools/pygrub/src/pygrub
@@ -418,7 +418,9 @@ class Grub:
                    map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
                        ["/boot/isolinux/isolinux.cfg",
                         "/boot/extlinux/extlinux.conf",
-                        "/boot/extlinux.conf"]) + \
+                        "/boot/extlinux.conf",
+                        "/extlinux/extlinux.conf",
+                        "/extlinux.conf"]) + \
                    map(lambda x: (x,grub.GrubConf.GrubConfigFile),
                        ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
                         "/grub/menu.lst", "/grub/grub.conf"])
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymI0-0007Ke-Ak; Sun, 22 Jun 2014 18:14:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHz-0007KS-Ox
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:51 +0000
Received: from [85.158.139.211:52808] by server-6.bemta-5.messagelabs.com id
	B6/0A-25531-B1D17A35; Sun, 22 Jun 2014 18:14:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1403460888!5909566!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28590 invoked from network); 22 Jun 2014 18:14:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHw-0000Fx-Jj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHw-0007l9-Ic
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:48 +0000
Date: Sun, 22 Jun 2014 18:14:48 +0000
Message-Id: <E1WymHw-0007l9-Ic@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: rename vgic_irq_rank to
	vgic_rank_offset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3729baff6ce5b5ff73ec0343e6913ccf6170eaf8
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jun 11 17:27:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:48 2014 +0100

    xen/arm: rename vgic_irq_rank to vgic_rank_offset
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index cb8df3a..f8cb3d5 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -61,7 +61,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
  * Returns rank corresponding to a GICD_<FOO><n> register for
  * GICD_<FOO> with <b>-bits-per-interrupt.
  */
-static struct vgic_irq_rank *vgic_irq_rank(struct vcpu *v, int b, int n)
+static struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n)
 {
     int rank = REG_RANK_NR(b, n);
 
@@ -216,7 +216,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -225,7 +225,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -234,7 +234,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -243,7 +243,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -252,7 +252,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -261,7 +261,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -270,7 +270,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ITARGETSR ... GICD_ITARGETSRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ITARGETSR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR);
         if ( rank == NULL) goto read_as_zero;
 
         vgic_lock_rank(v, rank);
@@ -282,7 +282,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_IPRIORITYR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR);
         if ( rank == NULL) goto read_as_zero;
 
         vgic_lock_rank(v, rank);
@@ -294,7 +294,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICFGR ... GICD_ICFGRN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 2, gicd_reg - GICD_ICFGR);
+        rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR)];
@@ -313,7 +313,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_CPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -322,7 +322,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_SPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -526,7 +526,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         tr = rank->ienable;
@@ -537,7 +537,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         tr = rank->ienable;
@@ -560,7 +560,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
@@ -569,7 +569,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
@@ -582,7 +582,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ITARGETSR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         if ( dabt.size == 2 )
@@ -595,7 +595,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_IPRIORITYR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         if ( dabt.size == 2 )
@@ -613,7 +613,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
     case GICD_ICFGR + 2 ... GICD_ICFGRN: /* SPIs */
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 2, gicd_reg - GICD_ICFGR);
+        rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR)] = *r;
@@ -720,7 +720,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 {
     int idx = irq >> 2, byte = irq & 0x3;
     uint8_t priority;
-    struct vgic_irq_rank *rank = vgic_irq_rank(v, 8, idx);
+    struct vgic_irq_rank *rank = vgic_rank_offset(v, 8, idx);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
     bool_t running;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:14:52 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:14:52 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymI0-0007Ke-Ak; Sun, 22 Jun 2014 18:14:52 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHz-0007KS-Ox
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:51 +0000
Received: from [85.158.139.211:52808] by server-6.bemta-5.messagelabs.com id
	B6/0A-25531-B1D17A35; Sun, 22 Jun 2014 18:14:51 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1403460888!5909566!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28590 invoked from network); 22 Jun 2014 18:14:49 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:49 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHw-0000Fx-Jj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:48 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymHw-0007l9-Ic
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:48 +0000
Date: Sun, 22 Jun 2014 18:14:48 +0000
Message-Id: <E1WymHw-0007l9-Ic@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: rename vgic_irq_rank to
	vgic_rank_offset
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3729baff6ce5b5ff73ec0343e6913ccf6170eaf8
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jun 11 17:27:07 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:48 2014 +0100

    xen/arm: rename vgic_irq_rank to vgic_rank_offset
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index cb8df3a..f8cb3d5 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -61,7 +61,7 @@ static inline int REG_RANK_NR(int b, uint32_t n)
  * Returns rank corresponding to a GICD_<FOO><n> register for
  * GICD_<FOO> with <b>-bits-per-interrupt.
  */
-static struct vgic_irq_rank *vgic_irq_rank(struct vcpu *v, int b, int n)
+static struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n)
 {
     int rank = REG_RANK_NR(b, n);
 
@@ -216,7 +216,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -225,7 +225,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->ienable;
@@ -234,7 +234,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISPENDR ... GICD_ISPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISPENDR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -243,7 +243,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICPENDR ... GICD_ICPENDRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICPENDR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICPENDR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->ipend, dabt.sign, offset);
@@ -252,7 +252,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -261,7 +261,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->iactive;
@@ -270,7 +270,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ITARGETSR ... GICD_ITARGETSRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ITARGETSR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR);
         if ( rank == NULL) goto read_as_zero;
 
         vgic_lock_rank(v, rank);
@@ -282,7 +282,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_IPRIORITYR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR);
         if ( rank == NULL) goto read_as_zero;
 
         vgic_lock_rank(v, rank);
@@ -294,7 +294,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICFGR ... GICD_ICFGRN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 2, gicd_reg - GICD_ICFGR);
+        rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR)];
@@ -313,7 +313,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_CPENDSGIR ... GICD_CPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_CPENDSGIR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_CPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -322,7 +322,7 @@ static int vgic_distr_mmio_read(struct vcpu *v, mmio_info_t *info)
 
     case GICD_SPENDSGIR ... GICD_SPENDSGIRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_SPENDSGIR);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_SPENDSGIR);
         if ( rank == NULL) goto read_as_zero;
         vgic_lock_rank(v, rank);
         *r = byte_read(rank->pendsgi, dabt.sign, offset);
@@ -526,7 +526,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISENABLER ... GICD_ISENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         tr = rank->ienable;
@@ -537,7 +537,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICENABLER ... GICD_ICENABLERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICENABLER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICENABLER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         tr = rank->ienable;
@@ -560,7 +560,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ISACTIVER ... GICD_ISACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ISACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ISACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
@@ -569,7 +569,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ICACTIVER ... GICD_ICACTIVERN:
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 1, gicd_reg - GICD_ICACTIVER);
+        rank = vgic_rank_offset(v, 1, gicd_reg - GICD_ICACTIVER);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->iactive &= ~*r;
@@ -582,7 +582,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_ITARGETSR + 8 ... GICD_ITARGETSRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_ITARGETSR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_ITARGETSR);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         if ( dabt.size == 2 )
@@ -595,7 +595,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
 
     case GICD_IPRIORITYR ... GICD_IPRIORITYRN:
         if ( dabt.size != 0 && dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 8, gicd_reg - GICD_IPRIORITYR);
+        rank = vgic_rank_offset(v, 8, gicd_reg - GICD_IPRIORITYR);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         if ( dabt.size == 2 )
@@ -613,7 +613,7 @@ static int vgic_distr_mmio_write(struct vcpu *v, mmio_info_t *info)
         goto write_ignore;
     case GICD_ICFGR + 2 ... GICD_ICFGRN: /* SPIs */
         if ( dabt.size != 2 ) goto bad_width;
-        rank = vgic_irq_rank(v, 2, gicd_reg - GICD_ICFGR);
+        rank = vgic_rank_offset(v, 2, gicd_reg - GICD_ICFGR);
         if ( rank == NULL) goto write_ignore;
         vgic_lock_rank(v, rank);
         rank->icfg[REG_RANK_INDEX(2, gicd_reg - GICD_ICFGR)] = *r;
@@ -720,7 +720,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 {
     int idx = irq >> 2, byte = irq & 0x3;
     uint8_t priority;
-    struct vgic_irq_rank *rank = vgic_irq_rank(v, 8, idx);
+    struct vgic_irq_rank *rank = vgic_rank_offset(v, 8, idx);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
     bool_t running;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:02 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIA-0007M5-EA; Sun, 22 Jun 2014 18:15:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymI9-0007Lr-F1
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:01 +0000
Received: from [85.158.139.211:43485] by server-13.bemta-5.messagelabs.com id
	F8/53-02995-42D17A35; Sun, 22 Jun 2014 18:15:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1403460898!3731928!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9211 invoked from network); 22 Jun 2014 18:14:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymI6-0000G3-Oc
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymI6-0007lW-Mb
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:58 +0000
Date: Sun, 22 Jun 2014 18:14:58 +0000
Message-Id: <E1WymI6-0007lW-Mb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: introduce vgic_rank_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d56f1994b0241ac912796e8fb39ca20ba9ee8a12
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jun 11 17:27:08 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:49 2014 +0100

    xen/arm: introduce vgic_rank_irq
    
    Introduce vgic_rank_irq: a new helper function that gives you the struct
    vgic_irq_rank corresponding to a given irq number.
    Use it in vgic_vcpu_inject_irq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f8cb3d5..757707e 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -73,6 +73,11 @@ static struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n)
         return NULL;
 }
 
+static struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq)
+{
+    return vgic_rank_offset(v, 8, irq >> 2);
+}
+
 int domain_vgic_init(struct domain *d)
 {
     int i;
@@ -720,7 +725,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 {
     int idx = irq >> 2, byte = irq & 0x3;
     uint8_t priority;
-    struct vgic_irq_rank *rank = vgic_rank_offset(v, 8, idx);
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
     bool_t running;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:02 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIA-0007M5-EA; Sun, 22 Jun 2014 18:15:02 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymI9-0007Lr-F1
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:01 +0000
Received: from [85.158.139.211:43485] by server-13.bemta-5.messagelabs.com id
	F8/53-02995-42D17A35; Sun, 22 Jun 2014 18:15:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1403460898!3731928!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9211 invoked from network); 22 Jun 2014 18:14:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:14:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymI6-0000G3-Oc
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:58 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymI6-0007lW-Mb
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:14:58 +0000
Date: Sun, 22 Jun 2014 18:14:58 +0000
Message-Id: <E1WymI6-0007lW-Mb@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xen/arm: introduce vgic_rank_irq
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d56f1994b0241ac912796e8fb39ca20ba9ee8a12
Author:     Stefano Stabellini <stefano.stabellini@eu.citrix.com>
AuthorDate: Wed Jun 11 17:27:08 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:49 2014 +0100

    xen/arm: introduce vgic_rank_irq
    
    Introduce vgic_rank_irq: a new helper function that gives you the struct
    vgic_irq_rank corresponding to a given irq number.
    Use it in vgic_vcpu_inject_irq.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    Acked-by: Julien Grall <julien.grall@linaro.org>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/vgic.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/vgic.c b/xen/arch/arm/vgic.c
index f8cb3d5..757707e 100644
--- a/xen/arch/arm/vgic.c
+++ b/xen/arch/arm/vgic.c
@@ -73,6 +73,11 @@ static struct vgic_irq_rank *vgic_rank_offset(struct vcpu *v, int b, int n)
         return NULL;
 }
 
+static struct vgic_irq_rank *vgic_rank_irq(struct vcpu *v, unsigned int irq)
+{
+    return vgic_rank_offset(v, 8, irq >> 2);
+}
+
 int domain_vgic_init(struct domain *d)
 {
     int i;
@@ -720,7 +725,7 @@ void vgic_vcpu_inject_irq(struct vcpu *v, unsigned int irq)
 {
     int idx = irq >> 2, byte = irq & 0x3;
     uint8_t priority;
-    struct vgic_irq_rank *rank = vgic_rank_offset(v, 8, idx);
+    struct vgic_irq_rank *rank = vgic_rank_irq(v, irq);
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
     unsigned long flags;
     bool_t running;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIQ-0007Ny-Hv; Sun, 22 Jun 2014 18:15:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIP-0007Nq-KH
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:17 +0000
Received: from [85.158.137.68:15859] by server-11.bemta-3.messagelabs.com id
	43/E3-12889-43D17A35; Sun, 22 Jun 2014 18:15:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403460915!11604596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16169 invoked from network); 22 Jun 2014 18:15:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIG-0000H2-T1
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIG-0007mA-RW
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:08 +0000
Date: Sun, 22 Jun 2014 18:15:08 +0000
Message-Id: <E1WymIG-0007mA-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: rename pfn_to_mfn to
	xc_pfn_to_mfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eba7e67bc43894333fcdb492b86e0fbf688f7e72
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 13:57:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:49 2014 +0100

    tools/libxc: rename pfn_to_mfn to xc_pfn_to_mfn
    
    Also refactor the contents of xc_pfn_to_mfn().  It is functionally identical,
    but contains less lisp, fewer magic numbers, and more description of why 32bit
    guests are treated differently.
    
    Note that this does not affect pfn_to_mfn() in xc_domain_save.c  That was
    already a macro which aliased pfn_to_mfn() in xg_private.h but without
    actually using it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c       |    4 ++--
 tools/libxc/xc_offline_page.c |    4 ++--
 tools/libxc/xg_private.h      |   18 ++++++++++++------
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 26edbaf..ef470a5 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1879,8 +1879,8 @@ int xc_map_domain_meminfo(xc_interface *xch, int domid,
         goto failed;
     }
     for ( i = 0; i < minfo->p2m_size; i++ )
-        minfo->pfn_type[i] = pfn_to_mfn(i, minfo->p2m_table,
-                                        minfo->guest_width);
+        minfo->pfn_type[i] = xc_pfn_to_mfn(i, minfo->p2m_table,
+                                           minfo->guest_width);
 
     /* Retrieve PFN types in batches */
     for ( i = 0; i < minfo->p2m_size ; i+=1024 )
diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c
index 0b4cdf9..3147203 100644
--- a/tools/libxc/xc_offline_page.c
+++ b/tools/libxc/xc_offline_page.c
@@ -272,8 +272,8 @@ static int change_pte(xc_interface *xch, int domid,
 
     for (i = 0; i < minfo->p2m_size; i++)
     {
-        xen_pfn_t table_mfn = pfn_to_mfn(i, minfo->p2m_table,
-                                         minfo->guest_width);
+        xen_pfn_t table_mfn = xc_pfn_to_mfn(i, minfo->p2m_table,
+                                            minfo->guest_width);
         uint64_t pte, new_pte;
         int j;
 
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index f5755fd..e593364 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -132,13 +132,19 @@ struct domain_info_context {
     unsigned long p2m_size;
 };
 
-static inline xen_pfn_t pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m, int gwidth)
+static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
+                                      unsigned gwidth)
 {
-  return ((xen_pfn_t) ((gwidth==8)?
-                       (((uint64_t *)p2m)[(pfn)]):
-                       ((((uint32_t *)p2m)[(pfn)]) == 0xffffffffU ?
-                            (-1UL) :
-                            (((uint32_t *)p2m)[(pfn)]))));
+    if ( gwidth == sizeof(uint64_t) )
+        /* 64 bit guest.  Need to truncate their pfns for 32 bit toolstacks. */
+        return ((uint64_t *)p2m)[pfn];
+    else
+    {
+        /* 32 bit guest.  Need to expand INVALID_MFN for 64 bit toolstacks. */
+        uint32_t mfn = ((uint32_t *)p2m)[pfn];
+
+        return mfn == ~0U ? INVALID_MFN : mfn;
+    }
 }
 
 /* Number of xen_pfn_t in a page */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIQ-0007Ny-Hv; Sun, 22 Jun 2014 18:15:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIP-0007Nq-KH
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:17 +0000
Received: from [85.158.137.68:15859] by server-11.bemta-3.messagelabs.com id
	43/E3-12889-43D17A35; Sun, 22 Jun 2014 18:15:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403460915!11604596!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16169 invoked from network); 22 Jun 2014 18:15:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIG-0000H2-T1
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIG-0007mA-RW
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:08 +0000
Date: Sun, 22 Jun 2014 18:15:08 +0000
Message-Id: <E1WymIG-0007mA-RW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: rename pfn_to_mfn to
	xc_pfn_to_mfn
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit eba7e67bc43894333fcdb492b86e0fbf688f7e72
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 13:57:58 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 16:22:49 2014 +0100

    tools/libxc: rename pfn_to_mfn to xc_pfn_to_mfn
    
    Also refactor the contents of xc_pfn_to_mfn().  It is functionally identical,
    but contains less lisp, fewer magic numbers, and more description of why 32bit
    guests are treated differently.
    
    Note that this does not affect pfn_to_mfn() in xc_domain_save.c  That was
    already a macro which aliased pfn_to_mfn() in xg_private.h but without
    actually using it.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_domain.c       |    4 ++--
 tools/libxc/xc_offline_page.c |    4 ++--
 tools/libxc/xg_private.h      |   18 ++++++++++++------
 3 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 26edbaf..ef470a5 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1879,8 +1879,8 @@ int xc_map_domain_meminfo(xc_interface *xch, int domid,
         goto failed;
     }
     for ( i = 0; i < minfo->p2m_size; i++ )
-        minfo->pfn_type[i] = pfn_to_mfn(i, minfo->p2m_table,
-                                        minfo->guest_width);
+        minfo->pfn_type[i] = xc_pfn_to_mfn(i, minfo->p2m_table,
+                                           minfo->guest_width);
 
     /* Retrieve PFN types in batches */
     for ( i = 0; i < minfo->p2m_size ; i+=1024 )
diff --git a/tools/libxc/xc_offline_page.c b/tools/libxc/xc_offline_page.c
index 0b4cdf9..3147203 100644
--- a/tools/libxc/xc_offline_page.c
+++ b/tools/libxc/xc_offline_page.c
@@ -272,8 +272,8 @@ static int change_pte(xc_interface *xch, int domid,
 
     for (i = 0; i < minfo->p2m_size; i++)
     {
-        xen_pfn_t table_mfn = pfn_to_mfn(i, minfo->p2m_table,
-                                         minfo->guest_width);
+        xen_pfn_t table_mfn = xc_pfn_to_mfn(i, minfo->p2m_table,
+                                            minfo->guest_width);
         uint64_t pte, new_pte;
         int j;
 
diff --git a/tools/libxc/xg_private.h b/tools/libxc/xg_private.h
index f5755fd..e593364 100644
--- a/tools/libxc/xg_private.h
+++ b/tools/libxc/xg_private.h
@@ -132,13 +132,19 @@ struct domain_info_context {
     unsigned long p2m_size;
 };
 
-static inline xen_pfn_t pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m, int gwidth)
+static inline xen_pfn_t xc_pfn_to_mfn(xen_pfn_t pfn, xen_pfn_t *p2m,
+                                      unsigned gwidth)
 {
-  return ((xen_pfn_t) ((gwidth==8)?
-                       (((uint64_t *)p2m)[(pfn)]):
-                       ((((uint32_t *)p2m)[(pfn)]) == 0xffffffffU ?
-                            (-1UL) :
-                            (((uint32_t *)p2m)[(pfn)]))));
+    if ( gwidth == sizeof(uint64_t) )
+        /* 64 bit guest.  Need to truncate their pfns for 32 bit toolstacks. */
+        return ((uint64_t *)p2m)[pfn];
+    else
+    {
+        /* 32 bit guest.  Need to expand INVALID_MFN for 64 bit toolstacks. */
+        uint32_t mfn = ((uint32_t *)p2m)[pfn];
+
+        return mfn == ~0U ? INVALID_MFN : mfn;
+    }
 }
 
 /* Number of xen_pfn_t in a page */
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIV-0007Op-PL; Sun, 22 Jun 2014 18:15:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIU-0007Og-By
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:22 +0000
Received: from [85.158.143.35:9663] by server-3.bemta-4.messagelabs.com id
	C1/F2-16194-93D17A35; Sun, 22 Jun 2014 18:15:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403460920!13004992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28112 invoked from network); 22 Jun 2014 18:15:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIR-0000H7-Sf
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIR-0007mo-RM
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:19 +0000
Date: Sun, 22 Jun 2014 18:15:19 +0000
Message-Id: <E1WymIR-0007mo-RM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: disable usbredirection if spice
	is disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a73649ea7d1c9e647957589b50eb51b9dfe1da9f
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue May 27 17:01:39 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:12:11 2014 +0100

    libxl: disable usbredirection if spice is disabled
    
    Now if usbredirection is enabled in domU's xl cfg is added also
    if spice is disabled and then usbredirection remain unused.
    This patch if usbredirection is enabled but spice not disable
    usbredirection and show a warning.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- simplified log message ]
---
 tools/libxl/libxl_create.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index da1517c..d6b8a29 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -292,6 +292,13 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (!libxl_defbool_val(b_info->u.hvm.spice.enable) &&
+            (b_info->u.hvm.spice.usbredirection > 0) ){
+            b_info->u.hvm.spice.usbredirection = 0;
+            LOG(WARN, "spice disabled, disabling usbredirection");
+        }
+
         if (!b_info->u.hvm.usbversion &&
             (b_info->u.hvm.spice.usbredirection > 0) )
             b_info->u.hvm.usbversion = 2;
@@ -324,7 +331,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
         }
 
-        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
         if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
                                      false);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:23 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIV-0007Op-PL; Sun, 22 Jun 2014 18:15:23 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIU-0007Og-By
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:22 +0000
Received: from [85.158.143.35:9663] by server-3.bemta-4.messagelabs.com id
	C1/F2-16194-93D17A35; Sun, 22 Jun 2014 18:15:21 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403460920!13004992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.7 required=7.0 tests=BIZ_TLD
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28112 invoked from network); 22 Jun 2014 18:15:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:20 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIR-0000H7-Sf
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIR-0007mo-RM
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:19 +0000
Date: Sun, 22 Jun 2014 18:15:19 +0000
Message-Id: <E1WymIR-0007mo-RM@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: disable usbredirection if spice
	is disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a73649ea7d1c9e647957589b50eb51b9dfe1da9f
Author:     Fabio Fantoni <fabio.fantoni@m2r.biz>
AuthorDate: Tue May 27 17:01:39 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:12:11 2014 +0100

    libxl: disable usbredirection if spice is disabled
    
    Now if usbredirection is enabled in domU's xl cfg is added also
    if spice is disabled and then usbredirection remain unused.
    This patch if usbredirection is enabled but spice not disable
    usbredirection and show a warning.
    
    Signed-off-by: Fabio Fantoni <fabio.fantoni@m2r.biz>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- simplified log message ]
---
 tools/libxl/libxl_create.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index da1517c..d6b8a29 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -292,6 +292,13 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (!libxl_defbool_val(b_info->u.hvm.spice.enable) &&
+            (b_info->u.hvm.spice.usbredirection > 0) ){
+            b_info->u.hvm.spice.usbredirection = 0;
+            LOG(WARN, "spice disabled, disabling usbredirection");
+        }
+
         if (!b_info->u.hvm.usbversion &&
             (b_info->u.hvm.spice.usbredirection > 0) )
             b_info->u.hvm.usbversion = 2;
@@ -324,7 +331,6 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
             libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
         }
 
-        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
         if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
                                      false);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIf-0007Ql-S2; Sun, 22 Jun 2014 18:15:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIe-0007QS-RR
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:33 +0000
Received: from [85.158.137.68:11541] by server-6.bemta-3.messagelabs.com id
	0C/F2-23778-34D17A35; Sun, 22 Jun 2014 18:15:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403460930!11634467!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4896 invoked from network); 22 Jun 2014 18:15:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIc-0000HG-0m
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIb-0007nC-W0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:29 +0000
Date: Sun, 22 Jun 2014 18:15:29 +0000
Message-Id: <E1WymIb-0007nC-W0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] configure: disable qemu-trad on
	FreeBSD systems by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1850596330423873925=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b57af88ceaec43a846682a93842331dca4d2a312
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:08 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:13:14 2014 +0100

    configure: disable qemu-trad on FreeBSD systems by default
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran autogen.sh ]
---
 tools/configure    |    7 ++++++-
 tools/configure.ac |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/configure b/tools/configure
index ea2ad80..80a74e3 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1427,7 +1427,7 @@ Optional Features:
   --enable-blktap1        Enable blktap1 tools (default is DISABLED)
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
-                          for x86, otherwise off)
+                          for Linux or NetBSD x86, otherwise off)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -3756,6 +3756,11 @@ else
            enable_qemu_traditional="yes";;
         *) enable_qemu_traditional="no";;
     esac
+    case "$host_os" in
+        freebsd*)
+           enable_qemu_traditional="no";;
+    esac
+
 
 fi
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 89f1ac7..282dbc4 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -61,12 +61,17 @@ AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
 
 AC_ARG_ENABLE([qemu-traditional],
     AS_HELP_STRING([--enable-qemu-traditional],
-                   [Enable qemu traditional device model, (DEFAULT is on for x86, otherwise off)]),,[
+                   [Enable qemu traditional device model, (DEFAULT is on for Linux or NetBSD x86, otherwise off)]),,[
     case "$host_cpu" in
         i[[3456]]86|x86_64)
            enable_qemu_traditional="yes";;
         *) enable_qemu_traditional="no";;
     esac
+    case "$host_os" in
+        freebsd*)
+           enable_qemu_traditional="no";;
+    esac
+
 ])
 AS_IF([test "x$enable_qemu_traditional" = "xyes"], [
 AC_DEFINE([HAVE_QEMU_TRADITIONAL], [1], [Qemu traditional enabled])
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIf-0007Ql-S2; Sun, 22 Jun 2014 18:15:33 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIe-0007QS-RR
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:33 +0000
Received: from [85.158.137.68:11541] by server-6.bemta-3.messagelabs.com id
	0C/F2-23778-34D17A35; Sun, 22 Jun 2014 18:15:31 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403460930!11634467!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4896 invoked from network); 22 Jun 2014 18:15:31 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIc-0000HG-0m
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIb-0007nC-W0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:29 +0000
Date: Sun, 22 Jun 2014 18:15:29 +0000
Message-Id: <E1WymIb-0007nC-W0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] configure: disable qemu-trad on
	FreeBSD systems by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1850596330423873925=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b57af88ceaec43a846682a93842331dca4d2a312
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:08 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:13:14 2014 +0100

    configure: disable qemu-trad on FreeBSD systems by default
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran autogen.sh ]
---
 tools/configure    |    7 ++++++-
 tools/configure.ac |    7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/tools/configure b/tools/configure
index ea2ad80..80a74e3 100755
--- a/tools/configure
+++ b/tools/configure
@@ -1427,7 +1427,7 @@ Optional Features:
   --enable-blktap1        Enable blktap1 tools (default is DISABLED)
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
-                          for x86, otherwise off)
+                          for Linux or NetBSD x86, otherwise off)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -3756,6 +3756,11 @@ else
            enable_qemu_traditional="yes";;
         *) enable_qemu_traditional="no";;
     esac
+    case "$host_os" in
+        freebsd*)
+           enable_qemu_traditional="no";;
+    esac
+
 
 fi
 
diff --git a/tools/configure.ac b/tools/configure.ac
index 89f1ac7..282dbc4 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -61,12 +61,17 @@ AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
 
 AC_ARG_ENABLE([qemu-traditional],
     AS_HELP_STRING([--enable-qemu-traditional],
-                   [Enable qemu traditional device model, (DEFAULT is on for x86, otherwise off)]),,[
+                   [Enable qemu traditional device model, (DEFAULT is on for Linux or NetBSD x86, otherwise off)]),,[
     case "$host_cpu" in
         i[[3456]]86|x86_64)
            enable_qemu_traditional="yes";;
         *) enable_qemu_traditional="no";;
     esac
+    case "$host_os" in
+        freebsd*)
+           enable_qemu_traditional="no";;
+    esac
+
 ])
 AS_IF([test "x$enable_qemu_traditional" = "xyes"], [
 AC_DEFINE([HAVE_QEMU_TRADITIONAL], [1], [Qemu traditional enabled])
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIq-0007Sn-0H; Sun, 22 Jun 2014 18:15:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIo-0007SU-MQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:42 +0000
Content-Length: 5688
Received: from [85.158.139.211:60272] by server-8.bemta-5.messagelabs.com id
	31/45-01846-E4D17A35; Sun, 22 Jun 2014 18:15:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403460940!6016925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7100 invoked from network); 22 Jun 2014 18:15:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIm-0000HM-5o
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIm-0007oK-48
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:40 +0000
Date: Sun, 22 Jun 2014 18:15:40 +0000
Message-Id: <E1WymIm-0007oK-48@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] configure: disable ROMBIOS if
	qemu-trad is disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3619803401371542754=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3619803401371542754==
Content-Length: 5422
Content-Transfer-Encoding: quoted-printable

commit 9521e73200d94e6f25d0573beeaa6c067a7b44b9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:09 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:14:00 2014 +0100

    configure: disable ROMBIOS if qemu-trad is disabled
    
    ROMBIOS only works with qemu-traditional, so if it is disabled,
    disable ROMBIOS also.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran autogen.sh ]
---
 tools/config.h.in  |    3 ++
 tools/configure    |   60 +++++++++++++++++++++++++++++----------------------
 tools/configure.ac |   17 +++++++++++++-
 3 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index bb34f32..1809662 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -24,6 +24,9 @@
 /* Qemu traditional enabled */
 #undef HAVE_QEMU_TRADITIONAL
 
+/* ROMBIOS enabled */
+#undef HAVE_ROMBIOS
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
diff --git a/tools/configure b/tools/configure
index 80a74e3..ea7b4de 100755
--- a/tools/configure
+++ b/tools/configure
@@ -687,11 +687,11 @@ EXTRA_QEMUU_CONFIGURE_ARGS
 ovmf_path
 seabios_path
 qemu_xen
+rombios
 qemu_traditional
 blktap1
 debug
 seabios
-rombios
 ovmf
 xsmpolicy
 ocamltools
@@ -760,11 +760,11 @@ enable_monitors
 enable_ocamltools
 enable_xsmpolicy
 enable_ovmf
-enable_rombios
 enable_seabios
 enable_debug
 enable_blktap1
 enable_qemu_traditional
+enable_rombios
 with_system_qemu
 with_system_seabios
 with_system_ovmf
@@ -1421,13 +1421,14 @@ Optional Features:
   --disable-ocamltools    Disable Ocaml tools (default is ENABLED)
   --disable-xsmpolicy     Disable XSM policy compilation (default is ENABLED)
   --enable-ovmf           Enable OVMF (default is DISABLED)
-  --disable-rombios       Disable ROM BIOS (default is ENABLED)
   --disable-seabios       Disable SeaBIOS (default is ENABLED)
   --disable-debug         Disable debug build of tools (default is ENABLED)
   --enable-blktap1        Enable blktap1 tools (default is DISABLED)
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
                           for Linux or NetBSD x86, otherwise off)
+  --enable-rombios        Enable ROMBIOS, (DEFAULT is on if qemu-traditional
+                          is enabled, otherwise off)
 
 Optional Packages:
   --with-PACKAGE[=3DARG]    use PACKAGE [ARG=3Dyes]
@@ -3654,29 +3655,6 @@ ovmf=3D$ax_cv_ovmf
 
 
 
-# Check whether --enable-rombios was given.
-if test "${enable_rombios+set}" =3D set; then :
-  enableval=3D$enable_rombios;
-fi
-
-
-if test "x$enable_rombios" =3D "xno"; then :
-
-    ax_cv_rombios=3D"n"
-
-elif test "x$enable_rombios" =3D "xyes"; then :
-
-    ax_cv_rombios=3D"y"
-
-elif test -z $ax_cv_rombios; then :
-
-    ax_cv_rombios=3D"y"
-
-fi
-rombios=3D$ax_cv_rombios
-
-
-
 # Check whether --enable-seabios was given.
 if test "${enable_seabios+set}" =3D set; then :
   enableval=3D$enable_seabios;
@@ -3777,6 +3755,36 @@ else
 fi
 
 
+# Check whether --enable-rombios was given.
+if test "${enable_rombios+set}" =3D set; then :
+  enableval=3D$enable_rombios;
+else
+
+    if test "x$enable_qemu_traditional" =3D "xyes"; then :
+
+        enable_rombios=3D"yes"
+
+else
+
+        enable_rombios=3D"no"
+
+fi
+
+fi
+
+if test "x$enable_rombios" =3D "xyes"; then :
+
+
+$as_echo "#define HAVE_ROMBIOS 1" >>confdefs.h
+
+    rombios=3Dy
+else
+
+    rombios=3Dn
+
+fi
+
+
 
 # Check whether --with-system-qemu was given.
 if test "${with_system_qemu+set}" =3D set; then :
diff --git a/tools/configure.ac b/tools/configure.ac
index 282dbc4..d9eab5a 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -54,7 +54,6 @@ AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])
 AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF])
-AX_ARG_DEFAULT_ENABLE([rombios], [Disable ROM BIOS])
 AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
 AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools])
 AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
@@ -80,6 +79,22 @@ AC_DEFINE([HAVE_QEMU_TRADITIONAL], [1], [Qemu traditional enabled])
 ])
 AC_SUBST(qemu_traditional)
 
+AC_ARG_ENABLE([rombios],
+    AS_HELP_STRING([--enable-rombios],
+                   [Enable ROMBIOS, (DEFAULT is on if qemu-traditional is enabled, otherwise off)]),,[
+    AS_IF([test "x$enable_qemu_traditional" =3D "xyes"], [
+        enable_rombios=3D"yes"
+    ], [
+        enable_rombios=3D"no"
+    ])
+])
+AS_IF([test "x$enable_rombios" =3D "xyes"], [
+AC_DEFINE([HAVE_ROMBIOS], [1], [ROMBIOS enabled])
+    rombios=3Dy],[
+    rombios=3Dn
+])
+AC_SUBST(rombios)
+
 AC_ARG_WITH([system-qemu],
     AS_HELP_STRING([--with-system-qemu@<:@=3DPATH@:>@],
        [Use system supplied qemu PATH or qemu (taken from $PATH) as qemu-xen
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymIq-0007Sn-0H; Sun, 22 Jun 2014 18:15:44 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIo-0007SU-MQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:42 +0000
Content-Length: 5688
Received: from [85.158.139.211:60272] by server-8.bemta-5.messagelabs.com id
	31/45-01846-E4D17A35; Sun, 22 Jun 2014 18:15:42 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-206.messagelabs.com!1403460940!6016925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7100 invoked from network); 22 Jun 2014 18:15:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:15:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIm-0000HM-5o
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIm-0007oK-48
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:40 +0000
Date: Sun, 22 Jun 2014 18:15:40 +0000
Message-Id: <E1WymIm-0007oK-48@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] configure: disable ROMBIOS if
	qemu-trad is disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3619803401371542754=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============3619803401371542754==
Content-Length: 5422
Content-Transfer-Encoding: quoted-printable

commit 9521e73200d94e6f25d0573beeaa6c067a7b44b9
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:09 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:14:00 2014 +0100

    configure: disable ROMBIOS if qemu-trad is disabled
    
    ROMBIOS only works with qemu-traditional, so if it is disabled,
    disable ROMBIOS also.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- ran autogen.sh ]
---
 tools/config.h.in  |    3 ++
 tools/configure    |   60 +++++++++++++++++++++++++++++----------------------
 tools/configure.ac |   17 +++++++++++++-
 3 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index bb34f32..1809662 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -24,6 +24,9 @@
 /* Qemu traditional enabled */
 #undef HAVE_QEMU_TRADITIONAL
 
+/* ROMBIOS enabled */
+#undef HAVE_ROMBIOS
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
diff --git a/tools/configure b/tools/configure
index 80a74e3..ea7b4de 100755
--- a/tools/configure
+++ b/tools/configure
@@ -687,11 +687,11 @@ EXTRA_QEMUU_CONFIGURE_ARGS
 ovmf_path
 seabios_path
 qemu_xen
+rombios
 qemu_traditional
 blktap1
 debug
 seabios
-rombios
 ovmf
 xsmpolicy
 ocamltools
@@ -760,11 +760,11 @@ enable_monitors
 enable_ocamltools
 enable_xsmpolicy
 enable_ovmf
-enable_rombios
 enable_seabios
 enable_debug
 enable_blktap1
 enable_qemu_traditional
+enable_rombios
 with_system_qemu
 with_system_seabios
 with_system_ovmf
@@ -1421,13 +1421,14 @@ Optional Features:
   --disable-ocamltools    Disable Ocaml tools (default is ENABLED)
   --disable-xsmpolicy     Disable XSM policy compilation (default is ENABLED)
   --enable-ovmf           Enable OVMF (default is DISABLED)
-  --disable-rombios       Disable ROM BIOS (default is ENABLED)
   --disable-seabios       Disable SeaBIOS (default is ENABLED)
   --disable-debug         Disable debug build of tools (default is ENABLED)
   --enable-blktap1        Enable blktap1 tools (default is DISABLED)
   --enable-qemu-traditional
                           Enable qemu traditional device model, (DEFAULT is on
                           for Linux or NetBSD x86, otherwise off)
+  --enable-rombios        Enable ROMBIOS, (DEFAULT is on if qemu-traditional
+                          is enabled, otherwise off)
 
 Optional Packages:
   --with-PACKAGE[=3DARG]    use PACKAGE [ARG=3Dyes]
@@ -3654,29 +3655,6 @@ ovmf=3D$ax_cv_ovmf
 
 
 
-# Check whether --enable-rombios was given.
-if test "${enable_rombios+set}" =3D set; then :
-  enableval=3D$enable_rombios;
-fi
-
-
-if test "x$enable_rombios" =3D "xno"; then :
-
-    ax_cv_rombios=3D"n"
-
-elif test "x$enable_rombios" =3D "xyes"; then :
-
-    ax_cv_rombios=3D"y"
-
-elif test -z $ax_cv_rombios; then :
-
-    ax_cv_rombios=3D"y"
-
-fi
-rombios=3D$ax_cv_rombios
-
-
-
 # Check whether --enable-seabios was given.
 if test "${enable_seabios+set}" =3D set; then :
   enableval=3D$enable_seabios;
@@ -3777,6 +3755,36 @@ else
 fi
 
 
+# Check whether --enable-rombios was given.
+if test "${enable_rombios+set}" =3D set; then :
+  enableval=3D$enable_rombios;
+else
+
+    if test "x$enable_qemu_traditional" =3D "xyes"; then :
+
+        enable_rombios=3D"yes"
+
+else
+
+        enable_rombios=3D"no"
+
+fi
+
+fi
+
+if test "x$enable_rombios" =3D "xyes"; then :
+
+
+$as_echo "#define HAVE_ROMBIOS 1" >>confdefs.h
+
+    rombios=3Dy
+else
+
+    rombios=3Dn
+
+fi
+
+
 
 # Check whether --with-system-qemu was given.
 if test "${with_system_qemu+set}" =3D set; then :
diff --git a/tools/configure.ac b/tools/configure.ac
index 282dbc4..d9eab5a 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -54,7 +54,6 @@ AX_ARG_DEFAULT_ENABLE([monitors], [Disable xenstat and xentop monitoring tools])
 AX_ARG_DEFAULT_ENABLE([ocamltools], [Disable Ocaml tools])
 AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])
 AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF])
-AX_ARG_DEFAULT_ENABLE([rombios], [Disable ROM BIOS])
 AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
 AX_ARG_DEFAULT_ENABLE([debug], [Disable debug build of tools])
 AX_ARG_DEFAULT_DISABLE([blktap1], [Enable blktap1 tools])
@@ -80,6 +79,22 @@ AC_DEFINE([HAVE_QEMU_TRADITIONAL], [1], [Qemu traditional enabled])
 ])
 AC_SUBST(qemu_traditional)
 
+AC_ARG_ENABLE([rombios],
+    AS_HELP_STRING([--enable-rombios],
+                   [Enable ROMBIOS, (DEFAULT is on if qemu-traditional is enabled, otherwise off)]),,[
+    AS_IF([test "x$enable_qemu_traditional" =3D "xyes"], [
+        enable_rombios=3D"yes"
+    ], [
+        enable_rombios=3D"no"
+    ])
+])
+AS_IF([test "x$enable_rombios" =3D "xyes"], [
+AC_DEFINE([HAVE_ROMBIOS], [1], [ROMBIOS enabled])
+    rombios=3Dy],[
+    rombios=3Dn
+])
+AC_SUBST(rombios)
+
 AC_ARG_WITH([system-qemu],
     AS_HELP_STRING([--with-system-qemu@<:@=3DPATH@:>@],
        [Use system supplied qemu PATH or qemu (taken from $PATH) as qemu-xen
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:55 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15: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.xen.org>)
	id 1WymJ1-0007UQ-3D; Sun, 22 Jun 2014 18:15:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIz-0007U4-2j
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:53 +0000
Received: from [85.158.143.35:14689] by server-1.bemta-4.messagelabs.com id
	B3/A8-09496-85D17A35; Sun, 22 Jun 2014 18:15:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1403460950!9566346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1271 invoked from network); 22 Jun 2014 18:15: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;
	22 Jun 2014 18:15:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIw-0000HS-AW
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIw-0007og-8w
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:50 +0000
Date: Sun, 22 Jun 2014 18:15:50 +0000
Message-Id: <E1WymIw-0007og-8w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] include: import FreeBSD headers for
	evtchn and privcmd devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7128599802932623103=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b6e37a1c7a5f356cf7284702ff246307d7a32a9e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:10 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:17:47 2014 +0100

    include: import FreeBSD headers for evtchn and privcmd devices
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
---
 tools/include/xen-sys/FreeBSD/evtchn.h  |   87 +++++++++++++++++++++++++++++++
 tools/include/xen-sys/FreeBSD/privcmd.h |   64 ++++++++++++++++++++++
 2 files changed, 151 insertions(+), 0 deletions(-)

diff --git a/tools/include/xen-sys/FreeBSD/evtchn.h b/tools/include/xen-sys/FreeBSD/evtchn.h
new file mode 100644
index 0000000..7f9a348
--- /dev/null
+++ b/tools/include/xen-sys/FreeBSD/evtchn.h
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * evtchn.h
+ *
+ * Interface to /dev/xen/evtchn.
+ *
+ * Copyright (c) 2003-2005, K A Fraser
+ *
+ * This file may be distributed separately from the Linux kernel, or
+ * incorporated into other software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __XEN_EVTCHN_H__
+#define __XEN_EVTCHN_H__
+
+/*
+ * Bind a fresh port to VIRQ @virq.
+ */
+#define IOCTL_EVTCHN_BIND_VIRQ				\
+	_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
+struct ioctl_evtchn_bind_virq {
+	unsigned int virq;
+	unsigned int port;
+};
+
+/*
+ * Bind a fresh port to remote <@remote_domain, @remote_port>.
+ */
+#define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
+	_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
+struct ioctl_evtchn_bind_interdomain {
+	unsigned int remote_domain, remote_port;
+	unsigned int port;
+};
+
+/*
+ * Allocate a fresh port for binding to @remote_domain.
+ */
+#define IOCTL_EVTCHN_BIND_UNBOUND_PORT			\
+	_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
+struct ioctl_evtchn_bind_unbound_port {
+	unsigned int remote_domain;
+	unsigned int port;
+};
+
+/*
+ * Unbind previously allocated @port.
+ */
+#define IOCTL_EVTCHN_UNBIND				\
+	_IOW('E', 7, struct ioctl_evtchn_unbind)
+struct ioctl_evtchn_unbind {
+	unsigned int port;
+};
+
+/*
+ * Send event to previously allocated @port.
+ */
+#define IOCTL_EVTCHN_NOTIFY				\
+	_IOW('E', 8, struct ioctl_evtchn_notify)
+struct ioctl_evtchn_notify {
+	unsigned int port;
+};
+
+/* Clear and reinitialise the event buffer. Clear error condition. */
+#define IOCTL_EVTCHN_RESET				\
+	_IO('E', 9)
+
+#endif /* __XEN_EVTCHN_H__ */
diff --git a/tools/include/xen-sys/FreeBSD/privcmd.h b/tools/include/xen-sys/FreeBSD/privcmd.h
new file mode 100644
index 0000000..0434d4d
--- /dev/null
+++ b/tools/include/xen-sys/FreeBSD/privcmd.h
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * privcmd.h
+ *
+ * Interface to /proc/xen/privcmd.
+ *
+ * Copyright (c) 2003-2005, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_PRIVCMD_H__
+#define __XEN_PRIVCMD_H__
+
+struct ioctl_privcmd_hypercall
+{
+	unsigned long op; /* hypercall number */
+	unsigned long arg[5]; /* arguments */
+	long retval; /* return value */
+};
+typedef struct ioctl_privcmd_hypercall privcmd_hypercall_t;
+
+struct ioctl_privcmd_mmapbatch {
+	int num;     /* number of pages to populate */
+	domid_t dom; /* target domain */
+	unsigned long addr;  /* virtual address */
+	const xen_pfn_t *arr; /* array of mfns */
+	int *err; /* array of error codes */
+};
+typedef struct ioctl_privcmd_mmapbatch privcmd_mmapbatch_t;
+
+typedef struct privcmd_mmap_entry {
+	unsigned long va;
+	unsigned long mfn;
+	unsigned long npages;
+} privcmd_mmap_entry_t;
+
+#define IOCTL_PRIVCMD_HYPERCALL					\
+	_IOWR('E', 0, struct ioctl_privcmd_hypercall)
+#define IOCTL_PRIVCMD_MMAPBATCH					\
+	_IOWR('E', 1, struct ioctl_privcmd_mmapbatch)
+
+#endif /* !__XEN_PRIVCMD_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:15:55 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:15: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.xen.org>)
	id 1WymJ1-0007UQ-3D; Sun, 22 Jun 2014 18:15:55 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIz-0007U4-2j
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:53 +0000
Received: from [85.158.143.35:14689] by server-1.bemta-4.messagelabs.com id
	B3/A8-09496-85D17A35; Sun, 22 Jun 2014 18:15:52 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-21.messagelabs.com!1403460950!9566346!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1271 invoked from network); 22 Jun 2014 18:15: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;
	22 Jun 2014 18:15:51 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIw-0000HS-AW
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:50 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymIw-0007og-8w
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:15:50 +0000
Date: Sun, 22 Jun 2014 18:15:50 +0000
Message-Id: <E1WymIw-0007og-8w@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] include: import FreeBSD headers for
	evtchn and privcmd devices
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7128599802932623103=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit b6e37a1c7a5f356cf7284702ff246307d7a32a9e
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:10 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:17:47 2014 +0100

    include: import FreeBSD headers for evtchn and privcmd devices
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
---
 tools/include/xen-sys/FreeBSD/evtchn.h  |   87 +++++++++++++++++++++++++++++++
 tools/include/xen-sys/FreeBSD/privcmd.h |   64 ++++++++++++++++++++++
 2 files changed, 151 insertions(+), 0 deletions(-)

diff --git a/tools/include/xen-sys/FreeBSD/evtchn.h b/tools/include/xen-sys/FreeBSD/evtchn.h
new file mode 100644
index 0000000..7f9a348
--- /dev/null
+++ b/tools/include/xen-sys/FreeBSD/evtchn.h
@@ -0,0 +1,87 @@
+/******************************************************************************
+ * evtchn.h
+ *
+ * Interface to /dev/xen/evtchn.
+ *
+ * Copyright (c) 2003-2005, K A Fraser
+ *
+ * This file may be distributed separately from the Linux kernel, or
+ * incorporated into other software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __XEN_EVTCHN_H__
+#define __XEN_EVTCHN_H__
+
+/*
+ * Bind a fresh port to VIRQ @virq.
+ */
+#define IOCTL_EVTCHN_BIND_VIRQ				\
+	_IOWR('E', 4, struct ioctl_evtchn_bind_virq)
+struct ioctl_evtchn_bind_virq {
+	unsigned int virq;
+	unsigned int port;
+};
+
+/*
+ * Bind a fresh port to remote <@remote_domain, @remote_port>.
+ */
+#define IOCTL_EVTCHN_BIND_INTERDOMAIN			\
+	_IOWR('E', 5, struct ioctl_evtchn_bind_interdomain)
+struct ioctl_evtchn_bind_interdomain {
+	unsigned int remote_domain, remote_port;
+	unsigned int port;
+};
+
+/*
+ * Allocate a fresh port for binding to @remote_domain.
+ */
+#define IOCTL_EVTCHN_BIND_UNBOUND_PORT			\
+	_IOWR('E', 6, struct ioctl_evtchn_bind_unbound_port)
+struct ioctl_evtchn_bind_unbound_port {
+	unsigned int remote_domain;
+	unsigned int port;
+};
+
+/*
+ * Unbind previously allocated @port.
+ */
+#define IOCTL_EVTCHN_UNBIND				\
+	_IOW('E', 7, struct ioctl_evtchn_unbind)
+struct ioctl_evtchn_unbind {
+	unsigned int port;
+};
+
+/*
+ * Send event to previously allocated @port.
+ */
+#define IOCTL_EVTCHN_NOTIFY				\
+	_IOW('E', 8, struct ioctl_evtchn_notify)
+struct ioctl_evtchn_notify {
+	unsigned int port;
+};
+
+/* Clear and reinitialise the event buffer. Clear error condition. */
+#define IOCTL_EVTCHN_RESET				\
+	_IO('E', 9)
+
+#endif /* __XEN_EVTCHN_H__ */
diff --git a/tools/include/xen-sys/FreeBSD/privcmd.h b/tools/include/xen-sys/FreeBSD/privcmd.h
new file mode 100644
index 0000000..0434d4d
--- /dev/null
+++ b/tools/include/xen-sys/FreeBSD/privcmd.h
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * privcmd.h
+ *
+ * Interface to /proc/xen/privcmd.
+ *
+ * Copyright (c) 2003-2005, K A Fraser
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation; or, when distributed
+ * separately from the Linux kernel or incorporated into other
+ * software packages, subject to the following license:
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this source file (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy, modify,
+ * merge, publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef __XEN_PRIVCMD_H__
+#define __XEN_PRIVCMD_H__
+
+struct ioctl_privcmd_hypercall
+{
+	unsigned long op; /* hypercall number */
+	unsigned long arg[5]; /* arguments */
+	long retval; /* return value */
+};
+typedef struct ioctl_privcmd_hypercall privcmd_hypercall_t;
+
+struct ioctl_privcmd_mmapbatch {
+	int num;     /* number of pages to populate */
+	domid_t dom; /* target domain */
+	unsigned long addr;  /* virtual address */
+	const xen_pfn_t *arr; /* array of mfns */
+	int *err; /* array of error codes */
+};
+typedef struct ioctl_privcmd_mmapbatch privcmd_mmapbatch_t;
+
+typedef struct privcmd_mmap_entry {
+	unsigned long va;
+	unsigned long mfn;
+	unsigned long npages;
+} privcmd_mmap_entry_t;
+
+#define IOCTL_PRIVCMD_HYPERCALL					\
+	_IOWR('E', 0, struct ioctl_privcmd_hypercall)
+#define IOCTL_PRIVCMD_MMAPBATCH					\
+	_IOWR('E', 1, struct ioctl_privcmd_mmapbatch)
+
+#endif /* !__XEN_PRIVCMD_H__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJB-0007W2-66; Sun, 22 Jun 2014 18:16:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJ9-0007Vd-JQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:03 +0000
Content-Length: 16075
Received: from [85.158.139.211:60799] by server-10.bemta-5.messagelabs.com id
	8B/BC-01434-26D17A35; Sun, 22 Jun 2014 18:16:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403460960!11309889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6577 invoked from network); 22 Jun 2014 18:16:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJ6-0000HY-Ey
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJ6-0007pG-DJ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:00 +0000
Date: Sun, 22 Jun 2014 18:16:00 +0000
Message-Id: <E1WymJ6-0007pG-DJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add support for FreeBSD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6782216381786412768=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6782216381786412768==
Content-Length: 16149
Content-Transfer-Encoding: quoted-printable

commit d2ee2e3846f9b2577d2387fef82dad563cdd1c9a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:11 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:17:49 2014 +0100

    libxc: add support for FreeBSD
    
    Add the FreeBSD implementation of the privcmd and evtchn devices
    interface.
    
    The evtchn device interface is the same as the Linux one, while the
    privcmd map interface is simplified because FreeBSD only supports
    IOCTL_PRIVCMD_MMAPBATCH.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/Makefile           |    1 +
 tools/libxc/xc_freebsd.c       |   72 +++++++
 tools/libxc/xc_freebsd_osdep.c |  405 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 478 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 215101d..63be3d3 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -36,6 +36,7 @@ CTRL_SRCS-y       +=3D xtl_core.c
 CTRL_SRCS-y       +=3D xtl_logger_stdio.c
 CTRL_SRCS-$(CONFIG_X86) +=3D xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) +=3D xc_linux.c xc_linux_osdep.c
+CTRL_SRCS-$(CONFIG_FreeBSD) +=3D xc_freebsd.c xc_freebsd_osdep.c
 CTRL_SRCS-$(CONFIG_SunOS) +=3D xc_solaris.c
 CTRL_SRCS-$(CONFIG_NetBSD) +=3D xc_netbsd.c
 CTRL_SRCS-$(CONFIG_MiniOS) +=3D xc_minios.c
diff --git a/tools/libxc/xc_freebsd.c b/tools/libxc/xc_freebsd.c
new file mode 100644
index 0000000..8e70a91
--- /dev/null
+++ b/tools/libxc/xc_freebsd.c
@@ -0,0 +1,72 @@
+/******************************************************************************
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "xc_private.h"
+
+/* Optionally flush file to disk and discard page cache */
+void discard_file_cache(xc_interface *xch, int fd, int flush)
+{
+    off_t cur =3D 0;
+    int saved_errno =3D errno;
+
+    if ( flush && (fsync(fd) < 0) )
+        goto out;
+
+    /*
+     * Calculate last page boundary of amount written so far
+     * unless we are flushing in which case entire cache
+     * is discarded.
+     */
+    if ( !flush )
+    {
+        if ( (cur =3D lseek(fd, 0, SEEK_CUR)) =3D=3D (off_t)-1 )
+            cur =3D 0;
+        cur &=3D ~(XC_PAGE_SIZE-1);
+    }
+
+    /* Discard from the buffer cache. */
+    if ( posix_fadvise(fd, 0, cur, POSIX_FADV_DONTNEED) < 0 )
+        goto out;
+
+ out:
+    errno =3D saved_errno;
+}
+
+void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
+{
+    int ret;
+    void *ptr;
+
+    ret =3D posix_memalign(&ptr, alignment, size);
+    if ( ret !=3D 0 || !ptr )
+        return NULL;
+
+    return ptr;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
new file mode 100644
index 0000000..151d3bf
--- /dev/null
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -0,0 +1,405 @@
+ /******************************************************************************
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ *
+ * xc_gnttab functions:
+ * Copyright (c) 2007-2008, D G Murray <Derek.Murray@cl.cam.ac.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include <xen/memory.h>
+#include <xen/sys/evtchn.h>
+
+#include "xenctrl.h"
+#include "xenctrlosdep.h"
+
+#define PRIVCMD_DEV     "/dev/xen/privcmd"
+#define EVTCHN_DEV      "/dev/xen/evtchn"
+
+#define PERROR(_m, _a...) xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m \
+                  " (%d =3D %s)", ## _a , errno, xc_strerror(xch, errno))
+
+/*------------------------- Privcmd device interface -------------------------*/
+static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
+{
+    int flags, saved_errno;
+    int fd =3D open(PRIVCMD_DEV, O_RDWR);
+
+    if ( fd =3D=3D -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface "
+               PRIVCMD_DEV);
+        return XC_OSDEP_OPEN_ERROR;
+    }
+
+    /*
+     * Although we return the file handle as the 'xc handle' the API
+     * does not specify / guarentee that this integer is in fact
+     * a file handle. Thus we must take responsiblity to ensure
+     * it doesn't propagate (ie leak) outside the process.
+     */
+    if ( (flags =3D fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |=3D FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    return (xc_osdep_handle)fd;
+
+ error:
+    saved_errno =3D errno;
+    close(fd);
+    errno =3D saved_errno;
+
+    return XC_OSDEP_OPEN_ERROR;
+}
+
+static int freebsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+{
+    int fd =3D (int)h;
+
+    return close(fd);
+}
+
+/*------------------------ Privcmd hypercall interface -----------------------*/
+static void *freebsd_privcmd_alloc_hypercall_buffer(xc_interface *xch,
+                                                    xc_osdep_handle h,
+                                                    int npages)
+{
+    size_t size =3D npages * XC_PAGE_SIZE;
+    void *p;
+
+    /* Address returned by mmap is page aligned. */
+    p =3D mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
+             -1, 0);
+    if (p =3D=3D NULL)
+        return NULL;
+
+    /*
+     * Since FreeBSD doesn't have the MAP_LOCKED flag,
+     * lock memory using mlock.
+     */
+    if ( mlock(p, size) < 0 )
+    {
+        munmap(p, size);
+        return NULL;
+    }
+
+    return p;
+}
+
+static void freebsd_privcmd_free_hypercall_buffer(xc_interface *xch,
+                                                  xc_osdep_handle h, void *ptr,
+                                                  int npages)
+{
+
+    /* Unlock pages */
+    munlock(ptr, npages * XC_PAGE_SIZE);
+
+    munmap(ptr, npages * XC_PAGE_SIZE);
+}
+
+static int freebsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h,
+                                     privcmd_hypercall_t *hypercall)
+{
+    int fd =3D (int)h;
+    int ret;
+
+    ret =3D ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+    return (ret =3D=3D 0) =3F hypercall->retval : ret;
+}
+
+/*----------------------- Privcmd foreign map interface ----------------------*/
+static void *freebsd_privcmd_map_foreign_bulk(xc_interface *xch,
+                                               xc_osdep_handle h,
+                                               uint32_t dom, int prot,
+                                               const xen_pfn_t *arr, int *err,
+                                               unsigned int num)
+{
+    int fd =3D (int)h;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    int rc;
+
+    addr =3D mmap(NULL, num << XC_PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
+    if ( addr =3D=3D MAP_FAILED )
+    {
+        PERROR("xc_map_foreign_batch: mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num =3D num;
+    ioctlx.dom =3D dom;
+    ioctlx.addr =3D (unsigned long)addr;
+    ioctlx.arr =3D arr;
+    ioctlx.err =3D err;
+
+    rc =3D ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+    if ( rc < 0 )
+    {
+        int saved_errno =3D errno;
+        PERROR("xc_map_foreign_batch: ioctl failed");
+        (void)munmap(addr, num << XC_PAGE_SHIFT);
+        errno =3D saved_errno;
+        return NULL;
+    }
+
+    return addr;
+}
+
+static void *freebsd_privcmd_map_foreign_range(xc_interface *xch,
+                                               xc_osdep_handle h,
+                                               uint32_t dom, int size, int prot,
+                                               unsigned long mfn)
+{
+    xen_pfn_t *arr;
+    int num;
+    int i;
+    void *ret;
+
+    num =3D (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
+    arr =3D calloc(num, sizeof(xen_pfn_t));
+    if ( arr =3D=3D NULL )
+        return NULL;
+
+    for ( i =3D 0; i < num; i++ )
+        arr[i] =3D mfn + i;
+
+    ret =3D xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
+static void *freebsd_privcmd_map_foreign_ranges(xc_interface *xch,
+                                                xc_osdep_handle h,
+                                                uint32_t dom, size_t size,
+                                                int prot, size_t chunksize,
+                                                privcmd_mmap_entry_t entries[],
+                                                int nentries)
+{
+    xen_pfn_t *arr;
+    int num_per_entry;
+    int num;
+    int i;
+    int j;
+    void *ret;
+
+    num_per_entry =3D chunksize >> XC_PAGE_SHIFT;
+    num =3D num_per_entry * nentries;
+    arr =3D calloc(num, sizeof(xen_pfn_t));
+    if ( arr =3D=3D NULL )
+        return NULL;
+
+    for ( i =3D 0; i < nentries; i++ )
+        for ( j =3D 0; j < num_per_entry; j++ )
+            arr[i * num_per_entry + j] =3D entries[i].mfn + j;
+
+    ret =3D xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
+/*----------------------------- Privcmd handlers -----------------------------*/
+static struct xc_osdep_ops freebsd_privcmd_ops =3D {
+    .open =3D &freebsd_privcmd_open,
+    .close =3D &freebsd_privcmd_close,
+
+    .u.privcmd =3D {
+        .alloc_hypercall_buffer =3D &freebsd_privcmd_alloc_hypercall_buffer,
+        .free_hypercall_buffer =3D &freebsd_privcmd_free_hypercall_buffer,
+
+        .hypercall =3D &freebsd_privcmd_hypercall,
+
+        .map_foreign_bulk =3D &freebsd_privcmd_map_foreign_bulk,
+        .map_foreign_range =3D &freebsd_privcmd_map_foreign_range,
+        .map_foreign_ranges =3D &freebsd_privcmd_map_foreign_ranges,
+    },
+};
+
+/*-------------------------- Evtchn device interface -------------------------*/
+static xc_osdep_handle
+freebsd_evtchn_open(xc_evtchn *xce)
+{
+    int fd =3D open(EVTCHN_DEV, O_RDWR);
+    if ( fd =3D=3D -1 )
+        return XC_OSDEP_OPEN_ERROR;
+
+    return (xc_osdep_handle)fd;
+}
+
+static int
+freebsd_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+{
+    int fd =3D (int)h;
+    return close(fd);
+}
+
+static int
+freebsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+{
+    return (int)h;
+}
+
+/*------------------------------ Evtchn interface ----------------------------*/
+static int
+freebsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+{
+    int fd =3D (int)h;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+{
+    int ret, fd =3D (int)h;
+    struct ioctl_evtchn_bind_unbound_port bind;
+
+    bind.remote_domain =3D domid;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+    return ( ret =3D=3D 0 ) =3F bind.port : ret;
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
+                                evtchn_port_t remote_port)
+{
+    int ret, fd =3D (int)h;
+    struct ioctl_evtchn_bind_interdomain bind;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+    return ( ret =3D=3D 0 ) =3F bind.port : ret;
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+{
+    int ret, fd =3D (int)h;
+    struct ioctl_evtchn_bind_virq bind;
+
+    bind.virq =3D virq;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    return ( ret =3D=3D 0 ) =3F bind.port : ret;
+}
+
+static int
+freebsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+{
+    int fd =3D (int)h;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+{
+    int fd =3D (int)h;
+    evtchn_port_t port;
+
+    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+
+    return port;
+}
+
+static int
+freebsd_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+{
+    int fd =3D (int)h;
+
+    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+    return 0;
+}
+
+/*----------------------------- Evtchn handlers ------------------------------*/
+static struct xc_osdep_ops freebsd_evtchn_ops =3D {
+    .open =3D &freebsd_evtchn_open,
+    .close =3D &freebsd_evtchn_close,
+
+    .u.evtchn =3D {
+        .fd =3D &freebsd_evtchn_fd,
+        .notify =3D &freebsd_evtchn_notify,
+        .bind_unbound_port =3D &freebsd_evtchn_bind_unbound_port,
+        .bind_interdomain =3D &freebsd_evtchn_bind_interdomain,
+        .bind_virq =3D &freebsd_evtchn_bind_virq,
+        .unbind =3D &freebsd_evtchn_unbind,
+        .pending =3D &freebsd_evtchn_pending,
+        .unmask =3D &freebsd_evtchn_unmask,
+    },
+};
+
+/*---------------------------- FreeBSD interface -----------------------------*/
+static struct xc_osdep_ops *
+freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
+{
+    switch ( type )
+    {
+    case XC_OSDEP_PRIVCMD:
+        return &freebsd_privcmd_ops;
+    case XC_OSDEP_EVTCHN:
+        return &freebsd_evtchn_ops;
+    default:
+        return NULL;
+    }
+}
+
+xc_osdep_info_t xc_osdep_info =3D {
+    .name =3D "FreeBSD Native OS interface",
+    .init =3D &freebsd_osdep_init,
+    .fake =3D 0,
+};
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:05 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:05 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJB-0007W2-66; Sun, 22 Jun 2014 18:16:05 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJ9-0007Vd-JQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:03 +0000
Content-Length: 16075
Received: from [85.158.139.211:60799] by server-10.bemta-5.messagelabs.com id
	8B/BC-01434-26D17A35; Sun, 22 Jun 2014 18:16:02 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403460960!11309889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6577 invoked from network); 22 Jun 2014 18:16:01 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:01 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJ6-0000HY-Ey
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:00 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJ6-0007pG-DJ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:00 +0000
Date: Sun, 22 Jun 2014 18:16:00 +0000
Message-Id: <E1WymJ6-0007pG-DJ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: add support for FreeBSD
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6782216381786412768=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6782216381786412768==
Content-Length: 16149
Content-Transfer-Encoding: quoted-printable

commit d2ee2e3846f9b2577d2387fef82dad563cdd1c9a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:11 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:17:49 2014 +0100

    libxc: add support for FreeBSD
    
    Add the FreeBSD implementation of the privcmd and evtchn devices
    interface.
    
    The evtchn device interface is the same as the Linux one, while the
    privcmd map interface is simplified because FreeBSD only supports
    IOCTL_PRIVCMD_MMAPBATCH.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/Makefile           |    1 +
 tools/libxc/xc_freebsd.c       |   72 +++++++
 tools/libxc/xc_freebsd_osdep.c |  405 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 478 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile
index 215101d..63be3d3 100644
--- a/tools/libxc/Makefile
+++ b/tools/libxc/Makefile
@@ -36,6 +36,7 @@ CTRL_SRCS-y       +=3D xtl_core.c
 CTRL_SRCS-y       +=3D xtl_logger_stdio.c
 CTRL_SRCS-$(CONFIG_X86) +=3D xc_pagetab.c
 CTRL_SRCS-$(CONFIG_Linux) +=3D xc_linux.c xc_linux_osdep.c
+CTRL_SRCS-$(CONFIG_FreeBSD) +=3D xc_freebsd.c xc_freebsd_osdep.c
 CTRL_SRCS-$(CONFIG_SunOS) +=3D xc_solaris.c
 CTRL_SRCS-$(CONFIG_NetBSD) +=3D xc_netbsd.c
 CTRL_SRCS-$(CONFIG_MiniOS) +=3D xc_minios.c
diff --git a/tools/libxc/xc_freebsd.c b/tools/libxc/xc_freebsd.c
new file mode 100644
index 0000000..8e70a91
--- /dev/null
+++ b/tools/libxc/xc_freebsd.c
@@ -0,0 +1,72 @@
+/******************************************************************************
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "xc_private.h"
+
+/* Optionally flush file to disk and discard page cache */
+void discard_file_cache(xc_interface *xch, int fd, int flush)
+{
+    off_t cur =3D 0;
+    int saved_errno =3D errno;
+
+    if ( flush && (fsync(fd) < 0) )
+        goto out;
+
+    /*
+     * Calculate last page boundary of amount written so far
+     * unless we are flushing in which case entire cache
+     * is discarded.
+     */
+    if ( !flush )
+    {
+        if ( (cur =3D lseek(fd, 0, SEEK_CUR)) =3D=3D (off_t)-1 )
+            cur =3D 0;
+        cur &=3D ~(XC_PAGE_SIZE-1);
+    }
+
+    /* Discard from the buffer cache. */
+    if ( posix_fadvise(fd, 0, cur, POSIX_FADV_DONTNEED) < 0 )
+        goto out;
+
+ out:
+    errno =3D saved_errno;
+}
+
+void *xc_memalign(xc_interface *xch, size_t alignment, size_t size)
+{
+    int ret;
+    void *ptr;
+
+    ret =3D posix_memalign(&ptr, alignment, size);
+    if ( ret !=3D 0 || !ptr )
+        return NULL;
+
+    return ptr;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/tools/libxc/xc_freebsd_osdep.c b/tools/libxc/xc_freebsd_osdep.c
new file mode 100644
index 0000000..151d3bf
--- /dev/null
+++ b/tools/libxc/xc_freebsd_osdep.c
@@ -0,0 +1,405 @@
+ /******************************************************************************
+ *
+ * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ *
+ * xc_gnttab functions:
+ * Copyright (c) 2007-2008, D G Murray <Derek.Murray@cl.cam.ac.uk>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+
+#include <xen/memory.h>
+#include <xen/sys/evtchn.h>
+
+#include "xenctrl.h"
+#include "xenctrlosdep.h"
+
+#define PRIVCMD_DEV     "/dev/xen/privcmd"
+#define EVTCHN_DEV      "/dev/xen/evtchn"
+
+#define PERROR(_m, _a...) xc_osdep_log(xch,XTL_ERROR,XC_INTERNAL_ERROR,_m \
+                  " (%d =3D %s)", ## _a , errno, xc_strerror(xch, errno))
+
+/*------------------------- Privcmd device interface -------------------------*/
+static xc_osdep_handle freebsd_privcmd_open(xc_interface *xch)
+{
+    int flags, saved_errno;
+    int fd =3D open(PRIVCMD_DEV, O_RDWR);
+
+    if ( fd =3D=3D -1 )
+    {
+        PERROR("Could not obtain handle on privileged command interface "
+               PRIVCMD_DEV);
+        return XC_OSDEP_OPEN_ERROR;
+    }
+
+    /*
+     * Although we return the file handle as the 'xc handle' the API
+     * does not specify / guarentee that this integer is in fact
+     * a file handle. Thus we must take responsiblity to ensure
+     * it doesn't propagate (ie leak) outside the process.
+     */
+    if ( (flags =3D fcntl(fd, F_GETFD)) < 0 )
+    {
+        PERROR("Could not get file handle flags");
+        goto error;
+    }
+
+    flags |=3D FD_CLOEXEC;
+
+    if ( fcntl(fd, F_SETFD, flags) < 0 )
+    {
+        PERROR("Could not set file handle flags");
+        goto error;
+    }
+
+    return (xc_osdep_handle)fd;
+
+ error:
+    saved_errno =3D errno;
+    close(fd);
+    errno =3D saved_errno;
+
+    return XC_OSDEP_OPEN_ERROR;
+}
+
+static int freebsd_privcmd_close(xc_interface *xch, xc_osdep_handle h)
+{
+    int fd =3D (int)h;
+
+    return close(fd);
+}
+
+/*------------------------ Privcmd hypercall interface -----------------------*/
+static void *freebsd_privcmd_alloc_hypercall_buffer(xc_interface *xch,
+                                                    xc_osdep_handle h,
+                                                    int npages)
+{
+    size_t size =3D npages * XC_PAGE_SIZE;
+    void *p;
+
+    /* Address returned by mmap is page aligned. */
+    p =3D mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS,
+             -1, 0);
+    if (p =3D=3D NULL)
+        return NULL;
+
+    /*
+     * Since FreeBSD doesn't have the MAP_LOCKED flag,
+     * lock memory using mlock.
+     */
+    if ( mlock(p, size) < 0 )
+    {
+        munmap(p, size);
+        return NULL;
+    }
+
+    return p;
+}
+
+static void freebsd_privcmd_free_hypercall_buffer(xc_interface *xch,
+                                                  xc_osdep_handle h, void *ptr,
+                                                  int npages)
+{
+
+    /* Unlock pages */
+    munlock(ptr, npages * XC_PAGE_SIZE);
+
+    munmap(ptr, npages * XC_PAGE_SIZE);
+}
+
+static int freebsd_privcmd_hypercall(xc_interface *xch, xc_osdep_handle h,
+                                     privcmd_hypercall_t *hypercall)
+{
+    int fd =3D (int)h;
+    int ret;
+
+    ret =3D ioctl(fd, IOCTL_PRIVCMD_HYPERCALL, hypercall);
+
+    return (ret =3D=3D 0) =3F hypercall->retval : ret;
+}
+
+/*----------------------- Privcmd foreign map interface ----------------------*/
+static void *freebsd_privcmd_map_foreign_bulk(xc_interface *xch,
+                                               xc_osdep_handle h,
+                                               uint32_t dom, int prot,
+                                               const xen_pfn_t *arr, int *err,
+                                               unsigned int num)
+{
+    int fd =3D (int)h;
+    privcmd_mmapbatch_t ioctlx;
+    void *addr;
+    int rc;
+
+    addr =3D mmap(NULL, num << XC_PAGE_SHIFT, prot, MAP_SHARED, fd, 0);
+    if ( addr =3D=3D MAP_FAILED )
+    {
+        PERROR("xc_map_foreign_batch: mmap failed");
+        return NULL;
+    }
+
+    ioctlx.num =3D num;
+    ioctlx.dom =3D dom;
+    ioctlx.addr =3D (unsigned long)addr;
+    ioctlx.arr =3D arr;
+    ioctlx.err =3D err;
+
+    rc =3D ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+    if ( rc < 0 )
+    {
+        int saved_errno =3D errno;
+        PERROR("xc_map_foreign_batch: ioctl failed");
+        (void)munmap(addr, num << XC_PAGE_SHIFT);
+        errno =3D saved_errno;
+        return NULL;
+    }
+
+    return addr;
+}
+
+static void *freebsd_privcmd_map_foreign_range(xc_interface *xch,
+                                               xc_osdep_handle h,
+                                               uint32_t dom, int size, int prot,
+                                               unsigned long mfn)
+{
+    xen_pfn_t *arr;
+    int num;
+    int i;
+    void *ret;
+
+    num =3D (size + XC_PAGE_SIZE - 1) >> XC_PAGE_SHIFT;
+    arr =3D calloc(num, sizeof(xen_pfn_t));
+    if ( arr =3D=3D NULL )
+        return NULL;
+
+    for ( i =3D 0; i < num; i++ )
+        arr[i] =3D mfn + i;
+
+    ret =3D xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
+static void *freebsd_privcmd_map_foreign_ranges(xc_interface *xch,
+                                                xc_osdep_handle h,
+                                                uint32_t dom, size_t size,
+                                                int prot, size_t chunksize,
+                                                privcmd_mmap_entry_t entries[],
+                                                int nentries)
+{
+    xen_pfn_t *arr;
+    int num_per_entry;
+    int num;
+    int i;
+    int j;
+    void *ret;
+
+    num_per_entry =3D chunksize >> XC_PAGE_SHIFT;
+    num =3D num_per_entry * nentries;
+    arr =3D calloc(num, sizeof(xen_pfn_t));
+    if ( arr =3D=3D NULL )
+        return NULL;
+
+    for ( i =3D 0; i < nentries; i++ )
+        for ( j =3D 0; j < num_per_entry; j++ )
+            arr[i * num_per_entry + j] =3D entries[i].mfn + j;
+
+    ret =3D xc_map_foreign_pages(xch, dom, prot, arr, num);
+    free(arr);
+    return ret;
+}
+
+/*----------------------------- Privcmd handlers -----------------------------*/
+static struct xc_osdep_ops freebsd_privcmd_ops =3D {
+    .open =3D &freebsd_privcmd_open,
+    .close =3D &freebsd_privcmd_close,
+
+    .u.privcmd =3D {
+        .alloc_hypercall_buffer =3D &freebsd_privcmd_alloc_hypercall_buffer,
+        .free_hypercall_buffer =3D &freebsd_privcmd_free_hypercall_buffer,
+
+        .hypercall =3D &freebsd_privcmd_hypercall,
+
+        .map_foreign_bulk =3D &freebsd_privcmd_map_foreign_bulk,
+        .map_foreign_range =3D &freebsd_privcmd_map_foreign_range,
+        .map_foreign_ranges =3D &freebsd_privcmd_map_foreign_ranges,
+    },
+};
+
+/*-------------------------- Evtchn device interface -------------------------*/
+static xc_osdep_handle
+freebsd_evtchn_open(xc_evtchn *xce)
+{
+    int fd =3D open(EVTCHN_DEV, O_RDWR);
+    if ( fd =3D=3D -1 )
+        return XC_OSDEP_OPEN_ERROR;
+
+    return (xc_osdep_handle)fd;
+}
+
+static int
+freebsd_evtchn_close(xc_evtchn *xce, xc_osdep_handle h)
+{
+    int fd =3D (int)h;
+    return close(fd);
+}
+
+static int
+freebsd_evtchn_fd(xc_evtchn *xce, xc_osdep_handle h)
+{
+    return (int)h;
+}
+
+/*------------------------------ Evtchn interface ----------------------------*/
+static int
+freebsd_evtchn_notify(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+{
+    int fd =3D (int)h;
+    struct ioctl_evtchn_notify notify;
+
+    notify.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_bind_unbound_port(xc_evtchn *xce, xc_osdep_handle h, int domid)
+{
+    int ret, fd =3D (int)h;
+    struct ioctl_evtchn_bind_unbound_port bind;
+
+    bind.remote_domain =3D domid;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_UNBOUND_PORT, &bind);
+    return ( ret =3D=3D 0 ) =3F bind.port : ret;
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_bind_interdomain(xc_evtchn *xce, xc_osdep_handle h, int domid,
+                                evtchn_port_t remote_port)
+{
+    int ret, fd =3D (int)h;
+    struct ioctl_evtchn_bind_interdomain bind;
+
+    bind.remote_domain =3D domid;
+    bind.remote_port =3D remote_port;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_INTERDOMAIN, &bind);
+    return ( ret =3D=3D 0 ) =3F bind.port : ret;
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_bind_virq(xc_evtchn *xce, xc_osdep_handle h, unsigned int virq)
+{
+    int ret, fd =3D (int)h;
+    struct ioctl_evtchn_bind_virq bind;
+
+    bind.virq =3D virq;
+
+    ret =3D ioctl(fd, IOCTL_EVTCHN_BIND_VIRQ, &bind);
+    return ( ret =3D=3D 0 ) =3F bind.port : ret;
+}
+
+static int
+freebsd_evtchn_unbind(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+{
+    int fd =3D (int)h;
+    struct ioctl_evtchn_unbind unbind;
+
+    unbind.port =3D port;
+
+    return ioctl(fd, IOCTL_EVTCHN_UNBIND, &unbind);
+}
+
+static evtchn_port_or_error_t
+freebsd_evtchn_pending(xc_evtchn *xce, xc_osdep_handle h)
+{
+    int fd =3D (int)h;
+    evtchn_port_t port;
+
+    if ( read(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+
+    return port;
+}
+
+static int
+freebsd_evtchn_unmask(xc_evtchn *xce, xc_osdep_handle h, evtchn_port_t port)
+{
+    int fd =3D (int)h;
+
+    if ( write(fd, &port, sizeof(port)) !=3D sizeof(port) )
+        return -1;
+    return 0;
+}
+
+/*----------------------------- Evtchn handlers ------------------------------*/
+static struct xc_osdep_ops freebsd_evtchn_ops =3D {
+    .open =3D &freebsd_evtchn_open,
+    .close =3D &freebsd_evtchn_close,
+
+    .u.evtchn =3D {
+        .fd =3D &freebsd_evtchn_fd,
+        .notify =3D &freebsd_evtchn_notify,
+        .bind_unbound_port =3D &freebsd_evtchn_bind_unbound_port,
+        .bind_interdomain =3D &freebsd_evtchn_bind_interdomain,
+        .bind_virq =3D &freebsd_evtchn_bind_virq,
+        .unbind =3D &freebsd_evtchn_unbind,
+        .pending =3D &freebsd_evtchn_pending,
+        .unmask =3D &freebsd_evtchn_unmask,
+    },
+};
+
+/*---------------------------- FreeBSD interface -----------------------------*/
+static struct xc_osdep_ops *
+freebsd_osdep_init(xc_interface *xch, enum xc_osdep_type type)
+{
+    switch ( type )
+    {
+    case XC_OSDEP_PRIVCMD:
+        return &freebsd_privcmd_ops;
+    case XC_OSDEP_EVTCHN:
+        return &freebsd_evtchn_ops;
+    default:
+        return NULL;
+    }
+}
+
+xc_osdep_info_t xc_osdep_info =3D {
+    .name =3D "FreeBSD Native OS interface",
+    .init =3D &freebsd_osdep_init,
+    .fake =3D 0,
+};
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJK-0007Xa-Aw; Sun, 22 Jun 2014 18:16:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJI-0007XJ-Sl
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:13 +0000
Received: from [85.158.143.35:52808] by server-3.bemta-4.messagelabs.com id
	80/33-16194-C6D17A35; Sun, 22 Jun 2014 18:16:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1403460970!13011035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11404 invoked from network); 22 Jun 2014 18:16:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJG-0000I7-K0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJG-0007pq-IA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:10 +0000
Date: Sun, 22 Jun 2014 18:16:10 +0000
Message-Id: <E1WymJG-0007pq-IA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove broken endianess gate on
	lz4 decompressor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4679600655276580450=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit fbcc8b292638c07fa114fc904baf0e59a642e7ba
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:12 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:13 2014 +0100

    libxc: remove broken endianess gate on lz4 decompressor
    
    The lz4 decompressor had wrongly implemented a gate between
    little-endian and big-endian versions of get_unaligned_le{16/32},
    which turns out to be broken on all architectures supported by Xen,
    because __LITTLE_ENDIAN is not defined. Instead of trying to fix
    this, just implement the little-endian version and remove the switch.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_decompress_lz4.c |    1 -
 xen/common/lz4/defs.h               |   14 --------------
 2 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c
index 08272fe..490ec56 100644
--- a/tools/libxc/xc_dom_decompress_lz4.c
+++ b/tools/libxc/xc_dom_decompress_lz4.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <inttypes.h>
-#include <endian.h>
 #include <stdint.h>
 
 #include "xg_private.h"
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index f46df08..d886a4e 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -12,7 +12,6 @@
 #include <asm/byteorder.h>
 #endif
 
-#ifdef __LITTLE_ENDIAN
 static inline u16 INIT get_unaligned_le16(const void *p)
 {
 	return le16_to_cpup(p);
@@ -22,19 +21,6 @@ static inline u32 INIT get_unaligned_le32(const void *p)
 {
 	return le32_to_cpup(p);
 }
-#else
-#include <asm/unaligned.h>
-
-static inline u16 INIT get_unaligned_le16(const void *p)
-{
-	return le16_to_cpu(__get_unaligned(p, 2));
-}
-
-static inline u32 INIT get_unaligned_le32(void *p)
-{
-	return le32_to_cpu(__get_unaligned(p, 4));
-}
-#endif
 
 /*
  * Detects 64 bits mode
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJK-0007Xa-Aw; Sun, 22 Jun 2014 18:16:14 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJI-0007XJ-Sl
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:13 +0000
Received: from [85.158.143.35:52808] by server-3.bemta-4.messagelabs.com id
	80/33-16194-C6D17A35; Sun, 22 Jun 2014 18:16:12 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-21.messagelabs.com!1403460970!13011035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11404 invoked from network); 22 Jun 2014 18:16:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:11 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJG-0000I7-K0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJG-0007pq-IA
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:10 +0000
Date: Sun, 22 Jun 2014 18:16:10 +0000
Message-Id: <E1WymJG-0007pq-IA@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: remove broken endianess gate on
	lz4 decompressor
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4679600655276580450=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit fbcc8b292638c07fa114fc904baf0e59a642e7ba
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:12 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:13 2014 +0100

    libxc: remove broken endianess gate on lz4 decompressor
    
    The lz4 decompressor had wrongly implemented a gate between
    little-endian and big-endian versions of get_unaligned_le{16/32},
    which turns out to be broken on all architectures supported by Xen,
    because __LITTLE_ENDIAN is not defined. Instead of trying to fix
    this, just implement the little-endian version and remove the switch.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxc/xc_dom_decompress_lz4.c |    1 -
 xen/common/lz4/defs.h               |   14 --------------
 2 files changed, 0 insertions(+), 15 deletions(-)

diff --git a/tools/libxc/xc_dom_decompress_lz4.c b/tools/libxc/xc_dom_decompress_lz4.c
index 08272fe..490ec56 100644
--- a/tools/libxc/xc_dom_decompress_lz4.c
+++ b/tools/libxc/xc_dom_decompress_lz4.c
@@ -1,7 +1,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <inttypes.h>
-#include <endian.h>
 #include <stdint.h>
 
 #include "xg_private.h"
diff --git a/xen/common/lz4/defs.h b/xen/common/lz4/defs.h
index f46df08..d886a4e 100644
--- a/xen/common/lz4/defs.h
+++ b/xen/common/lz4/defs.h
@@ -12,7 +12,6 @@
 #include <asm/byteorder.h>
 #endif
 
-#ifdef __LITTLE_ENDIAN
 static inline u16 INIT get_unaligned_le16(const void *p)
 {
 	return le16_to_cpup(p);
@@ -22,19 +21,6 @@ static inline u32 INIT get_unaligned_le32(const void *p)
 {
 	return le32_to_cpup(p);
 }
-#else
-#include <asm/unaligned.h>
-
-static inline u16 INIT get_unaligned_le16(const void *p)
-{
-	return le16_to_cpu(__get_unaligned(p, 2));
-}
-
-static inline u32 INIT get_unaligned_le32(void *p)
-{
-	return le32_to_cpu(__get_unaligned(p, 4));
-}
-#endif
 
 /*
  * Detects 64 bits mode
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJV-0007ZN-Dr; Sun, 22 Jun 2014 18:16:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJT-0007Z0-P0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:23 +0000
Content-Length: 7544
Received: from [85.158.139.211:61243] by server-3.bemta-5.messagelabs.com id
	81/FA-01676-77D17A35; Sun, 22 Jun 2014 18:16:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403460980!8430451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 753 invoked from network); 22 Jun 2014 18:16:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJQ-0000ID-OB
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJQ-0007qH-Mp
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:20 +0000
Date: Sun, 22 Jun 2014 18:16:20 +0000
Message-Id: <E1WymJQ-0007qH-Mp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstored: unify xenstored OS-specific
	bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7841561302727368182=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7841561302727368182==
Content-Length: 7382
Content-Transfer-Encoding: quoted-printable

commit eda70ab3a83dad806cd9993fa6df149a3edac5a6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:13 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:26 2014 +0100

    xenstored: unify xenstored OS-specific bits
    
    The Solaris implementation seems too different, so this patch only
    folds both the Linux and NetBSD implementations.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile           |    4 +-
 tools/xenstore/xenstored_linux.c  |   73 -------------------------------------
 tools/xenstore/xenstored_netbsd.c |   73 -------------------------------------
 tools/xenstore/xenstored_osdep.h  |   17 +++++++++
 tools/xenstore/xenstored_posix.c  |   54 +++++++++++++++++++++++++++
 5 files changed, 73 insertions(+), 148 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index b626104..c0c7bb2 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -13,9 +13,9 @@ CLIENTS +=3D xenstore-write xenstore-ls xenstore-watch
 
 XENSTORED_OBJS =3D xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
 
-XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_linux.o xenstored_posix.o
+XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_SunOS) =3D xenstored_solaris.o xenstored_posix.o xenstored_probes.o
-XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_netbsd.o xenstored_posix.o
+XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_MiniOS) =3D xenstored_minios.o
 
 XENSTORED_OBJS +=3D $(XENSTORED_OBJS_y)
diff --git a/tools/xenstore/xenstored_linux.c b/tools/xenstore/xenstored_linux.c
deleted file mode 100644
index cf40213..0000000
--- a/tools/xenstore/xenstored_linux.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/******************************************************************************
- *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (C) 2005 Rusty Russell IBM Corporation
- *
- * 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, version 2 of the
- * License.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-#include "xenstored_core.h"
-
-#define XENSTORED_PROC_KVA  "/proc/xen/xsd_kva"
-#define XENSTORED_PROC_PORT "/proc/xen/xsd_port"
-
-evtchn_port_t xenbus_evtchn(void)
-{
-	int fd;
-	int rc;
-	evtchn_port_t port; 
-	char str[20]; 
-
-	fd =3D open(XENSTORED_PROC_PORT, O_RDONLY); 
-	if (fd =3D=3D -1)
-		return -1;
-
-	rc =3D read(fd, str, sizeof(str) - 1);
-	if (rc =3D=3D -1)
-	{
-		int err =3D errno;
-		close(fd);
-		errno =3D err;
-		return -1;
-	}
-
-	str[rc] =3D '\0'; 
-	port =3D strtoul(str, NULL, 0); 
-
-	close(fd); 
-	return port;
-}
-
-void *xenbus_map(void)
-{
-	int fd;
-	void *addr;
-
-	fd =3D open(XENSTORED_PROC_KVA, O_RDWR);
-	if (fd =3D=3D -1)
-		return NULL;
-
-	addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
-		MAP_SHARED, fd, 0);
-
-	if (addr =3D=3D MAP_FAILED)
-		addr =3D NULL;
-
-	close(fd);
-
-	return addr;
-}
-
-void xenbus_notify_running(void)
-{
-}
diff --git a/tools/xenstore/xenstored_netbsd.c b/tools/xenstore/xenstored_netbsd.c
deleted file mode 100644
index 1e94e41..0000000
--- a/tools/xenstore/xenstored_netbsd.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/******************************************************************************
- *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (C) 2005 Rusty Russell IBM Corporation
- *
- * 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, version 2 of the
- * License.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-#include "xenstored_core.h"
-
-#define XENSTORED_PROC_KVA  "/dev/xsd_kva"
-#define XENSTORED_PROC_PORT "/kern/xen/xsd_port"
-
-evtchn_port_t xenbus_evtchn(void)
-{
-	int fd;
-	int rc;
-	evtchn_port_t port; 
-	char str[20]; 
-
-	fd =3D open(XENSTORED_PROC_PORT, O_RDONLY); 
-	if (fd =3D=3D -1)
-		return -1;
-
-	rc =3D read(fd, str, sizeof(str)); 
-	if (rc =3D=3D -1)
-	{
-		int err =3D errno;
-		close(fd);
-		errno =3D err;
-		return -1;
-	}
-
-	str[rc] =3D '\0'; 
-	port =3D strtoul(str, NULL, 0); 
-
-	close(fd); 
-	return port;
-}
-
-void *xenbus_map(void)
-{
-	int fd;
-	void *addr;
-
-	fd =3D open(XENSTORED_PROC_KVA, O_RDWR);
-	if (fd =3D=3D -1)
-		return NULL;
-
-	addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
-		MAP_SHARED, fd, 0);
-
-	if (addr =3D=3D MAP_FAILED)
-		addr =3D NULL;
-
-	close(fd);
-
-	return addr;
-}
-
-void xenbus_notify_running(void)
-{
-}
diff --git a/tools/xenstore/xenstored_osdep.h b/tools/xenstore/xenstored_osdep.h
new file mode 100644
index 0000000..73c6461
--- /dev/null
+++ b/tools/xenstore/xenstored_osdep.h
@@ -0,0 +1,17 @@
+/*
+ * OS specific bits for xenstored
+ * Copyright (C) 2014 Citrix Systems R&D.
+ *
+ * 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, version 2 of the
+ * License.
+ */
+
+#if defined(__linux__)
+#define XENSTORED_KVA_DEV  "/proc/xen/xsd_kva"
+#define XENSTORED_PORT_DEV "/proc/xen/xsd_port"
+#elif defined(__NetBSD__)
+#define XENSTORED_KVA_DEV  "/dev/xsd_kva"
+#define XENSTORED_PORT_DEV "/kern/xen/xsd_port"
+#endif
diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c
index 0c93e6d..ecf4386 100644
--- a/tools/xenstore/xenstored_posix.c
+++ b/tools/xenstore/xenstored_posix.c
@@ -26,6 +26,7 @@
 
 #include "utils.h"
 #include "xenstored_core.h"
+#include "xenstored_osdep.h"
 
 void write_pidfile(const char *pidfile)
 {
@@ -99,3 +100,56 @@ void unmap_xenbus(void *interface)
 {
 	munmap(interface, getpagesize());
 }
+
+#ifndef __sun__
+evtchn_port_t xenbus_evtchn(void)
+{
+	int fd;
+	int rc;
+	evtchn_port_t port;
+	char str[20];
+
+	fd =3D open(XENSTORED_PORT_DEV, O_RDONLY);
+	if (fd =3D=3D -1)
+		return -1;
+
+	rc =3D read(fd, str, sizeof(str) - 1);
+	if (rc =3D=3D -1)
+	{
+		int err =3D errno;
+		close(fd);
+		errno =3D err;
+		return -1;
+	}
+
+	str[rc] =3D '\0';
+	port =3D strtoul(str, NULL, 0);
+
+	close(fd);
+	return port;
+}
+
+void *xenbus_map(void)
+{
+	int fd;
+	void *addr;
+
+	fd =3D open(XENSTORED_KVA_DEV, O_RDWR);
+	if (fd =3D=3D -1)
+		return NULL;
+
+	addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
+		MAP_SHARED, fd, 0);
+
+	if (addr =3D=3D MAP_FAILED)
+		addr =3D NULL;
+
+	close(fd);
+
+	return addr;
+}
+
+void xenbus_notify_running(void)
+{
+}
+#endif /* !__sun__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJV-0007ZN-Dr; Sun, 22 Jun 2014 18:16:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJT-0007Z0-P0
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:23 +0000
Content-Length: 7544
Received: from [85.158.139.211:61243] by server-3.bemta-5.messagelabs.com id
	81/FA-01676-77D17A35; Sun, 22 Jun 2014 18:16:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403460980!8430451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 753 invoked from network); 22 Jun 2014 18:16:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:21 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJQ-0000ID-OB
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJQ-0007qH-Mp
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:20 +0000
Date: Sun, 22 Jun 2014 18:16:20 +0000
Message-Id: <E1WymJQ-0007qH-Mp@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstored: unify xenstored OS-specific
	bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7841561302727368182=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7841561302727368182==
Content-Length: 7382
Content-Transfer-Encoding: quoted-printable

commit eda70ab3a83dad806cd9993fa6df149a3edac5a6
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:13 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:26 2014 +0100

    xenstored: unify xenstored OS-specific bits
    
    The Solaris implementation seems too different, so this patch only
    folds both the Linux and NetBSD implementations.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile           |    4 +-
 tools/xenstore/xenstored_linux.c  |   73 -------------------------------------
 tools/xenstore/xenstored_netbsd.c |   73 -------------------------------------
 tools/xenstore/xenstored_osdep.h  |   17 +++++++++
 tools/xenstore/xenstored_posix.c  |   54 +++++++++++++++++++++++++++
 5 files changed, 73 insertions(+), 148 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index b626104..c0c7bb2 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -13,9 +13,9 @@ CLIENTS +=3D xenstore-write xenstore-ls xenstore-watch
 
 XENSTORED_OBJS =3D xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o hashtable.o
 
-XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_linux.o xenstored_posix.o
+XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_SunOS) =3D xenstored_solaris.o xenstored_posix.o xenstored_probes.o
-XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_netbsd.o xenstored_posix.o
+XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_MiniOS) =3D xenstored_minios.o
 
 XENSTORED_OBJS +=3D $(XENSTORED_OBJS_y)
diff --git a/tools/xenstore/xenstored_linux.c b/tools/xenstore/xenstored_linux.c
deleted file mode 100644
index cf40213..0000000
--- a/tools/xenstore/xenstored_linux.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/******************************************************************************
- *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (C) 2005 Rusty Russell IBM Corporation
- *
- * 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, version 2 of the
- * License.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-#include "xenstored_core.h"
-
-#define XENSTORED_PROC_KVA  "/proc/xen/xsd_kva"
-#define XENSTORED_PROC_PORT "/proc/xen/xsd_port"
-
-evtchn_port_t xenbus_evtchn(void)
-{
-	int fd;
-	int rc;
-	evtchn_port_t port; 
-	char str[20]; 
-
-	fd =3D open(XENSTORED_PROC_PORT, O_RDONLY); 
-	if (fd =3D=3D -1)
-		return -1;
-
-	rc =3D read(fd, str, sizeof(str) - 1);
-	if (rc =3D=3D -1)
-	{
-		int err =3D errno;
-		close(fd);
-		errno =3D err;
-		return -1;
-	}
-
-	str[rc] =3D '\0'; 
-	port =3D strtoul(str, NULL, 0); 
-
-	close(fd); 
-	return port;
-}
-
-void *xenbus_map(void)
-{
-	int fd;
-	void *addr;
-
-	fd =3D open(XENSTORED_PROC_KVA, O_RDWR);
-	if (fd =3D=3D -1)
-		return NULL;
-
-	addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
-		MAP_SHARED, fd, 0);
-
-	if (addr =3D=3D MAP_FAILED)
-		addr =3D NULL;
-
-	close(fd);
-
-	return addr;
-}
-
-void xenbus_notify_running(void)
-{
-}
diff --git a/tools/xenstore/xenstored_netbsd.c b/tools/xenstore/xenstored_netbsd.c
deleted file mode 100644
index 1e94e41..0000000
--- a/tools/xenstore/xenstored_netbsd.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/******************************************************************************
- *
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (C) 2005 Rusty Russell IBM Corporation
- *
- * 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, version 2 of the
- * License.
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-
-#include "xenstored_core.h"
-
-#define XENSTORED_PROC_KVA  "/dev/xsd_kva"
-#define XENSTORED_PROC_PORT "/kern/xen/xsd_port"
-
-evtchn_port_t xenbus_evtchn(void)
-{
-	int fd;
-	int rc;
-	evtchn_port_t port; 
-	char str[20]; 
-
-	fd =3D open(XENSTORED_PROC_PORT, O_RDONLY); 
-	if (fd =3D=3D -1)
-		return -1;
-
-	rc =3D read(fd, str, sizeof(str)); 
-	if (rc =3D=3D -1)
-	{
-		int err =3D errno;
-		close(fd);
-		errno =3D err;
-		return -1;
-	}
-
-	str[rc] =3D '\0'; 
-	port =3D strtoul(str, NULL, 0); 
-
-	close(fd); 
-	return port;
-}
-
-void *xenbus_map(void)
-{
-	int fd;
-	void *addr;
-
-	fd =3D open(XENSTORED_PROC_KVA, O_RDWR);
-	if (fd =3D=3D -1)
-		return NULL;
-
-	addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
-		MAP_SHARED, fd, 0);
-
-	if (addr =3D=3D MAP_FAILED)
-		addr =3D NULL;
-
-	close(fd);
-
-	return addr;
-}
-
-void xenbus_notify_running(void)
-{
-}
diff --git a/tools/xenstore/xenstored_osdep.h b/tools/xenstore/xenstored_osdep.h
new file mode 100644
index 0000000..73c6461
--- /dev/null
+++ b/tools/xenstore/xenstored_osdep.h
@@ -0,0 +1,17 @@
+/*
+ * OS specific bits for xenstored
+ * Copyright (C) 2014 Citrix Systems R&D.
+ *
+ * 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, version 2 of the
+ * License.
+ */
+
+#if defined(__linux__)
+#define XENSTORED_KVA_DEV  "/proc/xen/xsd_kva"
+#define XENSTORED_PORT_DEV "/proc/xen/xsd_port"
+#elif defined(__NetBSD__)
+#define XENSTORED_KVA_DEV  "/dev/xsd_kva"
+#define XENSTORED_PORT_DEV "/kern/xen/xsd_port"
+#endif
diff --git a/tools/xenstore/xenstored_posix.c b/tools/xenstore/xenstored_posix.c
index 0c93e6d..ecf4386 100644
--- a/tools/xenstore/xenstored_posix.c
+++ b/tools/xenstore/xenstored_posix.c
@@ -26,6 +26,7 @@
 
 #include "utils.h"
 #include "xenstored_core.h"
+#include "xenstored_osdep.h"
 
 void write_pidfile(const char *pidfile)
 {
@@ -99,3 +100,56 @@ void unmap_xenbus(void *interface)
 {
 	munmap(interface, getpagesize());
 }
+
+#ifndef __sun__
+evtchn_port_t xenbus_evtchn(void)
+{
+	int fd;
+	int rc;
+	evtchn_port_t port;
+	char str[20];
+
+	fd =3D open(XENSTORED_PORT_DEV, O_RDONLY);
+	if (fd =3D=3D -1)
+		return -1;
+
+	rc =3D read(fd, str, sizeof(str) - 1);
+	if (rc =3D=3D -1)
+	{
+		int err =3D errno;
+		close(fd);
+		errno =3D err;
+		return -1;
+	}
+
+	str[rc] =3D '\0';
+	port =3D strtoul(str, NULL, 0);
+
+	close(fd);
+	return port;
+}
+
+void *xenbus_map(void)
+{
+	int fd;
+	void *addr;
+
+	fd =3D open(XENSTORED_KVA_DEV, O_RDWR);
+	if (fd =3D=3D -1)
+		return NULL;
+
+	addr =3D mmap(NULL, getpagesize(), PROT_READ|PROT_WRITE,
+		MAP_SHARED, fd, 0);
+
+	if (addr =3D=3D MAP_FAILED)
+		addr =3D NULL;
+
+	close(fd);
+
+	return addr;
+}
+
+void xenbus_notify_running(void)
+{
+}
+#endif /* !__sun__ */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:35 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJf-0007b7-Gt; Sun, 22 Jun 2014 18:16:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJe-0007av-TD
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:35 +0000
Content-Length: 2361
Received: from [85.158.139.211:61480] by server-15.bemta-5.messagelabs.com id
	59/6A-19516-28D17A35; Sun, 22 Jun 2014 18:16:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403460991!11340468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16472 invoked from network); 22 Jun 2014 18:16:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJa-0000IJ-Sg
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJa-0007qf-Qz
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:30 +0000
Date: Sun, 22 Jun 2014 18:16:30 +0000
Message-Id: <E1WymJa-0007qf-Qz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstored: add FreeBSD xenstored
	device paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0107111433782646745=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0107111433782646745==
Content-Length: 1955
Content-Transfer-Encoding: quoted-printable

commit e9545545792dbbe0cec1db42ee4ad1de91794f87
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:14 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:35 2014 +0100

    xenstored: add FreeBSD xenstored device paths
    
    Add the path to FreeBSD special xenstored device, this is all that's
    needed to get xenstored working on FreeBSD after the unification of
    the implementations.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile          |    1 +
 tools/xenstore/xenstored_osdep.h |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index c0c7bb2..e34bd41 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -16,6 +16,7 @@ XENSTORED_OBJS =3D xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored
 XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_SunOS) =3D xenstored_solaris.o xenstored_posix.o xenstored_probes.o
 XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_posix.o
+XENSTORED_OBJS_$(CONFIG_FreeBSD) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_MiniOS) =3D xenstored_minios.o
 
 XENSTORED_OBJS +=3D $(XENSTORED_OBJS_y)
diff --git a/tools/xenstore/xenstored_osdep.h b/tools/xenstore/xenstored_osdep.h
index 73c6461..b3e630c 100644
--- a/tools/xenstore/xenstored_osdep.h
+++ b/tools/xenstore/xenstored_osdep.h
@@ -14,4 +14,7 @@
 #elif defined(__NetBSD__)
 #define XENSTORED_KVA_DEV  "/dev/xsd_kva"
 #define XENSTORED_PORT_DEV "/kern/xen/xsd_port"
+#elif defined(__FreeBSD__)
+#define XENSTORED_KVA_DEV  "/dev/xen/xenstored"
+#define XENSTORED_PORT_DEV "/dev/xen/xenstored"
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:35 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJf-0007b7-Gt; Sun, 22 Jun 2014 18:16:35 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJe-0007av-TD
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:35 +0000
Content-Length: 2361
Received: from [85.158.139.211:61480] by server-15.bemta-5.messagelabs.com id
	59/6A-19516-28D17A35; Sun, 22 Jun 2014 18:16:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403460991!11340468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16472 invoked from network); 22 Jun 2014 18:16:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJa-0000IJ-Sg
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJa-0007qf-Qz
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:30 +0000
Date: Sun, 22 Jun 2014 18:16:30 +0000
Message-Id: <E1WymJa-0007qf-Qz@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] xenstored: add FreeBSD xenstored
	device paths
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============0107111433782646745=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============0107111433782646745==
Content-Length: 1955
Content-Transfer-Encoding: quoted-printable

commit e9545545792dbbe0cec1db42ee4ad1de91794f87
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:14 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:35 2014 +0100

    xenstored: add FreeBSD xenstored device paths
    
    Add the path to FreeBSD special xenstored device, this is all that's
    needed to get xenstored working on FreeBSD after the unification of
    the implementations.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/xenstore/Makefile          |    1 +
 tools/xenstore/xenstored_osdep.h |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/xenstore/Makefile b/tools/xenstore/Makefile
index c0c7bb2..e34bd41 100644
--- a/tools/xenstore/Makefile
+++ b/tools/xenstore/Makefile
@@ -16,6 +16,7 @@ XENSTORED_OBJS =3D xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored
 XENSTORED_OBJS_$(CONFIG_Linux) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_SunOS) =3D xenstored_solaris.o xenstored_posix.o xenstored_probes.o
 XENSTORED_OBJS_$(CONFIG_NetBSD) =3D xenstored_posix.o
+XENSTORED_OBJS_$(CONFIG_FreeBSD) =3D xenstored_posix.o
 XENSTORED_OBJS_$(CONFIG_MiniOS) =3D xenstored_minios.o
 
 XENSTORED_OBJS +=3D $(XENSTORED_OBJS_y)
diff --git a/tools/xenstore/xenstored_osdep.h b/tools/xenstore/xenstored_osdep.h
index 73c6461..b3e630c 100644
--- a/tools/xenstore/xenstored_osdep.h
+++ b/tools/xenstore/xenstored_osdep.h
@@ -14,4 +14,7 @@
 #elif defined(__NetBSD__)
 #define XENSTORED_KVA_DEV  "/dev/xsd_kva"
 #define XENSTORED_PORT_DEV "/kern/xen/xsd_port"
+#elif defined(__FreeBSD__)
+#define XENSTORED_KVA_DEV  "/dev/xen/xenstored"
+#define XENSTORED_PORT_DEV "/dev/xen/xenstored"
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJp-0007ca-Jp; Sun, 22 Jun 2014 18:16:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJo-0007cH-S7
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:44 +0000
Content-Length: 1669
Received: from [85.158.139.211:57977] by server-12.bemta-5.messagelabs.com id
	21/F0-27841-C8D17A35; Sun, 22 Jun 2014 18:16:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403461001!8430473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1932 invoked from network); 22 Jun 2014 18:16:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJl-0000IP-0d
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJk-0007rY-VQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:40 +0000
Date: Sun, 22 Jun 2014 18:16:40 +0000
Message-Id: <E1WymJk-0007rY-VQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] console: add FreeBSD includes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2235606871791668222=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2235606871791668222==
Content-Length: 1257
Content-Transfer-Encoding: quoted-printable

commit 993ea0862e10b7cf4b0c32b9fc2472428d2a2778
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:15 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:45 2014 +0100

    console: add FreeBSD includes
    
    Add FreeBSD specific includes to the console daemon.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/console/daemon/io.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 007ecf4..46719a8 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -37,12 +37,16 @@
 #include <sys/mman.h>
 #include <time.h>
 #include <assert.h>
+#include <sys/types.h>
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 #include <util.h>
 #elif defined(__linux__)
 #include <pty.h>
 #elif defined(__sun__)
 #include <stropts.h>
+#elif defined(__FreeBSD__)
+#include <sys/ioctl.h>
+#include <libutil.h>
 #endif
 
 #define MAX(a, b) (((a) > (b)) =3F (a) : (b))
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:45 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:45 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJp-0007ca-Jp; Sun, 22 Jun 2014 18:16:45 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJo-0007cH-S7
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:44 +0000
Content-Length: 1669
Received: from [85.158.139.211:57977] by server-12.bemta-5.messagelabs.com id
	21/F0-27841-C8D17A35; Sun, 22 Jun 2014 18:16:44 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-206.messagelabs.com!1403461001!8430473!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1932 invoked from network); 22 Jun 2014 18:16:42 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJl-0000IP-0d
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJk-0007rY-VQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:40 +0000
Date: Sun, 22 Jun 2014 18:16:40 +0000
Message-Id: <E1WymJk-0007rY-VQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] console: add FreeBSD includes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2235606871791668222=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============2235606871791668222==
Content-Length: 1257
Content-Transfer-Encoding: quoted-printable

commit 993ea0862e10b7cf4b0c32b9fc2472428d2a2778
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:15 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:45 2014 +0100

    console: add FreeBSD includes
    
    Add FreeBSD specific includes to the console daemon.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/console/daemon/io.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/console/daemon/io.c b/tools/console/daemon/io.c
index 007ecf4..46719a8 100644
--- a/tools/console/daemon/io.c
+++ b/tools/console/daemon/io.c
@@ -37,12 +37,16 @@
 #include <sys/mman.h>
 #include <time.h>
 #include <assert.h>
+#include <sys/types.h>
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 #include <util.h>
 #elif defined(__linux__)
 #include <pty.h>
 #elif defined(__sun__)
 #include <stropts.h>
+#elif defined(__FreeBSD__)
+#include <sys/ioctl.h>
+#include <libutil.h>
 #endif
 
 #define MAX(a, b) (((a) > (b)) =3F (a) : (b))
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJy-0007e4-Mt; Sun, 22 Jun 2014 18:16:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJx-0007dq-UQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:54 +0000
Content-Length: 6165
Received: from [85.158.139.211:4352] by server-16.bemta-5.messagelabs.com id
	B0/4E-18862-59D17A35; Sun, 22 Jun 2014 18:16:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1403461011!11312418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24425 invoked from network); 22 Jun 2014 18:16:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJv-0000IV-An
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJv-0007rv-3K
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:51 +0000
Date: Sun, 22 Jun 2014 18:16:51 +0000
Message-Id: <E1WymJv-0007rv-3K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] init: add FreeBSD xencommons init
	script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4422805872185145468=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4422805872185145468==
Content-Length: 5923
Content-Transfer-Encoding: quoted-printable

commit 5dcdb2bf569ba5cf7f63ef682fc0bb106934cde4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:16 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:56 2014 +0100

    init: add FreeBSD xencommons init script
    
    This is a clone of the NetBSD xencommons init script with some minor
    modifications.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile        |   43 ++++++++++++
 tools/hotplug/FreeBSD/rc.d/xencommons |  121 +++++++++++++++++++++++++++++++++
 tools/hotplug/Makefile                |    1 +
 3 files changed, 165 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
new file mode 100644
index 0000000..c7ffc51
--- /dev/null
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -0,0 +1,43 @@
+XEN_ROOT =3D $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+# Xen script dir and scripts to go there.
+XEN_SCRIPTS =3D
+
+XEN_SCRIPT_DATA =3D
+
+XEN_RCD_PROG =3D rc.d/xencommons
+
+.PHONY: all
+all:
+
+.PHONY: build
+build:
+
+.PHONY: install
+install: all install-scripts install-rcd
+
+.PHONY: install-scripts
+install-scripts:
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
+	set -e; for i in $(XEN_SCRIPTS); \
+	   do \
+	   $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
+	done
+	set -e; for i in $(XEN_SCRIPT_DATA); \
+	   do \
+	   $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
+	done
+
+.PHONY: install-rcd
+install-rcd:
+	$(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d
+	set -e; for i in $(XEN_RCD_PROG); \
+	   do \
+	   $(INSTALL_PROG) $$i $(DESTDIR)$(CONFIG_DIR)/rc.d; \
+	   sed -i '' 's,@xen_script_dir@,$(DESTDIR)$(XEN_SCRIPT_DIR),g' $(DESTDIR)$(CONFIG_DIR)/$$i; \
+	done
+	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
+
+.PHONY: clean
+clean:
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons b/tools/hotplug/FreeBSD/rc.d/xencommons
new file mode 100644
index 0000000..a797016
--- /dev/null
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons
@@ -0,0 +1,121 @@
+#!/bin/sh
+#
+# PROVIDE: xencommons
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+. @xen_script_dir@/hotplugpath.sh
+
+LD_LIBRARY_PATH=3D"${LIBDIR}"
+export LD_LIBRARY_PATH
+
+name=3D"xencommons"
+start_precmd=3D"xen_precmd"
+start_cmd=3D"xen_startcmd"
+stop_cmd=3D"xen_stop"
+status_cmd=3D"xen_status"
+extra_commands=3D"status"
+required_files=3D"/dev/xen/privcmd"
+
+XENSTORED_PIDFILE=3D"/var/run/xenstored.pid"
+XENCONSOLED_PIDFILE=3D"/var/run/xenconsoled.pid"
+#XENCONSOLED_TRACE=3D"/var/log/xen/xenconsole-trace.log"
+#XENSTORED_TRACE=3D"/var/log/xen/xenstore-trace.log"
+
+xen_precmd()
+{
+	mkdir -p /var/run/xenstored || exit 1
+}
+
+xen_startcmd()
+{
+	local time=3D0
+	local timeout=3D30
+
+	xenstored_pid=3D$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	if test -z "$xenstored_pid"; then
+		printf "Cleaning xenstore database.\n"
+		if [ -z "${XENSTORED_ROOTDIR}" ]; then
+			XENSTORED_ROOTDIR=3D"/var/lib/xenstored"
+		fi
+		rm -f ${XENSTORED_ROOTDIR}/tdb* >/dev/null 2>&1
+		printf "Starting xenservices: xenstored, xenconsoled."
+		XENSTORED_ARGS=3D" --pid-file ${XENSTORED_PIDFILE}"
+		if [ -n "${XENSTORED_TRACE}" ]; then
+			XENSTORED_ARGS=3D"${XENSTORED_ARGS} -T /var/log/xen/xenstored-trace.log"
+		fi
+		${SBINDIR}/xenstored ${XENSTORED_ARGS}
+		while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
+			printf "."
+			time=3D$(($time+1))
+			sleep 1
+		done
+	else
+		printf "Starting xenservices: xenconsoled."
+	fi
+
+	XENCONSOLED_ARGS=3D""
+	if [ -n "${XENCONSOLED_TRACE}" ]; then
+		XENCONSOLED_ARGS=3D"${XENCONSOLED_ARGS} --log=3D${XENCONSOLED_TRACE}"
+	fi
+
+	${SBINDIR}/xenconsoled ${XENCONSOLED_ARGS}
+
+	printf "\n"
+
+	printf "Setting domain 0 name and domid.\n"
+	${BINDIR}/xenstore-write "/local/domain/0/name" "Domain-0"
+	${BINDIR}/xenstore-write "/local/domain/0/domid" 0
+}
+
+xen_stop()
+{
+	pids=3D""
+	printf "Stopping xencommons.\n"
+	printf "WARNING: Not stopping xenstored, as it cannot be restarted.\n"
+
+	rc_pid=3D$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	pids=3D"$pids $rc_pid"
+
+	kill -${sig_stop:-TERM} $pids
+	wait_for_pids $pids
+}
+
+xen_status()
+{
+	xenstored_pid=3D$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	if test -n ${xenstored_pid}; then
+		pids=3D"$pids $xenstored_pid"
+	fi
+
+	xenconsoled_pid=3D$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	if test -n ${xenconsoled_pid}; then
+		pids=3D"$pids $xenconsoled_pid"
+	fi
+
+	if test -n "$xenconsoled_pid" -a -n "$xenstored_pid";
+	then
+		echo "xencommons are running as pids $pids."
+		return 0
+	fi
+	if test -z "$xenconsoled_pid" -a -z "$xenstored_pid";
+	then
+		echo "xencommons are not running."
+		return 0
+	fi
+
+	if test -n $xenstored_pid; then
+		echo "xenstored is running as pid $xenstored_pid."
+	else
+		echo "xenstored is not running."
+	fi
+	if test -n $xenconsoled_pid; then
+		echo "xenconsoled is running as pid $xenconsoled_pid."
+	else
+		echo "xenconsoled is not running."
+	fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/tools/hotplug/Makefile b/tools/hotplug/Makefile
index f147b59..14ae9a8 100644
--- a/tools/hotplug/Makefile
+++ b/tools/hotplug/Makefile
@@ -4,6 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y :=3D common
 SUBDIRS-$(CONFIG_NetBSD) +=3D NetBSD
 SUBDIRS-$(CONFIG_Linux) +=3D Linux
+SUBDIRS-$(CONFIG_FreeBSD) +=3D FreeBSD
 
 .PHONY: all clean install
 all clean install: %: subdirs-%
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:16:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:16:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymJy-0007e4-Mt; Sun, 22 Jun 2014 18:16:54 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJx-0007dq-UQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:54 +0000
Content-Length: 6165
Received: from [85.158.139.211:4352] by server-16.bemta-5.messagelabs.com id
	B0/4E-18862-59D17A35; Sun, 22 Jun 2014 18:16:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-206.messagelabs.com!1403461011!11312418!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24425 invoked from network); 22 Jun 2014 18:16:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:16:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJv-0000IV-An
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymJv-0007rv-3K
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:16:51 +0000
Date: Sun, 22 Jun 2014 18:16:51 +0000
Message-Id: <E1WymJv-0007rv-3K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] init: add FreeBSD xencommons init
	script
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============4422805872185145468=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============4422805872185145468==
Content-Length: 5923
Content-Transfer-Encoding: quoted-printable

commit 5dcdb2bf569ba5cf7f63ef682fc0bb106934cde4
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:16 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:18:56 2014 +0100

    init: add FreeBSD xencommons init script
    
    This is a clone of the NetBSD xencommons init script with some minor
    modifications.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile        |   43 ++++++++++++
 tools/hotplug/FreeBSD/rc.d/xencommons |  121 +++++++++++++++++++++++++++++++++
 tools/hotplug/Makefile                |    1 +
 3 files changed, 165 insertions(+), 0 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
new file mode 100644
index 0000000..c7ffc51
--- /dev/null
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -0,0 +1,43 @@
+XEN_ROOT =3D $(CURDIR)/../../..
+include $(XEN_ROOT)/tools/Rules.mk
+
+# Xen script dir and scripts to go there.
+XEN_SCRIPTS =3D
+
+XEN_SCRIPT_DATA =3D
+
+XEN_RCD_PROG =3D rc.d/xencommons
+
+.PHONY: all
+all:
+
+.PHONY: build
+build:
+
+.PHONY: install
+install: all install-scripts install-rcd
+
+.PHONY: install-scripts
+install-scripts:
+	$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
+	set -e; for i in $(XEN_SCRIPTS); \
+	   do \
+	   $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
+	done
+	set -e; for i in $(XEN_SCRIPT_DATA); \
+	   do \
+	   $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
+	done
+
+.PHONY: install-rcd
+install-rcd:
+	$(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/rc.d
+	set -e; for i in $(XEN_RCD_PROG); \
+	   do \
+	   $(INSTALL_PROG) $$i $(DESTDIR)$(CONFIG_DIR)/rc.d; \
+	   sed -i '' 's,@xen_script_dir@,$(DESTDIR)$(XEN_SCRIPT_DIR),g' $(DESTDIR)$(CONFIG_DIR)/$$i; \
+	done
+	$(INSTALL_DATA) ../common/hotplugpath.sh $(DESTDIR)$(XEN_SCRIPT_DIR)
+
+.PHONY: clean
+clean:
diff --git a/tools/hotplug/FreeBSD/rc.d/xencommons b/tools/hotplug/FreeBSD/rc.d/xencommons
new file mode 100644
index 0000000..a797016
--- /dev/null
+++ b/tools/hotplug/FreeBSD/rc.d/xencommons
@@ -0,0 +1,121 @@
+#!/bin/sh
+#
+# PROVIDE: xencommons
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+. @xen_script_dir@/hotplugpath.sh
+
+LD_LIBRARY_PATH=3D"${LIBDIR}"
+export LD_LIBRARY_PATH
+
+name=3D"xencommons"
+start_precmd=3D"xen_precmd"
+start_cmd=3D"xen_startcmd"
+stop_cmd=3D"xen_stop"
+status_cmd=3D"xen_status"
+extra_commands=3D"status"
+required_files=3D"/dev/xen/privcmd"
+
+XENSTORED_PIDFILE=3D"/var/run/xenstored.pid"
+XENCONSOLED_PIDFILE=3D"/var/run/xenconsoled.pid"
+#XENCONSOLED_TRACE=3D"/var/log/xen/xenconsole-trace.log"
+#XENSTORED_TRACE=3D"/var/log/xen/xenstore-trace.log"
+
+xen_precmd()
+{
+	mkdir -p /var/run/xenstored || exit 1
+}
+
+xen_startcmd()
+{
+	local time=3D0
+	local timeout=3D30
+
+	xenstored_pid=3D$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	if test -z "$xenstored_pid"; then
+		printf "Cleaning xenstore database.\n"
+		if [ -z "${XENSTORED_ROOTDIR}" ]; then
+			XENSTORED_ROOTDIR=3D"/var/lib/xenstored"
+		fi
+		rm -f ${XENSTORED_ROOTDIR}/tdb* >/dev/null 2>&1
+		printf "Starting xenservices: xenstored, xenconsoled."
+		XENSTORED_ARGS=3D" --pid-file ${XENSTORED_PIDFILE}"
+		if [ -n "${XENSTORED_TRACE}" ]; then
+			XENSTORED_ARGS=3D"${XENSTORED_ARGS} -T /var/log/xen/xenstored-trace.log"
+		fi
+		${SBINDIR}/xenstored ${XENSTORED_ARGS}
+		while [ $time -lt $timeout ] && ! `${BINDIR}/xenstore-read -s / >/dev/null 2>&1` ; do
+			printf "."
+			time=3D$(($time+1))
+			sleep 1
+		done
+	else
+		printf "Starting xenservices: xenconsoled."
+	fi
+
+	XENCONSOLED_ARGS=3D""
+	if [ -n "${XENCONSOLED_TRACE}" ]; then
+		XENCONSOLED_ARGS=3D"${XENCONSOLED_ARGS} --log=3D${XENCONSOLED_TRACE}"
+	fi
+
+	${SBINDIR}/xenconsoled ${XENCONSOLED_ARGS}
+
+	printf "\n"
+
+	printf "Setting domain 0 name and domid.\n"
+	${BINDIR}/xenstore-write "/local/domain/0/name" "Domain-0"
+	${BINDIR}/xenstore-write "/local/domain/0/domid" 0
+}
+
+xen_stop()
+{
+	pids=3D""
+	printf "Stopping xencommons.\n"
+	printf "WARNING: Not stopping xenstored, as it cannot be restarted.\n"
+
+	rc_pid=3D$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	pids=3D"$pids $rc_pid"
+
+	kill -${sig_stop:-TERM} $pids
+	wait_for_pids $pids
+}
+
+xen_status()
+{
+	xenstored_pid=3D$(check_pidfile ${XENSTORED_PIDFILE} ${SBINDIR}/xenstored)
+	if test -n ${xenstored_pid}; then
+		pids=3D"$pids $xenstored_pid"
+	fi
+
+	xenconsoled_pid=3D$(check_pidfile ${XENCONSOLED_PIDFILE} ${SBINDIR}/xenconsoled)
+	if test -n ${xenconsoled_pid}; then
+		pids=3D"$pids $xenconsoled_pid"
+	fi
+
+	if test -n "$xenconsoled_pid" -a -n "$xenstored_pid";
+	then
+		echo "xencommons are running as pids $pids."
+		return 0
+	fi
+	if test -z "$xenconsoled_pid" -a -z "$xenstored_pid";
+	then
+		echo "xencommons are not running."
+		return 0
+	fi
+
+	if test -n $xenstored_pid; then
+		echo "xenstored is running as pid $xenstored_pid."
+	else
+		echo "xenstored is not running."
+	fi
+	if test -n $xenconsoled_pid; then
+		echo "xenconsoled is running as pid $xenconsoled_pid."
+	else
+		echo "xenconsoled is not running."
+	fi
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/tools/hotplug/Makefile b/tools/hotplug/Makefile
index f147b59..14ae9a8 100644
--- a/tools/hotplug/Makefile
+++ b/tools/hotplug/Makefile
@@ -4,6 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk
 SUBDIRS-y :=3D common
 SUBDIRS-$(CONFIG_NetBSD) +=3D NetBSD
 SUBDIRS-$(CONFIG_Linux) +=3D Linux
+SUBDIRS-$(CONFIG_FreeBSD) +=3D FreeBSD
 
 .PHONY: all clean install
 all clean install: %: subdirs-%
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymK8-0007ff-Pf; Sun, 22 Jun 2014 18:17:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymK8-0007fU-4E
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:04 +0000
Received: from [85.158.143.35:54240] by server-1.bemta-4.messagelabs.com id
	D2/F8-09496-F9D17A35; Sun, 22 Jun 2014 18:17:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1403461021!12998060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10725 invoked from network); 22 Jun 2014 18:17:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymK5-0000J4-F6
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymK5-0007sO-DZ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:01 +0000
Date: Sun, 22 Jun 2014 18:17:01 +0000
Message-Id: <E1WymK5-0007sO-DZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug: add FreeBSD vif-bridge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6793825054084491262=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 62ac1e82d29f4211518b1952db1db62ae7ec9374
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:17 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:19:10 2014 +0100

    hotplug: add FreeBSD vif-bridge
    
    Add a simple vif-bridge script, that takes care of adding network
    backends (tap or xnb) to a pre-configured bridge.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile   |    2 +-
 tools/hotplug/FreeBSD/vif-bridge |   41 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index c7ffc51..6480aa5 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen script dir and scripts to go there.
-XEN_SCRIPTS =
+XEN_SCRIPTS = vif-bridge
 
 XEN_SCRIPT_DATA =
 
diff --git a/tools/hotplug/FreeBSD/vif-bridge b/tools/hotplug/FreeBSD/vif-bridge
new file mode 100644
index 0000000..fa7570d
--- /dev/null
+++ b/tools/hotplug/FreeBSD/vif-bridge
@@ -0,0 +1,41 @@
+#!/bin/sh -e
+#
+# FreeBSD hotplug script for attaching xnb* interfaces to bridges
+#
+# Parameters:
+#	$1: xenstore backend path of the vif
+#	$2: action, either "add" or "remove"
+#
+# Environment variables:
+#	$iface_dev: name of the backend device (xnb<domid>.<handle>)
+#
+
+DIR=$(dirname "$0")
+. "${DIR}/hotplugpath.sh"
+
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+path=$1
+action=$2
+
+case $action in
+add)
+	bridge=$(xenstore-read "$path/bridge")
+	ifconfig $bridge addm $iface_dev
+	ifconfig $iface_dev up
+	exit 0
+	;;
+remove)
+	if [ "$emulated" -eq 1 ]; then
+		bridge=$(xenstore-read "$path/bridge")
+		ifconfig $iface_dev down
+		ifconfig $bridge deletem $iface_dev
+		ifconfig $iface_dev destroy
+	fi
+	exit 0
+	;;
+*)
+	exit 0
+	;;
+esac
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:04 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:04 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymK8-0007ff-Pf; Sun, 22 Jun 2014 18:17:04 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymK8-0007fU-4E
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:04 +0000
Received: from [85.158.143.35:54240] by server-1.bemta-4.messagelabs.com id
	D2/F8-09496-F9D17A35; Sun, 22 Jun 2014 18:17:03 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-21.messagelabs.com!1403461021!12998060!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10725 invoked from network); 22 Jun 2014 18:17:02 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:02 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymK5-0000J4-F6
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:01 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymK5-0007sO-DZ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:01 +0000
Date: Sun, 22 Jun 2014 18:17:01 +0000
Message-Id: <E1WymK5-0007sO-DZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hotplug: add FreeBSD vif-bridge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6793825054084491262=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 62ac1e82d29f4211518b1952db1db62ae7ec9374
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:17 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:19:10 2014 +0100

    hotplug: add FreeBSD vif-bridge
    
    Add a simple vif-bridge script, that takes care of adding network
    backends (tap or xnb) to a pre-configured bridge.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/hotplug/FreeBSD/Makefile   |    2 +-
 tools/hotplug/FreeBSD/vif-bridge |   41 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/tools/hotplug/FreeBSD/Makefile b/tools/hotplug/FreeBSD/Makefile
index c7ffc51..6480aa5 100644
--- a/tools/hotplug/FreeBSD/Makefile
+++ b/tools/hotplug/FreeBSD/Makefile
@@ -2,7 +2,7 @@ XEN_ROOT = $(CURDIR)/../../..
 include $(XEN_ROOT)/tools/Rules.mk
 
 # Xen script dir and scripts to go there.
-XEN_SCRIPTS =
+XEN_SCRIPTS = vif-bridge
 
 XEN_SCRIPT_DATA =
 
diff --git a/tools/hotplug/FreeBSD/vif-bridge b/tools/hotplug/FreeBSD/vif-bridge
new file mode 100644
index 0000000..fa7570d
--- /dev/null
+++ b/tools/hotplug/FreeBSD/vif-bridge
@@ -0,0 +1,41 @@
+#!/bin/sh -e
+#
+# FreeBSD hotplug script for attaching xnb* interfaces to bridges
+#
+# Parameters:
+#	$1: xenstore backend path of the vif
+#	$2: action, either "add" or "remove"
+#
+# Environment variables:
+#	$iface_dev: name of the backend device (xnb<domid>.<handle>)
+#
+
+DIR=$(dirname "$0")
+. "${DIR}/hotplugpath.sh"
+
+PATH=${BINDIR}:${SBINDIR}:${LIBEXEC}:${PRIVATE_BINDIR}:/bin:/usr/bin:/sbin:/usr/sbin
+export PATH
+
+path=$1
+action=$2
+
+case $action in
+add)
+	bridge=$(xenstore-read "$path/bridge")
+	ifconfig $bridge addm $iface_dev
+	ifconfig $iface_dev up
+	exit 0
+	;;
+remove)
+	if [ "$emulated" -eq 1 ]; then
+		bridge=$(xenstore-read "$path/bridge")
+		ifconfig $iface_dev down
+		ifconfig $bridge deletem $iface_dev
+		ifconfig $iface_dev destroy
+	fi
+	exit 0
+	;;
+*)
+	exit 0
+	;;
+esac
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKJ-0007hi-UZ; Sun, 22 Jun 2014 18:17:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKI-0007hS-BB
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:14 +0000
Content-Length: 6621
Received: from [85.158.139.211:9266] by server-11.bemta-5.messagelabs.com id
	3D/83-01425-9AD17A35; Sun, 22 Jun 2014 18:17:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403461032!11309963!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7950 invoked from network); 22 Jun 2014 18:17:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKF-0000JA-Qv
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKF-0007st-Hr
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:11 +0000
Date: Sun, 22 Jun 2014 18:17:11 +0000
Message-Id: <E1WymKF-0007st-Hr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: add FreeBSD OS support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1264350675896791846=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1264350675896791846==
Content-Length: 6368
Content-Transfer-Encoding: quoted-printable

commit 430b17b171a4bbbd7cdc0923ebd7598616f6bbc7
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:18 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:19:25 2014 +0100

    libxl: add FreeBSD OS support
    
    Create a new libxl_freebsd.c file that contains OS-specific bits used
    by libxl.
    
    This currently defines which backend to use to handle disks, and
    which hotplug scripts to execute.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/Makefile        |    4 +
 tools/libxl/libxl_freebsd.c |  133 +++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_osdeps.h  |    5 ++
 3 files changed, 142 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 4cfa275..7fc42c8 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -52,10 +52,14 @@ else
 ifeq ($(CONFIG_Linux),y)
 LIBXL_OBJS-y +=3D libxl_linux.o
 else
+ifeq ($(CONFIG_FreeBSD),y)
+LIBXL_OBJS-y +=3D libxl_freebsd.o
+else
 $(error Your Operating System is not supported by libxenlight, \
 please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
 endif
 endif
+endif
 
 ifeq ($(FLEX),)
 %.c %.h:: %.l
diff --git a/tools/libxl/libxl_freebsd.c b/tools/libxl/libxl_freebsd.c
new file mode 100644
index 0000000..e8b88b3
--- /dev/null
+++ b/tools/libxl/libxl_freebsd.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2014
+ * Author Roger Pau Monne <roger.pau@entel.upc.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+
+#include "libxl_internal.h"
+
+int libxl__try_phy_backend(mode_t st_mode)
+{
+    if (S_ISREG(st_mode) || S_ISBLK(st_mode) || S_ISCHR(st_mode))
+        return 1;
+
+    return 0;
+}
+
+char *libxl__devid_to_localdev(libxl__gc *gc, int devid)
+{
+    /* TODO */
+    return NULL;
+}
+
+/* Hotplug scripts caller functions */
+static int libxl__hotplug_env_nic(libxl__gc *gc, libxl__device *dev, char ***env,
+                                  int num_exec)
+{
+    int nr =3D 0;
+    const int arraysize =3D 5;
+    libxl_nic_type type;
+
+    assert(dev->backend_kind =3D=3D LIBXL__DEVICE_KIND_VIF);
+
+    /*
+     * On the first pass the PV interface is added to the bridge,
+     * on the second pass the tap interface will also be added.
+     */
+    type =3D num_exec =3D=3D 0 =3F LIBXL_NIC_TYPE_VIF : LIBXL_NIC_TYPE_VIF_IOEMU;
+
+    GCNEW_ARRAY(*env, arraysize);
+    (*env)[nr++] =3D "iface_dev";
+    (*env)[nr++] =3D (char *) libxl__device_nic_devname(gc, dev->domid,
+                                                      dev->devid, type);
+    (*env)[nr++] =3D "emulated";
+    (*env)[nr++] =3D type =3D=3D LIBXL_NIC_TYPE_VIF_IOEMU =3F "1" : "0";
+    (*env)[nr++] =3D NULL;
+    assert(nr =3D=3D arraysize);
+
+    return 0;
+}
+
+static int libxl__hotplug_nic(libxl__gc *gc, libxl__device *dev, char ***args,
+                              libxl__device_action action)
+{
+    char *be_path =3D libxl__device_backend_path(gc, dev);
+    char *script;
+    int nr =3D 0, rc =3D 0, arraysize =3D 4;
+
+    assert(dev->backend_kind =3D=3D LIBXL__DEVICE_KIND_VIF);
+
+    script =3D libxl__xs_read(gc, XBT_NULL,
+                            GCSPRINTF("%s/%s", be_path, "script"));
+    if (!script) {
+        LOGEV(ERROR, errno, "unable to read script from %s", be_path);
+        rc =3D ERROR_FAIL;
+        goto out;
+    }
+
+    GCNEW_ARRAY(*args, arraysize);
+    (*args)[nr++] =3D script;
+    (*args)[nr++] =3D be_path;
+    (*args)[nr++] =3D GCSPRINTF("%s", action =3D=3D LIBXL__DEVICE_ACTION_ADD =3F
+                                    "add" : "remove");
+    (*args)[nr++] =3D NULL;
+    assert(nr =3D=3D arraysize);
+
+out:
+    return rc;
+}
+
+int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev,
+                                   char ***args, char ***env,
+                                   libxl__device_action action,
+                                   int num_exec)
+{
+    libxl_nic_type nictype;
+    int rc;
+
+    if (dev->backend_kind !=3D LIBXL__DEVICE_KIND_VIF || num_exec =3D=3D 2)
+        return 0;
+
+    rc =3D libxl__nic_type(gc, dev, &nictype);
+    if (rc) {
+        LOG(ERROR, "error when fetching nic type");
+        rc =3D ERROR_FAIL;
+        goto out;
+    }
+
+    /*
+     * For PV domains only one pass is needed (because there's no emulated
+     * interface). For HVM domains two passes are needed in order to add
+     * both the PV and the tap interfaces to the bridge.
+     */
+    if (nictype =3D=3D LIBXL_NIC_TYPE_VIF && num_exec !=3D 0) {
+        rc =3D 0;
+        goto out;
+    }
+
+    rc =3D libxl__hotplug_env_nic(gc, dev, env, num_exec);
+    if (rc)
+        goto out;
+
+    rc =3D libxl__hotplug_nic(gc, dev, args, action);
+    if (!rc) rc =3D 1;
+
+out:
+    return rc;
+}
+
+libxl_device_model_version libxl__default_device_model(libxl__gc *gc)
+{
+    return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
+}
diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index aea83ee..08eaf0c 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -37,6 +37,11 @@
 #include <pty.h>
 #elif defined(__sun__)
 #include <stropts.h>
+#elif defined(__FreeBSD__)
+#define SYSFS_PCI_DEV          "/dev/null"
+#define SYSFS_PCIBACK_DRIVER   "/dev/null"
+#define NETBACK_NIC_NAME       "xnb%u.%d"
+#include <libutil.h>
 #endif
 
 #ifndef SYSFS_PCIBACK_DRIVER
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKJ-0007hi-UZ; Sun, 22 Jun 2014 18:17:15 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKI-0007hS-BB
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:14 +0000
Content-Length: 6621
Received: from [85.158.139.211:9266] by server-11.bemta-5.messagelabs.com id
	3D/83-01425-9AD17A35; Sun, 22 Jun 2014 18:17:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-206.messagelabs.com!1403461032!11309963!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7950 invoked from network); 22 Jun 2014 18:17:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKF-0000JA-Qv
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKF-0007st-Hr
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:11 +0000
Date: Sun, 22 Jun 2014 18:17:11 +0000
Message-Id: <E1WymKF-0007st-Hr@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: add FreeBSD OS support
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============1264350675896791846=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============1264350675896791846==
Content-Length: 6368
Content-Transfer-Encoding: quoted-printable

commit 430b17b171a4bbbd7cdc0923ebd7598616f6bbc7
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:18 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:19:25 2014 +0100

    libxl: add FreeBSD OS support
    
    Create a new libxl_freebsd.c file that contains OS-specific bits used
    by libxl.
    
    This currently defines which backend to use to handle disks, and
    which hotplug scripts to execute.
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/libxl/Makefile        |    4 +
 tools/libxl/libxl_freebsd.c |  133 +++++++++++++++++++++++++++++++++++++++++++
 tools/libxl/libxl_osdeps.h  |    5 ++
 3 files changed, 142 insertions(+), 0 deletions(-)

diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile
index 4cfa275..7fc42c8 100644
--- a/tools/libxl/Makefile
+++ b/tools/libxl/Makefile
@@ -52,10 +52,14 @@ else
 ifeq ($(CONFIG_Linux),y)
 LIBXL_OBJS-y +=3D libxl_linux.o
 else
+ifeq ($(CONFIG_FreeBSD),y)
+LIBXL_OBJS-y +=3D libxl_freebsd.o
+else
 $(error Your Operating System is not supported by libxenlight, \
 please check libxl_linux.c and libxl_netbsd.c to see how to get it ported)
 endif
 endif
+endif
 
 ifeq ($(FLEX),)
 %.c %.h:: %.l
diff --git a/tools/libxl/libxl_freebsd.c b/tools/libxl/libxl_freebsd.c
new file mode 100644
index 0000000..e8b88b3
--- /dev/null
+++ b/tools/libxl/libxl_freebsd.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2014
+ * Author Roger Pau Monne <roger.pau@entel.upc.edu>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation; version 2.1 only. with the special
+ * exception on linking described in file LICENSE.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ */
+
+#include "libxl_osdeps.h" /* must come before any other headers */
+
+#include "libxl_internal.h"
+
+int libxl__try_phy_backend(mode_t st_mode)
+{
+    if (S_ISREG(st_mode) || S_ISBLK(st_mode) || S_ISCHR(st_mode))
+        return 1;
+
+    return 0;
+}
+
+char *libxl__devid_to_localdev(libxl__gc *gc, int devid)
+{
+    /* TODO */
+    return NULL;
+}
+
+/* Hotplug scripts caller functions */
+static int libxl__hotplug_env_nic(libxl__gc *gc, libxl__device *dev, char ***env,
+                                  int num_exec)
+{
+    int nr =3D 0;
+    const int arraysize =3D 5;
+    libxl_nic_type type;
+
+    assert(dev->backend_kind =3D=3D LIBXL__DEVICE_KIND_VIF);
+
+    /*
+     * On the first pass the PV interface is added to the bridge,
+     * on the second pass the tap interface will also be added.
+     */
+    type =3D num_exec =3D=3D 0 =3F LIBXL_NIC_TYPE_VIF : LIBXL_NIC_TYPE_VIF_IOEMU;
+
+    GCNEW_ARRAY(*env, arraysize);
+    (*env)[nr++] =3D "iface_dev";
+    (*env)[nr++] =3D (char *) libxl__device_nic_devname(gc, dev->domid,
+                                                      dev->devid, type);
+    (*env)[nr++] =3D "emulated";
+    (*env)[nr++] =3D type =3D=3D LIBXL_NIC_TYPE_VIF_IOEMU =3F "1" : "0";
+    (*env)[nr++] =3D NULL;
+    assert(nr =3D=3D arraysize);
+
+    return 0;
+}
+
+static int libxl__hotplug_nic(libxl__gc *gc, libxl__device *dev, char ***args,
+                              libxl__device_action action)
+{
+    char *be_path =3D libxl__device_backend_path(gc, dev);
+    char *script;
+    int nr =3D 0, rc =3D 0, arraysize =3D 4;
+
+    assert(dev->backend_kind =3D=3D LIBXL__DEVICE_KIND_VIF);
+
+    script =3D libxl__xs_read(gc, XBT_NULL,
+                            GCSPRINTF("%s/%s", be_path, "script"));
+    if (!script) {
+        LOGEV(ERROR, errno, "unable to read script from %s", be_path);
+        rc =3D ERROR_FAIL;
+        goto out;
+    }
+
+    GCNEW_ARRAY(*args, arraysize);
+    (*args)[nr++] =3D script;
+    (*args)[nr++] =3D be_path;
+    (*args)[nr++] =3D GCSPRINTF("%s", action =3D=3D LIBXL__DEVICE_ACTION_ADD =3F
+                                    "add" : "remove");
+    (*args)[nr++] =3D NULL;
+    assert(nr =3D=3D arraysize);
+
+out:
+    return rc;
+}
+
+int libxl__get_hotplug_script_info(libxl__gc *gc, libxl__device *dev,
+                                   char ***args, char ***env,
+                                   libxl__device_action action,
+                                   int num_exec)
+{
+    libxl_nic_type nictype;
+    int rc;
+
+    if (dev->backend_kind !=3D LIBXL__DEVICE_KIND_VIF || num_exec =3D=3D 2)
+        return 0;
+
+    rc =3D libxl__nic_type(gc, dev, &nictype);
+    if (rc) {
+        LOG(ERROR, "error when fetching nic type");
+        rc =3D ERROR_FAIL;
+        goto out;
+    }
+
+    /*
+     * For PV domains only one pass is needed (because there's no emulated
+     * interface). For HVM domains two passes are needed in order to add
+     * both the PV and the tap interfaces to the bridge.
+     */
+    if (nictype =3D=3D LIBXL_NIC_TYPE_VIF && num_exec !=3D 0) {
+        rc =3D 0;
+        goto out;
+    }
+
+    rc =3D libxl__hotplug_env_nic(gc, dev, env, num_exec);
+    if (rc)
+        goto out;
+
+    rc =3D libxl__hotplug_nic(gc, dev, args, action);
+    if (!rc) rc =3D 1;
+
+out:
+    return rc;
+}
+
+libxl_device_model_version libxl__default_device_model(libxl__gc *gc)
+{
+    return LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN;
+}
diff --git a/tools/libxl/libxl_osdeps.h b/tools/libxl/libxl_osdeps.h
index aea83ee..08eaf0c 100644
--- a/tools/libxl/libxl_osdeps.h
+++ b/tools/libxl/libxl_osdeps.h
@@ -37,6 +37,11 @@
 #include <pty.h>
 #elif defined(__sun__)
 #include <stropts.h>
+#elif defined(__FreeBSD__)
+#define SYSFS_PCI_DEV          "/dev/null"
+#define SYSFS_PCIBACK_DRIVER   "/dev/null"
+#define NETBACK_NIC_NAME       "xnb%u.%d"
+#include <libutil.h>
 #endif
 
 #ifndef SYSFS_PCIBACK_DRIVER
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:26 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKU-0007j8-1C; Sun, 22 Jun 2014 18:17:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKS-0007ir-QF
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:25 +0000
Received: from [85.158.137.68:23112] by server-6.bemta-3.messagelabs.com id
	91/A3-23778-4BD17A35; Sun, 22 Jun 2014 18:17:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403461042!9175354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22661 invoked from network); 22 Jun 2014 18:17:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKP-0000JG-VZ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKP-0007tF-UQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:21 +0000
Date: Sun, 22 Jun 2014 18:17:21 +0000
Message-Id: <E1WymKP-0007tF-UQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: only include utmp.h if it's
	present
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3282650467321931068=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 8bf33368f682e0e6b41ec7c568296f0028a175d3
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:20 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:20:42 2014 +0100

    libxl: only include utmp.h if it's present
    
    Add a configure check for utmp.h presence, and gate the usage of
    utmp.h in libxl to the result of the test.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- resolved minor conflict in configure.ac and reran autogen ]
---
 tools/config.h.in              |    3 +++
 tools/configure                |    2 +-
 tools/configure.ac             |    2 +-
 tools/libxl/libxl_bootloader.c |    2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index 1809662..028c360 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -51,6 +51,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
 /* Define to 1 if you have the <valgrind/memcheck.h> header file. */
 #undef HAVE_VALGRIND_MEMCHECK_H
 
diff --git a/tools/configure b/tools/configure
index ea7b4de..c3a6824 100755
--- a/tools/configure
+++ b/tools/configure
@@ -8070,7 +8070,7 @@ fi
 esac
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/tools/configure.ac b/tools/configure.ac
index d9eab5a..9db798b 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -265,7 +265,7 @@ AC_CHECK_LIB([fdt], [fdt_create], [], [AC_MSG_ERROR([Could not find libfdt])])
 esac
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
 
 AC_OUTPUT()
 
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 3287bf7..c3ec782 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -15,7 +15,9 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <termios.h>
+#ifdef HAVE_UTMP_H
 #include <utmp.h>
+#endif
 
 #ifdef INCLUDE_LIBUTIL_H
 #include INCLUDE_LIBUTIL_H
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:26 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKU-0007j8-1C; Sun, 22 Jun 2014 18:17:26 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKS-0007ir-QF
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:25 +0000
Received: from [85.158.137.68:23112] by server-6.bemta-3.messagelabs.com id
	91/A3-23778-4BD17A35; Sun, 22 Jun 2014 18:17:24 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1403461042!9175354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22661 invoked from network); 22 Jun 2014 18:17:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:23 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKP-0000JG-VZ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKP-0007tF-UQ
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:21 +0000
Date: Sun, 22 Jun 2014 18:17:21 +0000
Message-Id: <E1WymKP-0007tF-UQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: only include utmp.h if it's
	present
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============3282650467321931068=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 8bf33368f682e0e6b41ec7c568296f0028a175d3
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:20 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:20:42 2014 +0100

    libxl: only include utmp.h if it's present
    
    Add a configure check for utmp.h presence, and gate the usage of
    utmp.h in libxl to the result of the test.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    [ ijc -- resolved minor conflict in configure.ac and reran autogen ]
---
 tools/config.h.in              |    3 +++
 tools/configure                |    2 +-
 tools/configure.ac             |    2 +-
 tools/libxl/libxl_bootloader.c |    2 ++
 4 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/config.h.in b/tools/config.h.in
index 1809662..028c360 100644
--- a/tools/config.h.in
+++ b/tools/config.h.in
@@ -51,6 +51,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the <utmp.h> header file. */
+#undef HAVE_UTMP_H
+
 /* Define to 1 if you have the <valgrind/memcheck.h> header file. */
 #undef HAVE_VALGRIND_MEMCHECK_H
 
diff --git a/tools/configure b/tools/configure
index ea7b4de..c3a6824 100755
--- a/tools/configure
+++ b/tools/configure
@@ -8070,7 +8070,7 @@ fi
 esac
 
 # Checks for header files.
-for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h
+for ac_header in yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
diff --git a/tools/configure.ac b/tools/configure.ac
index d9eab5a..9db798b 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -265,7 +265,7 @@ AC_CHECK_LIB([fdt], [fdt_create], [], [AC_MSG_ERROR([Could not find libfdt])])
 esac
 
 # Checks for header files.
-AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h])
+AC_CHECK_HEADERS([yajl/yajl_version.h sys/eventfd.h valgrind/memcheck.h utmp.h])
 
 AC_OUTPUT()
 
diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
index 3287bf7..c3ec782 100644
--- a/tools/libxl/libxl_bootloader.c
+++ b/tools/libxl/libxl_bootloader.c
@@ -15,7 +15,9 @@
 #include "libxl_osdeps.h" /* must come before any other headers */
 
 #include <termios.h>
+#ifdef HAVE_UTMP_H
 #include <utmp.h>
+#endif
 
 #ifdef INCLUDE_LIBUTIL_H
 #include INCLUDE_LIBUTIL_H
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKe-0007kX-48; Sun, 22 Jun 2014 18:17:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKd-0007kJ-0T
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:35 +0000
Content-Length: 1979
Received: from [85.158.137.68:40442] by server-12.bemta-3.messagelabs.com id
	32/5B-12714-EBD17A35; Sun, 22 Jun 2014 18:17:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403461052!11616889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8905 invoked from network); 22 Jun 2014 18:17:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKa-0000JM-6Q
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKa-0007td-27
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:32 +0000
Date: Sun, 22 Jun 2014 18:17:32 +0000
Message-Id: <E1WymKa-0007td-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: remove size_t typedef and
	include stddef.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7860212143016517825=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7860212143016517825==
Content-Length: 1569
Content-Transfer-Encoding: quoted-printable

commit 51c9a2b93a47961532fb7561b8d6bf7c6f3d0e9d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:22 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:21:26 2014 +0100

    hvmloader: remove size_t typedef and include stddef.h
    
    The open coded typedef of size_t was clashing with the typedef in
    FreeBSD headers. Remove the typedef and include the proper header
    where size_t is defined (stddef.h).
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/util.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 9ccb905..46d32b9 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -3,6 +3,7 @@
 
 #include <stdarg.h>
 #include <stdint.h>
+#include <stddef.h>
 #include <xen/xen.h>
 #include <xen/hvm/hvm_info_table.h>
 
@@ -174,7 +175,6 @@ int printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 int vprintf(const char *fmt, va_list ap);
 
 /* Buffer output */
-typedef unsigned long size_t;
 int snprintf(char *buf, size_t size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
 
 /* Populate specified memory hole with RAM. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:36 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:36 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKe-0007kX-48; Sun, 22 Jun 2014 18:17:36 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKd-0007kJ-0T
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:35 +0000
Content-Length: 1979
Received: from [85.158.137.68:40442] by server-12.bemta-3.messagelabs.com id
	32/5B-12714-EBD17A35; Sun, 22 Jun 2014 18:17:34 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-16.tower-31.messagelabs.com!1403461052!11616889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8905 invoked from network); 22 Jun 2014 18:17:33 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKa-0000JM-6Q
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKa-0007td-27
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:32 +0000
Date: Sun, 22 Jun 2014 18:17:32 +0000
Message-Id: <E1WymKa-0007td-27@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] hvmloader: remove size_t typedef and
	include stddef.h
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7860212143016517825=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7860212143016517825==
Content-Length: 1569
Content-Transfer-Encoding: quoted-printable

commit 51c9a2b93a47961532fb7561b8d6bf7c6f3d0e9d
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:22 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:21:26 2014 +0100

    hvmloader: remove size_t typedef and include stddef.h
    
    The open coded typedef of size_t was clashing with the typedef in
    FreeBSD headers. Remove the typedef and include the proper header
    where size_t is defined (stddef.h).
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/hvmloader/util.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/hvmloader/util.h b/tools/firmware/hvmloader/util.h
index 9ccb905..46d32b9 100644
--- a/tools/firmware/hvmloader/util.h
+++ b/tools/firmware/hvmloader/util.h
@@ -3,6 +3,7 @@
 
 #include <stdarg.h>
 #include <stdint.h>
+#include <stddef.h>
 #include <xen/xen.h>
 #include <xen/hvm/hvm_info_table.h>
 
@@ -174,7 +175,6 @@ int printf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
 int vprintf(const char *fmt, va_list ap);
 
 /* Buffer output */
-typedef unsigned long size_t;
 int snprintf(char *buf, size_t size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
 
 /* Populate specified memory hole with RAM. */
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKp-0007mV-71; Sun, 22 Jun 2014 18:17:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKo-0007m6-6J
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:46 +0000
Content-Length: 1823
Received: from [85.158.139.211:5716] by server-4.bemta-5.messagelabs.com id
	3B/48-07250-9CD17A35; Sun, 22 Jun 2014 18:17:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403461062!11340522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18993 invoked from network); 22 Jun 2014 18:17:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKk-0000JS-B6
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKk-0007v7-9V
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:42 +0000
Date: Sun, 22 Jun 2014 18:17:42 +0000
Message-Id: <E1WymKk-0007v7-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: export linker emulation
	parameter to SeaBIOS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6223805967171507787=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6223805967171507787==
Content-Length: 1411
Content-Transfer-Encoding: quoted-printable

commit fbf92a840c065c4fb2193c64e521d37f98cf363a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:23 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:21:40 2014 +0100

    build: export linker emulation parameter to SeaBIOS
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index 9d1fdec..2f1d10d 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -17,6 +17,8 @@ SUBDIRS-$(CONFIG_ROMBIOS) +=3D vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) +=3D etherboot
 SUBDIRS-y +=3D hvmloader
 
+LD32BIT-$(CONFIG_FreeBSD) :=3D LD32BIT_FLAG=3D-melf_i386_fbsd
+
 ovmf-dir:
 	GIT=3D$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf-dir
 	cp ovmf-makefile ovmf-dir/Makefile;
@@ -36,7 +38,7 @@ ifeq ($(CONFIG_ROMBIOS),y)
 	false ; \
 	fi
 endif
-	$(MAKE) CC=3D$(CC) PYTHON=3D$(PYTHON) subdirs-$@
+	$(MAKE) $(LD32BIT-y) CC=3D$(CC) PYTHON=3D$(PYTHON) subdirs-$@
 
 
 .PHONY: install
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:47 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:47 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKp-0007mV-71; Sun, 22 Jun 2014 18:17:47 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKo-0007m6-6J
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:46 +0000
Content-Length: 1823
Received: from [85.158.139.211:5716] by server-4.bemta-5.messagelabs.com id
	3B/48-07250-9CD17A35; Sun, 22 Jun 2014 18:17:45 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403461062!11340522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18993 invoked from network); 22 Jun 2014 18:17:43 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:43 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKk-0000JS-B6
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:42 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKk-0007v7-9V
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:42 +0000
Date: Sun, 22 Jun 2014 18:17:42 +0000
Message-Id: <E1WymKk-0007v7-9V@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] build: export linker emulation
	parameter to SeaBIOS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6223805967171507787=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============6223805967171507787==
Content-Length: 1411
Content-Transfer-Encoding: quoted-printable

commit fbf92a840c065c4fb2193c64e521d37f98cf363a
Author:     Roger Pau Monne <roger.pau@citrix.com>
AuthorDate: Mon Jun 2 17:08:23 2014 +0200
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 18 17:21:40 2014 +0100

    build: export linker emulation parameter to SeaBIOS
    
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
    Cc: Ian Campbell <ian.campbell@citrix.com>
    Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
 tools/firmware/Makefile |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile
index 9d1fdec..2f1d10d 100644
--- a/tools/firmware/Makefile
+++ b/tools/firmware/Makefile
@@ -17,6 +17,8 @@ SUBDIRS-$(CONFIG_ROMBIOS) +=3D vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) +=3D etherboot
 SUBDIRS-y +=3D hvmloader
 
+LD32BIT-$(CONFIG_FreeBSD) :=3D LD32BIT_FLAG=3D-melf_i386_fbsd
+
 ovmf-dir:
 	GIT=3D$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf-dir
 	cp ovmf-makefile ovmf-dir/Makefile;
@@ -36,7 +38,7 @@ ifeq ($(CONFIG_ROMBIOS),y)
 	false ; \
 	fi
 endif
-	$(MAKE) CC=3D$(CC) PYTHON=3D$(PYTHON) subdirs-$@
+	$(MAKE) $(LD32BIT-y) CC=3D$(CC) PYTHON=3D$(PYTHON) subdirs-$@
 
 
 .PHONY: install
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKy-0007nz-9e; Sun, 22 Jun 2014 18:17:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKw-0007ng-Vn
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:55 +0000
Received: from [85.158.139.211:16195] by server-13.bemta-5.messagelabs.com id
	46/54-02995-2DD17A35; Sun, 22 Jun 2014 18:17:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403461072!11308069!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9732 invoked from network); 22 Jun 2014 18:17:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKu-0000JY-Fd
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKu-0007vV-Ds
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:52 +0000
Date: Sun, 22 Jun 2014 18:17:52 +0000
Message-Id: <E1WymKu-0007vV-Ds@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d/qinval: make local variable used
	for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 10:25:33 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:25:33 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index ef5de99..fe29e82 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:17:56 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:17:56 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymKy-0007nz-9e; Sun, 22 Jun 2014 18:17:56 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKw-0007ng-Vn
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:55 +0000
Received: from [85.158.139.211:16195] by server-13.bemta-5.messagelabs.com id
	46/54-02995-2DD17A35; Sun, 22 Jun 2014 18:17:54 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403461072!11308069!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9732 invoked from network); 22 Jun 2014 18:17:53 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:17:53 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKu-0000JY-Fd
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:52 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymKu-0007vV-Ds
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:17:52 +0000
Date: Sun, 22 Jun 2014 18:17:52 +0000
Message-Id: <E1WymKu-0007vV-Ds@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d/qinval: make local variable used
	for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 10:25:33 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:25:33 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index ef5de99..fe29e82 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLD-0007pq-Ch; Sun, 22 Jun 2014 18:18:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLB-0007pi-T3
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:10 +0000
Received: from [85.158.137.68:28124] by server-2.bemta-3.messagelabs.com id
	05/32-13558-1ED17A35; Sun, 22 Jun 2014 18:18:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403461085!11576621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23697 invoked from network); 22 Jun 2014 18:18:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymL4-0000K9-Lj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymL4-0007w3-In
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:02 +0000
Date: Sun, 22 Jun 2014 18:18:02 +0000
Message-Id: <E1WymL4-0007w3-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: drop redundant calls to
	invalidate_sync()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dd6d87a4fcc8350c752e389abb3bcd8479c37555
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 10:26:37 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:26:37 2014 +0200

    VT-d: drop redundant calls to invalidate_sync()
    
    The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already
    invokes invalidate_sync(). Removing the superfluous instances at once
    allows the function to become static.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/extern.h   |    1 -
 xen/drivers/passthrough/vtd/intremap.c |    2 --
 xen/drivers/passthrough/vtd/qinval.c   |    2 +-
 3 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 6e1dc4f..e9268ef 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -48,7 +48,6 @@ int queue_invalidate_iotlb(struct iommu *iommu,
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr);
 int queue_invalidate_iec(struct iommu *iommu,
     u8 granu, u8 im, u16 iidx);
-int invalidate_sync(struct iommu *iommu);
 int iommu_flush_iec_global(struct iommu *iommu);
 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct iommu *iommu);
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 07c6dac..0333686 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -358,7 +358,6 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,
     memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry));
     iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
-    invalidate_sync(iommu);
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -643,7 +642,6 @@ static int msi_msg_to_remap_entry(
     memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry));
     iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
-    invalidate_sync(iommu);
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index fe29e82..ea7f238 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -228,7 +228,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     return ret;
 }
 
-int invalidate_sync(struct iommu *iommu)
+static int invalidate_sync(struct iommu *iommu)
 {
     int ret = -1;
     struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLD-0007pq-Ch; Sun, 22 Jun 2014 18:18:11 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLB-0007pi-T3
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:10 +0000
Received: from [85.158.137.68:28124] by server-2.bemta-3.messagelabs.com id
	05/32-13558-1ED17A35; Sun, 22 Jun 2014 18:18:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1403461085!11576621!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23697 invoked from network); 22 Jun 2014 18:18:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymL4-0000K9-Lj
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymL4-0007w3-In
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:02 +0000
Date: Sun, 22 Jun 2014 18:18:02 +0000
Message-Id: <E1WymL4-0007w3-In@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d: drop redundant calls to
	invalidate_sync()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dd6d87a4fcc8350c752e389abb3bcd8479c37555
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 10:26:37 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:26:37 2014 +0200

    VT-d: drop redundant calls to invalidate_sync()
    
    The call tree iommu_flush_iec_index() -> __iommu_flush_iec() already
    invokes invalidate_sync(). Removing the superfluous instances at once
    allows the function to become static.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/extern.h   |    1 -
 xen/drivers/passthrough/vtd/intremap.c |    2 --
 xen/drivers/passthrough/vtd/qinval.c   |    2 +-
 3 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h
index 6e1dc4f..e9268ef 100644
--- a/xen/drivers/passthrough/vtd/extern.h
+++ b/xen/drivers/passthrough/vtd/extern.h
@@ -48,7 +48,6 @@ int queue_invalidate_iotlb(struct iommu *iommu,
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr);
 int queue_invalidate_iec(struct iommu *iommu,
     u8 granu, u8 im, u16 iidx);
-int invalidate_sync(struct iommu *iommu);
 int iommu_flush_iec_global(struct iommu *iommu);
 int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
 void clear_fault_bits(struct iommu *iommu);
diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c
index 07c6dac..0333686 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -358,7 +358,6 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu,
     memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry));
     iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
-    invalidate_sync(iommu);
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
@@ -643,7 +642,6 @@ static int msi_msg_to_remap_entry(
     memcpy(iremap_entry, &new_ire, sizeof(struct iremap_entry));
     iommu_flush_cache_entry(iremap_entry, sizeof(struct iremap_entry));
     iommu_flush_iec_index(iommu, 0, index);
-    invalidate_sync(iommu);
 
     unmap_vtd_domain_page(iremap_entries);
     spin_unlock_irqrestore(&ir_ctrl->iremap_lock, flags);
diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index fe29e82..ea7f238 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -228,7 +228,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     return ret;
 }
 
-int invalidate_sync(struct iommu *iommu)
+static int invalidate_sync(struct iommu *iommu)
 {
     int ret = -1;
     struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLL-0007r4-FG; Sun, 22 Jun 2014 18:18:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLK-0007qt-90
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:18 +0000
Received: from [193.109.254.147:21340] by server-12.bemta-14.messagelabs.com
	id 4B/4A-32179-9ED17A35; Sun, 22 Jun 2014 18:18:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1403461096!12909024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10876 invoked from network); 22 Jun 2014 18:18:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLH-0000KF-T4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLH-0007wd-Re
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:15 +0000
Date: Sun, 22 Jun 2014 18:18:15 +0000
Message-Id: <E1WymLH-0007wd-Re@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mwait_idle: fix trace output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d17ac1d5433ba2c25d7fab11baba59173e339896
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Jun 20 10:37:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:37:21 2014 +0200

    x86/mwait_idle: fix trace output
    
    Use the C-state's type when tracing, not its index since the index is
    not set by the mwait_idle driver.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 72a7abf..38172e5 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -376,7 +376,7 @@ static void mwait_idle(void)
 		lapic_timer_off();
 
 	before = cpuidle_get_tick();
-	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
 
 	if (cpu_is_haltable(cpu))
 		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
@@ -385,7 +385,7 @@ static void mwait_idle(void)
 
 	cstate_restore_tsc();
 	trace_exit_reason(irq_traced);
-	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
 		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
 	update_idle_stats(power, cx, before, after);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLL-0007r4-FG; Sun, 22 Jun 2014 18:18:19 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLK-0007qt-90
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:18 +0000
Received: from [193.109.254.147:21340] by server-12.bemta-14.messagelabs.com
	id 4B/4A-32179-9ED17A35; Sun, 22 Jun 2014 18:18:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1403461096!12909024!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10876 invoked from network); 22 Jun 2014 18:18:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLH-0000KF-T4
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLH-0007wd-Re
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:15 +0000
Date: Sun, 22 Jun 2014 18:18:15 +0000
Message-Id: <E1WymLH-0007wd-Re@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/mwait_idle: fix trace output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d17ac1d5433ba2c25d7fab11baba59173e339896
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Fri Jun 20 10:37:21 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:37:21 2014 +0200

    x86/mwait_idle: fix trace output
    
    Use the C-state's type when tracing, not its index since the index is
    not set by the mwait_idle driver.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
---
 xen/arch/x86/cpu/mwait-idle.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 72a7abf..38172e5 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -376,7 +376,7 @@ static void mwait_idle(void)
 		lapic_timer_off();
 
 	before = cpuidle_get_tick();
-	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
 
 	if (cpu_is_haltable(cpu))
 		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
@@ -385,7 +385,7 @@ static void mwait_idle(void)
 
 	cstate_restore_tsc();
 	trace_exit_reason(irq_traced);
-	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
 		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
 	update_idle_stats(power, cx, before, after);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLW-0007t9-KM; Sun, 22 Jun 2014 18:18:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLU-0007so-Hu
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:28 +0000
Received: from [193.109.254.147:19473] by server-12.bemta-14.messagelabs.com
	id B6/5A-32179-3FD17A35; Sun, 22 Jun 2014 18:18:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403461106!12890946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5774 invoked from network); 22 Jun 2014 18:18:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLS-0000KL-0c
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLR-0007x3-Vm
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:25 +0000
Date: Sun, 22 Jun 2014 18:18:25 +0000
Message-Id: <E1WymLR-0007x3-Vm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PVH: allow guest_remove_page to
	remove p2m_mmio_direct pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8889402421027480505=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 48dfb297a20a8a37de2db45710e3c42db014e7ef
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Jun 20 10:38:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:38:07 2014 +0200

    x86/PVH: allow guest_remove_page to remove p2m_mmio_direct pages
    
    IF a guest tries to do a foreign/grant mapping in a memory region
    marked as p2m_mmio_direct Xen will complain with the following
    message:
    
    (XEN) memory.c:241:d0v0 Bad page free for domain 0
    
    Albeit the mapping will succeed. This is specially problematic for PVH
    Dom0, in which we map all the e820 holes and memory up to 4GB as
    p2m_mmio_direct.
    
    In order to deal with it, add a special casing for p2m_mmio_direct
    regions in guest_remove_page if the domain is a hardware domain, that
    calls clear_mmio_p2m_entry in order to remove the mappings.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/common/memory.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 257f4b0..c2dd31b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -204,6 +204,12 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         p2m_mem_paging_drop_page(d, gmfn, p2mt);
         return 1;
     }
+    if ( p2mt == p2m_mmio_direct )
+    {
+        clear_mmio_p2m_entry(d, gmfn);
+        put_gfn(d, gmfn);
+        return 1;
+    }
 #else
     mfn = gmfn_to_mfn(d, gmfn);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLW-0007t9-KM; Sun, 22 Jun 2014 18:18:30 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLU-0007so-Hu
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:28 +0000
Received: from [193.109.254.147:19473] by server-12.bemta-14.messagelabs.com
	id B6/5A-32179-3FD17A35; Sun, 22 Jun 2014 18:18:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403461106!12890946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5774 invoked from network); 22 Jun 2014 18:18:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLS-0000KL-0c
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLR-0007x3-Vm
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:25 +0000
Date: Sun, 22 Jun 2014 18:18:25 +0000
Message-Id: <E1WymLR-0007x3-Vm@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] x86/PVH: allow guest_remove_page to
	remove p2m_mmio_direct pages
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============8889402421027480505=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 48dfb297a20a8a37de2db45710e3c42db014e7ef
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Fri Jun 20 10:38:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 10:38:07 2014 +0200

    x86/PVH: allow guest_remove_page to remove p2m_mmio_direct pages
    
    IF a guest tries to do a foreign/grant mapping in a memory region
    marked as p2m_mmio_direct Xen will complain with the following
    message:
    
    (XEN) memory.c:241:d0v0 Bad page free for domain 0
    
    Albeit the mapping will succeed. This is specially problematic for PVH
    Dom0, in which we map all the e820 holes and memory up to 4GB as
    p2m_mmio_direct.
    
    In order to deal with it, add a special casing for p2m_mmio_direct
    regions in guest_remove_page if the domain is a hardware domain, that
    calls clear_mmio_p2m_entry in order to remove the mappings.
    
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Acked-by: Tim Deegan <tim@xen.org>
---
 xen/common/memory.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index 257f4b0..c2dd31b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -204,6 +204,12 @@ int guest_remove_page(struct domain *d, unsigned long gmfn)
         p2m_mem_paging_drop_page(d, gmfn, p2mt);
         return 1;
     }
+    if ( p2mt == p2m_mmio_direct )
+    {
+        clear_mmio_p2m_entry(d, gmfn);
+        put_gfn(d, gmfn);
+        return 1;
+    }
 #else
     mfn = gmfn_to_mfn(d, gmfn);
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLh-0007uq-N4; Sun, 22 Jun 2014 18:18:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLg-0007ue-7a
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:40 +0000
Received: from [85.158.137.68:45790] by server-11.bemta-3.messagelabs.com id
	BA/E4-12889-FFD17A35; Sun, 22 Jun 2014 18:18:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403461116!11634691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10116 invoked from network); 22 Jun 2014 18:18:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLc-0000KR-5L
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLc-0007xS-3K
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:36 +0000
Date: Sun, 22 Jun 2014 18:18:36 +0000
Message-Id: <E1WymLc-0007xS-3K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d/qinval: clean up error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59080064611a07ca70ae078980d9d3e2d0391d8b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 14:47:55 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 14:47:55 2014 +0200

    VT-d/qinval: clean up error handling
    
    - neither qinval_update_qtail() nor qinval_next_index() can fail: make
      the former return "void", and drop caller error checks for the latter
      (all of which would otherwise return with a spin lock still held)
    - or-ing together error codes is a bad idea
    
    At once drop bogus initializers.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/qinval.c |   63 +++++++++++++++-------------------
 1 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index ea7f238..45bcf8b 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -58,7 +58,7 @@ static int qinval_next_index(struct iommu *iommu)
     return tail;
 }
 
-static int qinval_update_qtail(struct iommu *iommu, int index)
+static void qinval_update_qtail(struct iommu *iommu, int index)
 {
     u64 val;
 
@@ -66,7 +66,6 @@ static int qinval_update_qtail(struct iommu *iommu, int index)
     ASSERT( spin_is_locked(&iommu->register_lock) );
     val = (index + 1) % QINVAL_ENTRY_NR;
     dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT));
-    return 0;
 }
 
 static int gen_cc_inv_dsc(struct iommu *iommu, int index,
@@ -100,17 +99,15 @@ static int gen_cc_inv_dsc(struct iommu *iommu, int index,
 int queue_invalidate_context(struct iommu *iommu,
     u16 did, u16 source_id, u8 function_mask, u8 granu)
 {
-    int ret = -1;
+    int ret;
     unsigned long flags;
     int index = -1;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_cc_inv_dsc(iommu, index, did, source_id,
                          function_mask, granu);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
@@ -150,18 +147,16 @@ static int gen_iotlb_inv_dsc(struct iommu *iommu, int index,
 int queue_invalidate_iotlb(struct iommu *iommu,
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
 {
-    int ret = -1;
+    int ret;
     unsigned long flags;
     int index = -1;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
 
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_iotlb_inv_dsc(iommu, index, granu, dr, dw, did,
                             am, ih, addr);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
@@ -198,16 +193,13 @@ static int queue_invalidate_wait(struct iommu *iommu,
     s_time_t start_time;
     volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
-    int ret = -1;
+    int ret;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
-
     ret = gen_wait_dsc(iommu, index, iflag, sw, fn, QINVAL_STAT_DONE, &poll_slot);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 
     /* Now we don't support interrupt method */
@@ -225,19 +217,17 @@ static int queue_invalidate_wait(struct iommu *iommu,
             cpu_relax();
         }
     }
+    else if ( !ret )
+        ret = -EOPNOTSUPP;
     return ret;
 }
 
 static int invalidate_sync(struct iommu *iommu)
 {
-    int ret = -1;
     struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
 
-    if ( qi_ctrl->qinval_maddr != 0 )
-    {
-        ret = queue_invalidate_wait(iommu, 0, 1, 1);
-        return ret;
-    }
+    if ( qi_ctrl->qinval_maddr )
+        return queue_invalidate_wait(iommu, 0, 1, 1);
     return 0;
 }
 
@@ -274,17 +264,15 @@ static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, int index,
 int qinval_device_iotlb(struct iommu *iommu,
     u32 max_invs_pend, u16 sid, u16 size, u64 addr)
 {
-    int ret = -1;
+    int ret;
     unsigned long flags;
     int index = -1;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_dev_iotlb_inv_dsc(iommu, index, max_invs_pend,
                                 sid, size, addr);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
@@ -324,26 +312,23 @@ int queue_invalidate_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_iec_inv_dsc(iommu, index, granu, im, iidx);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
 
 static int __iommu_flush_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
 {
-    int ret;
-    ret = queue_invalidate_iec(iommu, granu, im, iidx);
-    ret |= invalidate_sync(iommu);
+    int ret = queue_invalidate_iec(iommu, granu, im, iidx);
+    int rc = invalidate_sync(iommu);
 
     /*
      * reading vt-d architecture register will ensure
      * draining happens in implementation independent way.
      */
     (void)dmar_readq(iommu->reg, DMAR_CAP_REG);
-    return ret;
+    return ret ?: rc;
 }
 
 int iommu_flush_iec_global(struct iommu *iommu)
@@ -380,9 +365,13 @@ static int flush_context_qi(
 
     if ( qi_ctrl->qinval_maddr != 0 )
     {
+        int rc;
+
         ret = queue_invalidate_context(iommu, did, sid, fm,
                                        type >> DMA_CCMD_INVL_GRANU_OFFSET);
-        ret |= invalidate_sync(iommu);
+        rc = invalidate_sync(iommu);
+        if ( !ret )
+            ret = rc;
     }
     return ret;
 }
@@ -413,6 +402,8 @@ static int flush_iotlb_qi(
 
     if ( qi_ctrl->qinval_maddr != 0 )
     {
+        int rc;
+
         /* use queued invalidation */
         if (cap_write_drain(iommu->cap))
             dw = 1;
@@ -423,8 +414,10 @@ static int flush_iotlb_qi(
                   (type >> DMA_TLB_FLUSH_GRANU_OFFSET), dr,
                   dw, did, (u8)size_order, 0, addr);
         if ( flush_dev_iotlb )
-            ret |= dev_invalidate_iotlb(iommu, did, addr, size_order, type);
-        ret |= invalidate_sync(iommu);
+            ret = dev_invalidate_iotlb(iommu, did, addr, size_order, type);
+        rc = invalidate_sync(iommu);
+        if ( !ret )
+            ret = rc;
     }
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:41 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:41 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLh-0007uq-N4; Sun, 22 Jun 2014 18:18:41 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLg-0007ue-7a
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:40 +0000
Received: from [85.158.137.68:45790] by server-11.bemta-3.messagelabs.com id
	BA/E4-12889-FFD17A35; Sun, 22 Jun 2014 18:18:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403461116!11634691!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10116 invoked from network); 22 Jun 2014 18:18:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLc-0000KR-5L
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLc-0007xS-3K
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:36 +0000
Date: Sun, 22 Jun 2014 18:18:36 +0000
Message-Id: <E1WymLc-0007xS-3K@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d/qinval: clean up error handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 59080064611a07ca70ae078980d9d3e2d0391d8b
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 14:47:55 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 14:47:55 2014 +0200

    VT-d/qinval: clean up error handling
    
    - neither qinval_update_qtail() nor qinval_next_index() can fail: make
      the former return "void", and drop caller error checks for the latter
      (all of which would otherwise return with a spin lock still held)
    - or-ing together error codes is a bad idea
    
    At once drop bogus initializers.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/qinval.c |   63 +++++++++++++++-------------------
 1 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index ea7f238..45bcf8b 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -58,7 +58,7 @@ static int qinval_next_index(struct iommu *iommu)
     return tail;
 }
 
-static int qinval_update_qtail(struct iommu *iommu, int index)
+static void qinval_update_qtail(struct iommu *iommu, int index)
 {
     u64 val;
 
@@ -66,7 +66,6 @@ static int qinval_update_qtail(struct iommu *iommu, int index)
     ASSERT( spin_is_locked(&iommu->register_lock) );
     val = (index + 1) % QINVAL_ENTRY_NR;
     dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT));
-    return 0;
 }
 
 static int gen_cc_inv_dsc(struct iommu *iommu, int index,
@@ -100,17 +99,15 @@ static int gen_cc_inv_dsc(struct iommu *iommu, int index,
 int queue_invalidate_context(struct iommu *iommu,
     u16 did, u16 source_id, u8 function_mask, u8 granu)
 {
-    int ret = -1;
+    int ret;
     unsigned long flags;
     int index = -1;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_cc_inv_dsc(iommu, index, did, source_id,
                          function_mask, granu);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
@@ -150,18 +147,16 @@ static int gen_iotlb_inv_dsc(struct iommu *iommu, int index,
 int queue_invalidate_iotlb(struct iommu *iommu,
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
 {
-    int ret = -1;
+    int ret;
     unsigned long flags;
     int index = -1;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
 
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_iotlb_inv_dsc(iommu, index, granu, dr, dw, did,
                             am, ih, addr);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
@@ -198,16 +193,13 @@ static int queue_invalidate_wait(struct iommu *iommu,
     s_time_t start_time;
     volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
-    int ret = -1;
+    int ret;
     unsigned long flags;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
-
     ret = gen_wait_dsc(iommu, index, iflag, sw, fn, QINVAL_STAT_DONE, &poll_slot);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
 
     /* Now we don't support interrupt method */
@@ -225,19 +217,17 @@ static int queue_invalidate_wait(struct iommu *iommu,
             cpu_relax();
         }
     }
+    else if ( !ret )
+        ret = -EOPNOTSUPP;
     return ret;
 }
 
 static int invalidate_sync(struct iommu *iommu)
 {
-    int ret = -1;
     struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
 
-    if ( qi_ctrl->qinval_maddr != 0 )
-    {
-        ret = queue_invalidate_wait(iommu, 0, 1, 1);
-        return ret;
-    }
+    if ( qi_ctrl->qinval_maddr )
+        return queue_invalidate_wait(iommu, 0, 1, 1);
     return 0;
 }
 
@@ -274,17 +264,15 @@ static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, int index,
 int qinval_device_iotlb(struct iommu *iommu,
     u32 max_invs_pend, u16 sid, u16 size, u64 addr)
 {
-    int ret = -1;
+    int ret;
     unsigned long flags;
     int index = -1;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_dev_iotlb_inv_dsc(iommu, index, max_invs_pend,
                                 sid, size, addr);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
@@ -324,26 +312,23 @@ int queue_invalidate_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
-    if ( index == -1 )
-        return -EBUSY;
     ret = gen_iec_inv_dsc(iommu, index, granu, im, iidx);
-    ret |= qinval_update_qtail(iommu, index);
+    qinval_update_qtail(iommu, index);
     spin_unlock_irqrestore(&iommu->register_lock, flags);
     return ret;
 }
 
 static int __iommu_flush_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
 {
-    int ret;
-    ret = queue_invalidate_iec(iommu, granu, im, iidx);
-    ret |= invalidate_sync(iommu);
+    int ret = queue_invalidate_iec(iommu, granu, im, iidx);
+    int rc = invalidate_sync(iommu);
 
     /*
      * reading vt-d architecture register will ensure
      * draining happens in implementation independent way.
      */
     (void)dmar_readq(iommu->reg, DMAR_CAP_REG);
-    return ret;
+    return ret ?: rc;
 }
 
 int iommu_flush_iec_global(struct iommu *iommu)
@@ -380,9 +365,13 @@ static int flush_context_qi(
 
     if ( qi_ctrl->qinval_maddr != 0 )
     {
+        int rc;
+
         ret = queue_invalidate_context(iommu, did, sid, fm,
                                        type >> DMA_CCMD_INVL_GRANU_OFFSET);
-        ret |= invalidate_sync(iommu);
+        rc = invalidate_sync(iommu);
+        if ( !ret )
+            ret = rc;
     }
     return ret;
 }
@@ -413,6 +402,8 @@ static int flush_iotlb_qi(
 
     if ( qi_ctrl->qinval_maddr != 0 )
     {
+        int rc;
+
         /* use queued invalidation */
         if (cap_write_drain(iommu->cap))
             dw = 1;
@@ -423,8 +414,10 @@ static int flush_iotlb_qi(
                   (type >> DMA_TLB_FLUSH_GRANU_OFFSET), dr,
                   dw, did, (u8)size_order, 0, addr);
         if ( flush_dev_iotlb )
-            ret |= dev_invalidate_iotlb(iommu, did, addr, size_order, type);
-        ret |= invalidate_sync(iommu);
+            ret = dev_invalidate_iotlb(iommu, did, addr, size_order, type);
+        rc = invalidate_sync(iommu);
+        if ( !ret )
+            ret = rc;
     }
     return ret;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLq-0007yG-PZ; Sun, 22 Jun 2014 18:18:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLo-0007y0-RU
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:48 +0000
Received: from [85.158.139.211:7084] by server-11.bemta-5.messagelabs.com id
	12/04-01425-80E17A35; Sun, 22 Jun 2014 18:18:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403461126!11340582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21512 invoked from network); 22 Jun 2014 18:18:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLm-0000KX-9H
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLm-0007yL-85
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:46 +0000
Date: Sun, 22 Jun 2014 18:18:46 +0000
Message-Id: <E1WymLm-0007yL-85@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d/qinval: queue index is always
	unsigned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f7e46156a1c006a6eb5489e0227d39229eec316d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 14:48:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 14:48:56 2014 +0200

    VT-d/qinval: queue index is always unsigned
    
    At once drop bogus initializers.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/qinval.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 45bcf8b..f4155e6 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -43,7 +43,7 @@ static void print_qi_regs(struct iommu *iommu)
     printk("DMAR_IQT_REG = %"PRIx64"\n", val);
 }
 
-static int qinval_next_index(struct iommu *iommu)
+static unsigned int qinval_next_index(struct iommu *iommu)
 {
     u64 tail;
 
@@ -58,7 +58,7 @@ static int qinval_next_index(struct iommu *iommu)
     return tail;
 }
 
-static void qinval_update_qtail(struct iommu *iommu, int index)
+static void qinval_update_qtail(struct iommu *iommu, unsigned int index)
 {
     u64 val;
 
@@ -68,7 +68,7 @@ static void qinval_update_qtail(struct iommu *iommu, int index)
     dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT));
 }
 
-static int gen_cc_inv_dsc(struct iommu *iommu, int index,
+static int gen_cc_inv_dsc(struct iommu *iommu, unsigned int index,
     u16 did, u16 source_id, u8 function_mask, u8 granu)
 {
     unsigned long flags;
@@ -101,7 +101,7 @@ int queue_invalidate_context(struct iommu *iommu,
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
@@ -112,7 +112,7 @@ int queue_invalidate_context(struct iommu *iommu,
     return ret;
 }
 
-static int gen_iotlb_inv_dsc(struct iommu *iommu, int index,
+static int gen_iotlb_inv_dsc(struct iommu *iommu, unsigned int index,
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
 {
     unsigned long flags;
@@ -149,7 +149,7 @@ int queue_invalidate_iotlb(struct iommu *iommu,
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
 
@@ -161,7 +161,7 @@ int queue_invalidate_iotlb(struct iommu *iommu,
     return ret;
 }
 
-static int gen_wait_dsc(struct iommu *iommu, int index,
+static int gen_wait_dsc(struct iommu *iommu, unsigned int index,
     u8 iflag, u8 sw, u8 fn, u32 sdata, volatile u32 *saddr)
 {
     unsigned long flags;
@@ -192,7 +192,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
 {
     s_time_t start_time;
     volatile u32 poll_slot = QINVAL_STAT_INIT;
-    int index = -1;
+    unsigned int index;
     int ret;
     unsigned long flags;
 
@@ -231,7 +231,7 @@ static int invalidate_sync(struct iommu *iommu)
     return 0;
 }
 
-static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, int index,
+static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, unsigned int index,
     u32 max_invs_pend, u16 sid, u16 size, u64 addr)
 {
     unsigned long flags;
@@ -266,7 +266,7 @@ int qinval_device_iotlb(struct iommu *iommu,
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
@@ -277,7 +277,7 @@ int qinval_device_iotlb(struct iommu *iommu,
     return ret;
 }
 
-static int gen_iec_inv_dsc(struct iommu *iommu, int index,
+static int gen_iec_inv_dsc(struct iommu *iommu, unsigned int index,
     u8 granu, u8 im, u16 iidx)
 {
     unsigned long flags;
@@ -308,7 +308,7 @@ int queue_invalidate_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Sun Jun 22 18:18:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 22 Jun 2014 18:18:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WymLq-0007yG-PZ; Sun, 22 Jun 2014 18:18:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLo-0007y0-RU
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:48 +0000
Received: from [85.158.139.211:7084] by server-11.bemta-5.messagelabs.com id
	12/04-01425-80E17A35; Sun, 22 Jun 2014 18:18:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403461126!11340582!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21512 invoked from network); 22 Jun 2014 18:18:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Jun 2014 18:18:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLm-0000KX-9H
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WymLm-0007yL-85
	for xen-changelog@lists.xensource.com; Sun, 22 Jun 2014 18:18:46 +0000
Date: Sun, 22 Jun 2014 18:18:46 +0000
Message-Id: <E1WymLm-0007yL-85@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] VT-d/qinval: queue index is always
	unsigned
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit f7e46156a1c006a6eb5489e0227d39229eec316d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Fri Jun 20 14:48:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Fri Jun 20 14:48:56 2014 +0200

    VT-d/qinval: queue index is always unsigned
    
    At once drop bogus initializers.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
---
 xen/drivers/passthrough/vtd/qinval.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 45bcf8b..f4155e6 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -43,7 +43,7 @@ static void print_qi_regs(struct iommu *iommu)
     printk("DMAR_IQT_REG = %"PRIx64"\n", val);
 }
 
-static int qinval_next_index(struct iommu *iommu)
+static unsigned int qinval_next_index(struct iommu *iommu)
 {
     u64 tail;
 
@@ -58,7 +58,7 @@ static int qinval_next_index(struct iommu *iommu)
     return tail;
 }
 
-static void qinval_update_qtail(struct iommu *iommu, int index)
+static void qinval_update_qtail(struct iommu *iommu, unsigned int index)
 {
     u64 val;
 
@@ -68,7 +68,7 @@ static void qinval_update_qtail(struct iommu *iommu, int index)
     dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << QINVAL_INDEX_SHIFT));
 }
 
-static int gen_cc_inv_dsc(struct iommu *iommu, int index,
+static int gen_cc_inv_dsc(struct iommu *iommu, unsigned int index,
     u16 did, u16 source_id, u8 function_mask, u8 granu)
 {
     unsigned long flags;
@@ -101,7 +101,7 @@ int queue_invalidate_context(struct iommu *iommu,
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
@@ -112,7 +112,7 @@ int queue_invalidate_context(struct iommu *iommu,
     return ret;
 }
 
-static int gen_iotlb_inv_dsc(struct iommu *iommu, int index,
+static int gen_iotlb_inv_dsc(struct iommu *iommu, unsigned int index,
     u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
 {
     unsigned long flags;
@@ -149,7 +149,7 @@ int queue_invalidate_iotlb(struct iommu *iommu,
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
 
@@ -161,7 +161,7 @@ int queue_invalidate_iotlb(struct iommu *iommu,
     return ret;
 }
 
-static int gen_wait_dsc(struct iommu *iommu, int index,
+static int gen_wait_dsc(struct iommu *iommu, unsigned int index,
     u8 iflag, u8 sw, u8 fn, u32 sdata, volatile u32 *saddr)
 {
     unsigned long flags;
@@ -192,7 +192,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
 {
     s_time_t start_time;
     volatile u32 poll_slot = QINVAL_STAT_INIT;
-    int index = -1;
+    unsigned int index;
     int ret;
     unsigned long flags;
 
@@ -231,7 +231,7 @@ static int invalidate_sync(struct iommu *iommu)
     return 0;
 }
 
-static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, int index,
+static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, unsigned int index,
     u32 max_invs_pend, u16 sid, u16 size, u64 addr)
 {
     unsigned long flags;
@@ -266,7 +266,7 @@ int qinval_device_iotlb(struct iommu *iommu,
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
@@ -277,7 +277,7 @@ int qinval_device_iotlb(struct iommu *iommu,
     return ret;
 }
 
-static int gen_iec_inv_dsc(struct iommu *iommu, int index,
+static int gen_iec_inv_dsc(struct iommu *iommu, unsigned int index,
     u8 granu, u8 im, u16 iidx)
 {
     unsigned long flags;
@@ -308,7 +308,7 @@ int queue_invalidate_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
 {
     int ret;
     unsigned long flags;
-    int index = -1;
+    unsigned int index;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
     index = qinval_next_index(iommu);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 15:00:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 15:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzogL-0000OS-4u; Wed, 25 Jun 2014 15:00:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzogK-0000OK-99
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 15:00:16 +0000
Received: from [85.158.137.68:24422] by server-14.bemta-3.messagelabs.com id
	E4/6B-19846-FF3EAA35; Wed, 25 Jun 2014 15:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1403708413!12335982!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24007 invoked from network); 25 Jun 2014 15:00:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 15:00:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzogH-0004s7-FI
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 15:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzog6-0004sG-TP
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 15:00:03 +0000
Date: Wed, 25 Jun 2014 15:00:02 +0000
Message-Id: <E1Wzog6-0004sG-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen-trad: free all the
	pirqs for msi/msix when driver unloads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0395cc49b2ec6d1723c01f1daf2394b9264ca29
Author:     Zhenzhong Duan <zhenzhong.duan@oracle.com>
AuthorDate: Tue Apr 8 16:50:06 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jun 25 15:51:35 2014 +0100

    qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
    
    Pirqs are not freed when driver unloads, then new pirqs are allocated when
    driver reloads. This could exhaust pirqs if do it in a loop.
    
    This patch fixes the bug by freeing pirqs when ENABLE bit is cleared in
    msi/msix control reg.
    
    There is also other way of fixing it such as reuse pirqs between driver reload,
    but this way is better.
    Xen-devel: http://marc.info/?l=xen-devel&m=136800120304275&w=2
    
    Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    [ This is the qemu-xen-trad version of qemu-xen-upstream
      1d4fd4f0e2fc5dcae0c60e00cc9af95f52988050 -iwj ]
---
 hw/pass-through.c |    8 +++++++-
 hw/pt-msi.c       |    5 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 304c438..4821182 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -3866,7 +3866,11 @@ static int pt_msgctrl_reg_write(struct pt_dev *ptdev,
         ptdev->msi->flags |= PCI_MSI_FLAGS_ENABLE;
     }
     else
-        ptdev->msi->flags &= ~PCI_MSI_FLAGS_ENABLE;
+    {
+        if (ptdev->msi->flags & PT_MSI_MAPPED) {
+            pt_msi_disable(ptdev);
+        }
+    }
 
     /* pass through MSI_ENABLE bit when no MSI-INTx translation */
     if (!ptdev->msi_trans_en) {
@@ -4013,6 +4017,8 @@ static int pt_msixctrl_reg_write(struct pt_dev *ptdev,
             pt_disable_msi_translate(ptdev);
         }
         pt_msix_update(ptdev);
+    } else if (!(*value & PCI_MSIX_ENABLE) && ptdev->msix->enabled) {
+        pt_msix_disable(ptdev);
     }
 
     ptdev->msix->enabled = !!(*value & PCI_MSIX_ENABLE);
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index b03b989..3f5f94b 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -213,7 +213,8 @@ void pt_msi_disable(struct pt_dev *dev)
 
 out:
     /* clear msi info */
-    dev->msi->flags &= ~(MSI_FLAG_UNINIT | PT_MSI_MAPPED | PCI_MSI_FLAGS_ENABLE);
+    dev->msi->flags &= ~(PT_MSI_MAPPED | PCI_MSI_FLAGS_ENABLE);
+    dev->msi->flags |= MSI_FLAG_UNINIT;
     dev->msi->pirq = -1;
     dev->msi_trans_en = 0;
 }
@@ -447,7 +448,7 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
     {
         const volatile uint32_t *vec_ctrl;
 
-        if ( entry->io_mem[offset] == val )
+        if ( entry->io_mem[offset] == val && entry->pirq != -1)
             return;
 
         /*
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 15:00:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 15:00:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzogL-0000OS-4u; Wed, 25 Jun 2014 15:00:17 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzogK-0000OK-99
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 15:00:16 +0000
Received: from [85.158.137.68:24422] by server-14.bemta-3.messagelabs.com id
	E4/6B-19846-FF3EAA35; Wed, 25 Jun 2014 15:00:15 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1403708413!12335982!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24007 invoked from network); 25 Jun 2014 15:00:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 15:00:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzogH-0004s7-FI
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 15:00:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzog6-0004sG-TP
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 15:00:03 +0000
Date: Wed, 25 Jun 2014 15:00:02 +0000
Message-Id: <E1Wzog6-0004sG-TP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen-trad: free all the
	pirqs for msi/msix when driver unloads
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d0395cc49b2ec6d1723c01f1daf2394b9264ca29
Author:     Zhenzhong Duan <zhenzhong.duan@oracle.com>
AuthorDate: Tue Apr 8 16:50:06 2014 +0000
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Wed Jun 25 15:51:35 2014 +0100

    qemu-xen-trad: free all the pirqs for msi/msix when driver unloads
    
    Pirqs are not freed when driver unloads, then new pirqs are allocated when
    driver reloads. This could exhaust pirqs if do it in a loop.
    
    This patch fixes the bug by freeing pirqs when ENABLE bit is cleared in
    msi/msix control reg.
    
    There is also other way of fixing it such as reuse pirqs between driver reload,
    but this way is better.
    Xen-devel: http://marc.info/?l=xen-devel&m=136800120304275&w=2
    
    Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    
    [ This is the qemu-xen-trad version of qemu-xen-upstream
      1d4fd4f0e2fc5dcae0c60e00cc9af95f52988050 -iwj ]
---
 hw/pass-through.c |    8 +++++++-
 hw/pt-msi.c       |    5 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/hw/pass-through.c b/hw/pass-through.c
index 304c438..4821182 100644
--- a/hw/pass-through.c
+++ b/hw/pass-through.c
@@ -3866,7 +3866,11 @@ static int pt_msgctrl_reg_write(struct pt_dev *ptdev,
         ptdev->msi->flags |= PCI_MSI_FLAGS_ENABLE;
     }
     else
-        ptdev->msi->flags &= ~PCI_MSI_FLAGS_ENABLE;
+    {
+        if (ptdev->msi->flags & PT_MSI_MAPPED) {
+            pt_msi_disable(ptdev);
+        }
+    }
 
     /* pass through MSI_ENABLE bit when no MSI-INTx translation */
     if (!ptdev->msi_trans_en) {
@@ -4013,6 +4017,8 @@ static int pt_msixctrl_reg_write(struct pt_dev *ptdev,
             pt_disable_msi_translate(ptdev);
         }
         pt_msix_update(ptdev);
+    } else if (!(*value & PCI_MSIX_ENABLE) && ptdev->msix->enabled) {
+        pt_msix_disable(ptdev);
     }
 
     ptdev->msix->enabled = !!(*value & PCI_MSIX_ENABLE);
diff --git a/hw/pt-msi.c b/hw/pt-msi.c
index b03b989..3f5f94b 100644
--- a/hw/pt-msi.c
+++ b/hw/pt-msi.c
@@ -213,7 +213,8 @@ void pt_msi_disable(struct pt_dev *dev)
 
 out:
     /* clear msi info */
-    dev->msi->flags &= ~(MSI_FLAG_UNINIT | PT_MSI_MAPPED | PCI_MSI_FLAGS_ENABLE);
+    dev->msi->flags &= ~(PT_MSI_MAPPED | PCI_MSI_FLAGS_ENABLE);
+    dev->msi->flags |= MSI_FLAG_UNINIT;
     dev->msi->pirq = -1;
     dev->msi_trans_en = 0;
 }
@@ -447,7 +448,7 @@ static void pci_msix_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
     {
         const volatile uint32_t *vec_ctrl;
 
-        if ( entry->io_mem[offset] == val )
+        if ( entry->io_mem[offset] == val && entry->pirq != -1)
             return;
 
         /*
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvvG-0003Ap-70; Wed, 25 Jun 2014 22:44:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvF-0003Af-6H
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:09 +0000
Received: from [85.158.139.211:40355] by server-10.bemta-5.messagelabs.com id
	A0/FB-01434-8B05BA35; Wed, 25 Jun 2014 22:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403736245!12039862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28002 invoked from network); 25 Jun 2014 22:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvv9-0001I9-VN
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvv9-0001Vx-Nd
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:03 +0000
Date: Wed, 25 Jun 2014 22:44:03 +0000
Message-Id: <E1Wzvv9-0001Vx-Nd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c2545958a69f19ea60b178480949750c7dd0111
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 24 09:30:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:30:28 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    master commit: 071a4c70a634f7d4f74cde4086ff3202968538c9
    master date: 2014-06-02 10:19:27 +0200
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 3014245..32d7fa1 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -164,7 +164,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:13 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvvG-0003Ap-70; Wed, 25 Jun 2014 22:44:10 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvF-0003Af-6H
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:09 +0000
Received: from [85.158.139.211:40355] by server-10.bemta-5.messagelabs.com id
	A0/FB-01434-8B05BA35; Wed, 25 Jun 2014 22:44:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403736245!12039862!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28002 invoked from network); 25 Jun 2014 22:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvv9-0001I9-VN
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvv9-0001Vx-Nd
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:03 +0000
Date: Wed, 25 Jun 2014 22:44:03 +0000
Message-Id: <E1Wzvv9-0001Vx-Nd@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3c2545958a69f19ea60b178480949750c7dd0111
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 24 09:30:28 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:30:28 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    master commit: 071a4c70a634f7d4f74cde4086ff3202968538c9
    master date: 2014-06-02 10:19:27 +0200
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 3014245..32d7fa1 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -164,7 +164,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvvP-0003CC-Ao; Wed, 25 Jun 2014 22:44:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvO-0003C2-B2
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:18 +0000
Received: from [85.158.137.68:43824] by server-12.bemta-3.messagelabs.com id
	A5/72-12714-1C05BA35; Wed, 25 Jun 2014 22:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403736255!7942588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1123 invoked from network); 25 Jun 2014 22:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvL-0001IC-Ht
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvL-0001WJ-FZ
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:15 +0000
Date: Wed, 25 Jun 2014 22:44:15 +0000
Message-Id: <E1WzvvL-0001WJ-FZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] ACPI: Prevent acpi_table_entries
	from falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53f56f69aa87769f2a2a5692709c34eab7ddd14c
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:31:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:31:57 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
    master date: 2014-06-04 11:26:15 +0200
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 08e8f3b..1beca79 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -233,6 +233,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvvP-0003CC-Ao; Wed, 25 Jun 2014 22:44:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvO-0003C2-B2
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:18 +0000
Received: from [85.158.137.68:43824] by server-12.bemta-3.messagelabs.com id
	A5/72-12714-1C05BA35; Wed, 25 Jun 2014 22:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403736255!7942588!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1123 invoked from network); 25 Jun 2014 22:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvL-0001IC-Ht
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvL-0001WJ-FZ
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:15 +0000
Date: Wed, 25 Jun 2014 22:44:15 +0000
Message-Id: <E1WzvvL-0001WJ-FZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] ACPI: Prevent acpi_table_entries
	from falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 53f56f69aa87769f2a2a5692709c34eab7ddd14c
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:31:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:31:57 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
    master date: 2014-06-04 11:26:15 +0200
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 08e8f3b..1beca79 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -233,6 +233,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvvZ-0003E7-EJ; Wed, 25 Jun 2014 22:44:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvY-0003Du-Mx
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:28 +0000
Received: from [85.158.137.68:34841] by server-11.bemta-3.messagelabs.com id
	52/DD-12889-BC05BA35; Wed, 25 Jun 2014 22:44:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403736266!12369422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15701 invoked from network); 25 Jun 2014 22:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvV-0001IO-Nv
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvV-0001XB-Ld
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:25 +0000
Date: Wed, 25 Jun 2014 22:44:25 +0000
Message-Id: <E1WzvvV-0001XB-Ld@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/PVH: avoid call to handle_mmio
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31e260ceb57e0de5c868581e3937f247fad5e288
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Tue Jun 24 09:33:18 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:33:18 2014 +0200

    x86/PVH: avoid call to handle_mmio
    
    handle_mmio() is currently unsafe for pvh guests. A call to it would
    result in call to vioapic_range that will crash xen since the vioapic
    ptr in struct hvm_domain is not initialized for pvh guests.
    
    However, one path exists for such a call. If a pvh guest, dom0 or domU,
    unintentionally touches non-existing memory, an EPT violation would occur.
    This would result in unconditional call to hvm_hap_nested_page_fault. In
    that function, because get_gfn_type_access returns p2m_mmio_dm for non
    existing mfns by default, handle_mmio() will get called. This would result
    in xen crash instead of the guest crash. This patch addresses that.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    master commit: 7c4870915c2d50acbc66347a532e33b452f64f17
    master date: 2014-06-04 11:27:50 +0200
---
 xen/arch/x86/hvm/hvm.c |    5 +++++
 xen/arch/x86/hvm/io.c  |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 216c3f2..00ca528 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1527,6 +1527,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          (access_w && (p2mt == p2m_ram_ro)) )
     {
         put_gfn(p2m->domain, gfn);
+
+        rc = 0;
+        if ( unlikely(is_pvh_vcpu(v)) )
+            goto out;
+
         if ( !handle_mmio() )
             hvm_inject_hw_exception(TRAP_gp_fault, 0);
         rc = 1;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index bf6309d..247fb7e 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -178,6 +178,8 @@ int handle_mmio(void)
     struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io;
     int rc;
 
+    ASSERT(!is_pvh_vcpu(curr));
+
     hvm_emulate_prepare(&ctxt, guest_cpu_user_regs());
 
     rc = hvm_emulate_one(&ctxt);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvvZ-0003E7-EJ; Wed, 25 Jun 2014 22:44:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvY-0003Du-Mx
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:28 +0000
Received: from [85.158.137.68:34841] by server-11.bemta-3.messagelabs.com id
	52/DD-12889-BC05BA35; Wed, 25 Jun 2014 22:44:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-31.messagelabs.com!1403736266!12369422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15701 invoked from network); 25 Jun 2014 22:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvV-0001IO-Nv
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvvV-0001XB-Ld
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:25 +0000
Date: Wed, 25 Jun 2014 22:44:25 +0000
Message-Id: <E1WzvvV-0001XB-Ld@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/PVH: avoid call to handle_mmio
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31e260ceb57e0de5c868581e3937f247fad5e288
Author:     Mukesh Rathor <mukesh.rathor@oracle.com>
AuthorDate: Tue Jun 24 09:33:18 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:33:18 2014 +0200

    x86/PVH: avoid call to handle_mmio
    
    handle_mmio() is currently unsafe for pvh guests. A call to it would
    result in call to vioapic_range that will crash xen since the vioapic
    ptr in struct hvm_domain is not initialized for pvh guests.
    
    However, one path exists for such a call. If a pvh guest, dom0 or domU,
    unintentionally touches non-existing memory, an EPT violation would occur.
    This would result in unconditional call to hvm_hap_nested_page_fault. In
    that function, because get_gfn_type_access returns p2m_mmio_dm for non
    existing mfns by default, handle_mmio() will get called. This would result
    in xen crash instead of the guest crash. This patch addresses that.
    
    Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
    master commit: 7c4870915c2d50acbc66347a532e33b452f64f17
    master date: 2014-06-04 11:27:50 +0200
---
 xen/arch/x86/hvm/hvm.c |    5 +++++
 xen/arch/x86/hvm/io.c  |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 216c3f2..00ca528 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -1527,6 +1527,11 @@ int hvm_hap_nested_page_fault(paddr_t gpa,
          (access_w && (p2mt == p2m_ram_ro)) )
     {
         put_gfn(p2m->domain, gfn);
+
+        rc = 0;
+        if ( unlikely(is_pvh_vcpu(v)) )
+            goto out;
+
         if ( !handle_mmio() )
             hvm_inject_hw_exception(TRAP_gp_fault, 0);
         rc = 1;
diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
index bf6309d..247fb7e 100644
--- a/xen/arch/x86/hvm/io.c
+++ b/xen/arch/x86/hvm/io.c
@@ -178,6 +178,8 @@ int handle_mmio(void)
     struct hvm_vcpu_io *vio = &curr->arch.hvm_vcpu.hvm_io;
     int rc;
 
+    ASSERT(!is_pvh_vcpu(curr));
+
     hvm_emulate_prepare(&ctxt, guest_cpu_user_regs());
 
     rc = hvm_emulate_one(&ctxt);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvvk-0003G5-H1; Wed, 25 Jun 2014 22:44:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvj-0003Fl-HV
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:39 +0000
Received: from [85.158.143.35:15670] by server-1.bemta-4.messagelabs.com id
	9B/1C-09496-6D05BA35; Wed, 25 Jun 2014 22:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403736276!13897078!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 806 invoked from network); 25 Jun 2014 22:44:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvf-0001IU-Vb
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvf-0001XY-SI
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:35 +0000
Date: Wed, 25 Jun 2014 22:44:35 +0000
Message-Id: <E1Wzvvf-0001XY-SI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: honor APEI firmware-first
	mode in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cda149c71f33d44786ccf2eacfe60cab6254f171
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:34:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:34:57 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
    master date: 2014-06-05 17:49:14 +0200
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    1 +
 xen/include/xen/pci.h                |    2 +
 9 files changed, 338 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 6d7984f..05de536 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -748,6 +748,8 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
 
 	return 0;
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..6ad7c64 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-y += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 6a81e0d..e5d332d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1066,6 +1066,106 @@ void __init setup_dom0_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 33f3942..647723d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -386,9 +386,11 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     int dev = PCI_SLOT(pdev->devfn);
     int func = PCI_FUNC(pdev->devfn);
     int pos;
-    u32 val;
+    bool_t ff;
+    u32 val, val2;
     u64 bar;
     paddr_t pa;
+    const char *action;
 
     if ( pci_conf_read16(seg, bus, dev, func, PCI_VENDOR_ID) !=
          PCI_VENDOR_ID_INTEL )
@@ -438,7 +440,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -447,18 +452,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 
     case 0x100: case 0x104: case 0x108: /* Sandybridge */
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index 162f616..087bbef 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 size_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index aedec65..3aeba4a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,7 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3ddbb0f..f3f080f 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -144,6 +144,8 @@ int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 const char *parse_pci(const char *, unsigned int *seg, unsigned int *bus,
                       unsigned int *dev, unsigned int *func);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvvk-0003G5-H1; Wed, 25 Jun 2014 22:44:40 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvj-0003Fl-HV
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:39 +0000
Received: from [85.158.143.35:15670] by server-1.bemta-4.messagelabs.com id
	9B/1C-09496-6D05BA35; Wed, 25 Jun 2014 22:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403736276!13897078!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 806 invoked from network); 25 Jun 2014 22:44:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvf-0001IU-Vb
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvf-0001XY-SI
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:35 +0000
Date: Wed, 25 Jun 2014 22:44:35 +0000
Message-Id: <E1Wzvvf-0001XY-SI@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d: honor APEI firmware-first
	mode in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cda149c71f33d44786ccf2eacfe60cab6254f171
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:34:57 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:34:57 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
    master date: 2014-06-05 17:49:14 +0200
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    1 +
 xen/include/xen/pci.h                |    2 +
 9 files changed, 338 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 6d7984f..05de536 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -748,6 +748,8 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
 
 	return 0;
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..6ad7c64 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-y += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 6a81e0d..e5d332d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1066,6 +1066,106 @@ void __init setup_dom0_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 33f3942..647723d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -386,9 +386,11 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     int dev = PCI_SLOT(pdev->devfn);
     int func = PCI_FUNC(pdev->devfn);
     int pos;
-    u32 val;
+    bool_t ff;
+    u32 val, val2;
     u64 bar;
     paddr_t pa;
+    const char *action;
 
     if ( pci_conf_read16(seg, bus, dev, func, PCI_VENDOR_ID) !=
          PCI_VENDOR_ID_INTEL )
@@ -438,7 +440,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -447,18 +452,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 
     case 0x100: case 0x104: case 0x108: /* Sandybridge */
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index 162f616..087bbef 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 size_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index aedec65..3aeba4a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,7 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3ddbb0f..f3f080f 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -144,6 +144,8 @@ int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 const char *parse_pci(const char *, unsigned int *seg, unsigned int *bus,
                       unsigned int *dev, unsigned int *func);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvvv-0003Ia-Lo; Wed, 25 Jun 2014 22:44:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvu-0003IM-E7
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:50 +0000
Received: from [85.158.143.35:19957] by server-2.bemta-4.messagelabs.com id
	A2/4F-06539-1E05BA35; Wed, 25 Jun 2014 22:44:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1403736286!5834239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10533 invoked from network); 25 Jun 2014 22:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvq-0001Ia-5I
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvq-0001Xu-37
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:46 +0000
Date: Wed, 25 Jun 2014 22:44:46 +0000
Message-Id: <E1Wzvvq-0001Xu-37@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/domctl: two functional fixes
	to XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22ced78a8222631d21bb2c71f7bf3c05b3aa7411
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 24 09:36:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:36:49 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    # Commit 895661ae98f0249f50280b4acfb9dda70b76d7e9
    # Date 2014-06-10 12:03:16 +0200
    # Author Andrew Cooper <andrew.cooper3@citrix.com>
    # Committer Jan Beulich <jbeulich@suse.com>
    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 090ca8c155b7321404ea7713a28aaedb7ac4fffd
    master date: 2014-06-05 17:52:57 +0200
    master commit: 895661ae98f0249f50280b4acfb9dda70b76d7e9
    master date: 2014-06-10 12:03:16 +0200
---
 xen/arch/x86/domctl.c |   55 +++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 327c5fa..73613a6 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1089,45 +1089,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1176,12 +1179,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
@@ -1189,8 +1194,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:44:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:44:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvvv-0003Ia-Lo; Wed, 25 Jun 2014 22:44:51 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvu-0003IM-E7
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:50 +0000
Received: from [85.158.143.35:19957] by server-2.bemta-4.messagelabs.com id
	A2/4F-06539-1E05BA35; Wed, 25 Jun 2014 22:44:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-2.tower-21.messagelabs.com!1403736286!5834239!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10533 invoked from network); 25 Jun 2014 22:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvq-0001Ia-5I
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvvq-0001Xu-37
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:46 +0000
Date: Wed, 25 Jun 2014 22:44:46 +0000
Message-Id: <E1Wzvvq-0001Xu-37@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/domctl: two functional fixes
	to XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22ced78a8222631d21bb2c71f7bf3c05b3aa7411
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 24 09:36:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:36:49 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    # Commit 895661ae98f0249f50280b4acfb9dda70b76d7e9
    # Date 2014-06-10 12:03:16 +0200
    # Author Andrew Cooper <andrew.cooper3@citrix.com>
    # Committer Jan Beulich <jbeulich@suse.com>
    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 090ca8c155b7321404ea7713a28aaedb7ac4fffd
    master date: 2014-06-05 17:52:57 +0200
    master commit: 895661ae98f0249f50280b4acfb9dda70b76d7e9
    master date: 2014-06-10 12:03:16 +0200
---
 xen/arch/x86/domctl.c |   55 +++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 327c5fa..73613a6 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1089,45 +1089,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1176,12 +1179,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
@@ -1189,8 +1194,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvw4-0003KB-Oa; Wed, 25 Jun 2014 22:45:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvw3-0003Ju-5c
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:59 +0000
Received: from [193.109.254.147:5528] by server-13.bemta-14.messagelabs.com id
	FC/86-23211-AE05BA35; Wed, 25 Jun 2014 22:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403736296!13662793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 646 invoked from network); 25 Jun 2014 22:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvw0-0001Ig-Cj
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvw0-0001YG-A5
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:56 +0000
Date: Wed, 25 Jun 2014 22:44:56 +0000
Message-Id: <E1Wzvw0-0001YG-A5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: fix reboot/shutdown with
	running HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7654019886090741470=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit d2223d1cfea175a7e31b1b68b36620a4af46b7c0
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jun 24 09:37:37 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:37:37 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 39ede234d1fd683430ffb1784d6d35b096f16457
    master date: 2014-06-05 17:53:35 +0200
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 13ac569..3f274f0 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -861,6 +861,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu = smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) == 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7c70a6d..ee1f4d5 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -74,7 +74,7 @@ u64 vmx_ept_vpid_cap __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 39c6d83..aec505a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -617,6 +617,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ebaba5c..f0c5fa5 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -483,6 +483,8 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvw4-0003KB-Oa; Wed, 25 Jun 2014 22:45:00 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvw3-0003Ju-5c
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:59 +0000
Received: from [193.109.254.147:5528] by server-13.bemta-14.messagelabs.com id
	FC/86-23211-AE05BA35; Wed, 25 Jun 2014 22:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-27.messagelabs.com!1403736296!13662793!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 646 invoked from network); 25 Jun 2014 22:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvw0-0001Ig-Cj
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvw0-0001YG-A5
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:44:56 +0000
Date: Wed, 25 Jun 2014 22:44:56 +0000
Message-Id: <E1Wzvw0-0001YG-A5@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: fix reboot/shutdown with
	running HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7654019886090741470=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit d2223d1cfea175a7e31b1b68b36620a4af46b7c0
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jun 24 09:37:37 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:37:37 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 39ede234d1fd683430ffb1784d6d35b096f16457
    master date: 2014-06-05 17:53:35 +0200
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 13ac569..3f274f0 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -861,6 +861,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu = smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) == 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index 7c70a6d..ee1f4d5 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -74,7 +74,7 @@ u64 vmx_ept_vpid_cap __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index 39c6d83..aec505a 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -617,6 +617,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ebaba5c..f0c5fa5 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -483,6 +483,8 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4


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

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvwE-0003M7-Rc; Wed, 25 Jun 2014 22:45:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwD-0003Lk-4t
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:09 +0000
Received: from [193.109.254.147:64742] by server-4.bemta-14.messagelabs.com id
	B8/86-02781-4F05BA35; Wed, 25 Jun 2014 22:45:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403736306!13702437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27902 invoked from network); 25 Jun 2014 22:45:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwA-0001Jf-Mb
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwA-0001Yr-GZ
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:06 +0000
Date: Wed, 25 Jun 2014 22:45:06 +0000
Message-Id: <E1WzvwA-0001Yr-GZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] avoid crash on HVM domain destroy
	with PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dff8cf4ad4f0a65ffeddf01441491003f153a984
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 24 09:38:48 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:38:48 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    master commit: b9ae60907e6dbc686403e52a7e61a6f856401a1b
    master date: 2014-06-10 12:04:08 +0200
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 1192fe2..2f28487 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -297,7 +297,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:10 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:10 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvwE-0003M7-Rc; Wed, 25 Jun 2014 22:45:10 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwD-0003Lk-4t
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:09 +0000
Received: from [193.109.254.147:64742] by server-4.bemta-14.messagelabs.com id
	B8/86-02781-4F05BA35; Wed, 25 Jun 2014 22:45:08 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-27.messagelabs.com!1403736306!13702437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27902 invoked from network); 25 Jun 2014 22:45:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwA-0001Jf-Mb
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwA-0001Yr-GZ
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:06 +0000
Date: Wed, 25 Jun 2014 22:45:06 +0000
Message-Id: <E1WzvwA-0001Yr-GZ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] avoid crash on HVM domain destroy
	with PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit dff8cf4ad4f0a65ffeddf01441491003f153a984
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 24 09:38:48 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:38:48 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    master commit: b9ae60907e6dbc686403e52a7e61a6f856401a1b
    master date: 2014-06-10 12:04:08 +0200
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index 1192fe2..2f28487 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -297,7 +297,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvwP-0003O9-VL; Wed, 25 Jun 2014 22:45:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwN-0003Ng-Vf
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:20 +0000
Received: from [193.109.254.147:6648] by server-12.bemta-14.messagelabs.com id
	F6/C1-32179-FF05BA35; Wed, 25 Jun 2014 22:45:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403736317!13625440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24420 invoked from network); 25 Jun 2014 22:45: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;
	25 Jun 2014 22:45:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwL-0001Jl-7U
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwK-0001ZG-Qo
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:17 +0000
Date: Wed, 25 Jun 2014 22:45:16 +0000
Message-Id: <E1WzvwK-0001ZG-Qo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: refine SMEP test in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb41f1c0f6bec259be5a1ab81530d28eeae0b667
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:40:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:40:01 2014 +0200

    x86/HVM: refine SMEP test in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    master commit: 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
    master date: 2014-06-10 13:12:05 +0200
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 00ca528..eefa968 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -857,7 +857,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -1980,7 +1980,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0cb819f..974bcc0 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -373,18 +373,24 @@ static inline bool_t hvm_vcpu_has_smep(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvwP-0003O9-VL; Wed, 25 Jun 2014 22:45:21 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwN-0003Ng-Vf
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:20 +0000
Received: from [193.109.254.147:6648] by server-12.bemta-14.messagelabs.com id
	F6/C1-32179-FF05BA35; Wed, 25 Jun 2014 22:45:19 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1403736317!13625440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24420 invoked from network); 25 Jun 2014 22:45: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;
	25 Jun 2014 22:45:18 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwL-0001Jl-7U
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwK-0001ZG-Qo
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:17 +0000
Date: Wed, 25 Jun 2014 22:45:16 +0000
Message-Id: <E1WzvwK-0001ZG-Qo@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/HVM: refine SMEP test in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit bb41f1c0f6bec259be5a1ab81530d28eeae0b667
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:40:01 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:40:01 2014 +0200

    x86/HVM: refine SMEP test in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    master commit: 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
    master date: 2014-06-10 13:12:05 +0200
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 00ca528..eefa968 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -857,7 +857,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -1980,7 +1980,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 0cb819f..974bcc0 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -373,18 +373,24 @@ static inline bool_t hvm_vcpu_has_smep(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvwa-0003Pk-2a; Wed, 25 Jun 2014 22:45:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwY-0003PS-4u
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:30 +0000
Received: from [193.109.254.147:7100] by server-15.bemta-14.messagelabs.com id
	00/73-15813-9015BA35; Wed, 25 Jun 2014 22:45:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403736327!13717149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32524 invoked from network); 25 Jun 2014 22:45:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwV-0001Jt-CI
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwV-0001aL-Az
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:27 +0000
Date: Wed, 25 Jun 2014 22:45:27 +0000
Message-Id: <E1WzvwV-0001aL-Az@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mce: don't spam the console
	with "CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c952a54260402447fc65d7cf07fcb3a6e62e9db
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jun 24 09:40:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:40:56 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: 323338f86fb6cd6f6dba4f59a84eed71b3552d21
    master date: 2014-06-16 11:59:32 +0200
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b32fdb2..5b93870 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -49,11 +49,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -62,13 +66,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -802,6 +810,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
 
     per_cpu(no_cmci_banks, cpu) = cmci;
     per_cpu(mce_banks_owned, cpu) = owned;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvwa-0003Pk-2a; Wed, 25 Jun 2014 22:45:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwY-0003PS-4u
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:30 +0000
Received: from [193.109.254.147:7100] by server-15.bemta-14.messagelabs.com id
	00/73-15813-9015BA35; Wed, 25 Jun 2014 22:45:29 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403736327!13717149!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32524 invoked from network); 25 Jun 2014 22:45:28 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:28 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwV-0001Jt-CI
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvwV-0001aL-Az
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:27 +0000
Date: Wed, 25 Jun 2014 22:45:27 +0000
Message-Id: <E1WzvwV-0001aL-Az@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mce: don't spam the console
	with "CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5c952a54260402447fc65d7cf07fcb3a6e62e9db
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jun 24 09:40:56 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:40:56 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: 323338f86fb6cd6f6dba4f59a84eed71b3552d21
    master date: 2014-06-16 11:59:32 +0200
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b32fdb2..5b93870 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -49,11 +49,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -62,13 +66,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -802,6 +810,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
 
     per_cpu(no_cmci_banks, cpu) = cmci;
     per_cpu(mce_banks_owned, cpu) = owned;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvwk-0003Rk-7O; Wed, 25 Jun 2014 22:45:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwi-0003RO-6Z
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:40 +0000
Received: from [85.158.143.35:45950] by server-3.bemta-4.messagelabs.com id
	D0/61-16194-3115BA35; Wed, 25 Jun 2014 22:45:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403736337!13897159!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2740 invoked from network); 25 Jun 2014 22:45:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwf-0001Jz-I8
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwf-0001ai-GE
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:37 +0000
Date: Wed, 25 Jun 2014 22:45:37 +0000
Message-Id: <E1Wzvwf-0001ai-GE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d7e5915aedb2772b6aab9b066f993361f87b019
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:41:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:41:45 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 84c340ba4c3eb99278b6ba885616bb183b88ad67
    master date: 2014-06-18 15:50:02 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    3 ++-
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index c26aabc..f97fcf2 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -163,7 +163,7 @@ static void amd_iommu_setup_domain_device(
          !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
         if ( devfn == pdev->devfn )
-            enable_ats_device(iommu->seg, bus, devfn);
+            enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index cf649d4..000e76d 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #define ATS_REG_CAP    4
@@ -34,7 +35,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c9f779f..e543c08 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1442,7 +1442,7 @@ static int domain_context_mapping(
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1930,7 +1930,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:42 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvwk-0003Rk-7O; Wed, 25 Jun 2014 22:45:42 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwi-0003RO-6Z
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:40 +0000
Received: from [85.158.143.35:45950] by server-3.bemta-4.messagelabs.com id
	D0/61-16194-3115BA35; Wed, 25 Jun 2014 22:45:39 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403736337!13897159!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2740 invoked from network); 25 Jun 2014 22:45:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwf-0001Jz-I8
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwf-0001ai-GE
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:37 +0000
Date: Wed, 25 Jun 2014 22:45:37 +0000
Message-Id: <E1Wzvwf-0001ai-GE@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0d7e5915aedb2772b6aab9b066f993361f87b019
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:41:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:41:45 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 84c340ba4c3eb99278b6ba885616bb183b88ad67
    master date: 2014-06-18 15:50:02 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    3 ++-
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index c26aabc..f97fcf2 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -163,7 +163,7 @@ static void amd_iommu_setup_domain_device(
          !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
         if ( devfn == pdev->devfn )
-            enable_ats_device(iommu->seg, bus, devfn);
+            enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index cf649d4..000e76d 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #define ATS_REG_CAP    4
@@ -34,7 +35,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index c9f779f..e543c08 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1442,7 +1442,7 @@ static int domain_context_mapping(
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1930,7 +1930,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvwt-0003TM-AL; Wed, 25 Jun 2014 22:45:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvws-0003Sz-4i
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:50 +0000
Received: from [85.158.139.211:47182] by server-10.bemta-5.messagelabs.com id
	09/AC-01434-D115BA35; Wed, 25 Jun 2014 22:45:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403736347!12023449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30468 invoked from network); 25 Jun 2014 22:45:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45: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 1Wzvwp-0001K5-OE
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwp-0001b4-MP
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:47 +0000
Date: Wed, 25 Jun 2014 22:45:47 +0000
Message-Id: <E1Wzvwp-0001b4-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/EFI: allow FPU/XMM use in
	runtime service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3ed5db85b82cb67e669fdddffa205187a6343a9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:42:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:42:49 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: e0fe297dabc96d8161d568f19a99722c4739b9f9
    master date: 2014-06-18 15:53:27 +0200
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index d7c884b..166852d 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -45,8 +47,14 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -82,6 +90,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index bd72138..a372e0b 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -266,10 +266,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -284,9 +284,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 1f5fe50..fd268a9 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:45:51 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:45:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvwt-0003TM-AL; Wed, 25 Jun 2014 22:45:51 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvws-0003Sz-4i
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:50 +0000
Received: from [85.158.139.211:47182] by server-10.bemta-5.messagelabs.com id
	09/AC-01434-D115BA35; Wed, 25 Jun 2014 22:45:49 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-206.messagelabs.com!1403736347!12023449!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30468 invoked from network); 25 Jun 2014 22:45:48 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45: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 1Wzvwp-0001K5-OE
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:47 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwp-0001b4-MP
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:47 +0000
Date: Wed, 25 Jun 2014 22:45:47 +0000
Message-Id: <E1Wzvwp-0001b4-MP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/EFI: allow FPU/XMM use in
	runtime service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3ed5db85b82cb67e669fdddffa205187a6343a9c
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:42:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:42:49 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: e0fe297dabc96d8161d568f19a99722c4739b9f9
    master date: 2014-06-18 15:53:27 +0200
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index d7c884b..166852d 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -45,8 +47,14 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -82,6 +90,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index bd72138..a372e0b 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -266,10 +266,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -284,9 +284,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 1f5fe50..fd268a9 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvx3-0003V9-DQ; Wed, 25 Jun 2014 22:46:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvx2-0003Ut-Ay
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:00 +0000
Received: from [85.158.139.211:13640] by server-13.bemta-5.messagelabs.com id
	5F/2E-02995-7215BA35; Wed, 25 Jun 2014 22:45:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403736358!12039969!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32725 invoked from network); 25 Jun 2014 22:45:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwz-0001KB-TL
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwz-0001bQ-Ra
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:57 +0000
Date: Wed, 25 Jun 2014 22:45:57 +0000
Message-Id: <E1Wzvwz-0001bQ-Ra@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d/qinval: make local variable
	used for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5d7d7a6dc79f618f7f8baabe4561c40a0820650
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:43:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:43:31 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
    master date: 2014-06-20 10:25:33 +0200
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index ef5de99..fe29e82 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:01 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1Wzvx3-0003V9-DQ; Wed, 25 Jun 2014 22:46:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvx2-0003Ut-Ay
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:00 +0000
Received: from [85.158.139.211:13640] by server-13.bemta-5.messagelabs.com id
	5F/2E-02995-7215BA35; Wed, 25 Jun 2014 22:45:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1403736358!12039969!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32725 invoked from network); 25 Jun 2014 22:45:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:45:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwz-0001KB-TL
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:57 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1Wzvwz-0001bQ-Ra
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:45:57 +0000
Date: Wed, 25 Jun 2014 22:45:57 +0000
Message-Id: <E1Wzvwz-0001bQ-Ra@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] VT-d/qinval: make local variable
	used for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit a5d7d7a6dc79f618f7f8baabe4561c40a0820650
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:43:31 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:43:31 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
    master date: 2014-06-20 10:25:33 +0200
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index ef5de99..fe29e82 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvxE-0003X7-GL; Wed, 25 Jun 2014 22:46:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxC-0003Wi-JS
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:10 +0000
Received: from [85.158.139.211:47666] by server-12.bemta-5.messagelabs.com id
	C1/4E-27841-1315BA35; Wed, 25 Jun 2014 22:46:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403736368!8675094!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29285 invoked from network); 25 Jun 2014 22:46:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:46:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxA-0001Kk-2f
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxA-0001bw-0t
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:08 +0000
Date: Wed, 25 Jun 2014 22:46:08 +0000
Message-Id: <E1WzvxA-0001bw-0t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mwait_idle: fix trace output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2aa4814234ee0461768d3577d73f8869404149f5
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 24 09:44:23 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:44:23 2014 +0200

    x86/mwait_idle: fix trace output
    
    Use the C-state's type when tracing, not its index since the index is
    not set by the mwait_idle driver.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: d17ac1d5433ba2c25d7fab11baba59173e339896
    master date: 2014-06-20 10:37:21 +0200
---
 xen/arch/x86/cpu/mwait-idle.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 85179f2..65ea7b3 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -360,7 +360,7 @@ static void mwait_idle(void)
 		lapic_timer_off();
 
 	before = cpuidle_get_tick();
-	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
 
 	if (cpu_is_haltable(cpu))
 		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
@@ -369,7 +369,7 @@ static void mwait_idle(void)
 
 	cstate_restore_tsc();
 	trace_exit_reason(irq_traced);
-	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
 		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
 	update_idle_stats(power, cx, before, after);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvxE-0003X7-GL; Wed, 25 Jun 2014 22:46:12 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxC-0003Wi-JS
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:10 +0000
Received: from [85.158.139.211:47666] by server-12.bemta-5.messagelabs.com id
	C1/4E-27841-1315BA35; Wed, 25 Jun 2014 22:46:09 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403736368!8675094!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29285 invoked from network); 25 Jun 2014 22:46:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:46:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxA-0001Kk-2f
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxA-0001bw-0t
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:08 +0000
Date: Wed, 25 Jun 2014 22:46:08 +0000
Message-Id: <E1WzvxA-0001bw-0t@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/mwait_idle: fix trace output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2aa4814234ee0461768d3577d73f8869404149f5
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 24 09:44:23 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:44:23 2014 +0200

    x86/mwait_idle: fix trace output
    
    Use the C-state's type when tracing, not its index since the index is
    not set by the mwait_idle driver.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: d17ac1d5433ba2c25d7fab11baba59173e339896
    master date: 2014-06-20 10:37:21 +0200
---
 xen/arch/x86/cpu/mwait-idle.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index 85179f2..65ea7b3 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -360,7 +360,7 @@ static void mwait_idle(void)
 		lapic_timer_off();
 
 	before = cpuidle_get_tick();
-	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
 
 	if (cpu_is_haltable(cpu))
 		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
@@ -369,7 +369,7 @@ static void mwait_idle(void)
 
 	cstate_restore_tsc();
 	trace_exit_reason(irq_traced);
-	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
 		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
 	update_idle_stats(power, cx, before, after);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvxO-0003Yj-Jn; Wed, 25 Jun 2014 22:46:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxM-0003YR-Qw
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:21 +0000
Received: from [85.158.143.35:47396] by server-2.bemta-4.messagelabs.com id
	E4/CF-06539-C315BA35; Wed, 25 Jun 2014 22:46:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403736378!13897229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4274 invoked from network); 25 Jun 2014 22:46:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:46:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxK-0001Kq-8K
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxK-0001cK-6G
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:18 +0000
Date: Wed, 25 Jun 2014 22:46:18 +0000
Message-Id: <E1WzvxK-0001cK-6G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: Intel CPU family update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b9a24e04562009cc85b9657873c40ef7a03f1a4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 14:22:09 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 14:22:09 2014 +0200

    x86: Intel CPU family update
    
    ... according to revision 49 of the Intel SDM.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 3385bf3aad25082e3bc6ab0e1cbd639512983e4d
    master date: 2014-03-18 11:51:43 +0100
---
 xen/arch/x86/acpi/cpu_idle.c      |    3 +++
 xen/arch/x86/hvm/vmx/vmx.c        |    6 +++++-
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    4 ++++
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index ab86c75..6aaa7ab 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -139,6 +139,9 @@ static void do_get_hw_residencies(void *arg)
     case 0x3F:
     case 0x45:
     case 0x46:
+    /* future */
+    case 0x3D:
+    case 0x4E:
         GET_PC2_RES(hw_res->pc2);
         GET_CC7_RES(hw_res->cc7);
         /* fall through */
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index aec505a..2cd4c59 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1927,10 +1927,14 @@ static const struct lbr_info *last_branch_msr_get(void)
         case 58: case 62:
         /* Haswell */
         case 60: case 63: case 69: case 70:
+        /* future */
+        case 61: case 78:
             return nh_lbr;
             break;
         /* Atom */
-        case 28:
+        case 28: case 38: case 39: case 53: case 54:
+        /* Silvermont */
+        case 55: case 74: case 77: case 90: case 93:
             return at_lbr;
             break;
         }
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index ee26362..f6e8ec0 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -916,6 +916,10 @@ int vmx_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
         case 0x3f:
         case 0x45:
         case 0x46:
+
+        /* future: */
+        case 0x3d:
+        case 0x4e:
             ret = core2_vpmu_initialise(v, vpmu_flags);
             if ( !ret )
                 vpmu->arch_vpmu_ops = &core2_vpmu_ops;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:22 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvxO-0003Yj-Jn; Wed, 25 Jun 2014 22:46:22 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxM-0003YR-Qw
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:21 +0000
Received: from [85.158.143.35:47396] by server-2.bemta-4.messagelabs.com id
	E4/CF-06539-C315BA35; Wed, 25 Jun 2014 22:46:20 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-9.tower-21.messagelabs.com!1403736378!13897229!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4274 invoked from network); 25 Jun 2014 22:46:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	25 Jun 2014 22:46:19 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxK-0001Kq-8K
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxK-0001cK-6G
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:18 +0000
Date: Wed, 25 Jun 2014 22:46:18 +0000
Message-Id: <E1WzvxK-0001cK-6G@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86: Intel CPU family update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8b9a24e04562009cc85b9657873c40ef7a03f1a4
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 14:22:09 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 14:22:09 2014 +0200

    x86: Intel CPU family update
    
    ... according to revision 49 of the Intel SDM.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    master commit: 3385bf3aad25082e3bc6ab0e1cbd639512983e4d
    master date: 2014-03-18 11:51:43 +0100
---
 xen/arch/x86/acpi/cpu_idle.c      |    3 +++
 xen/arch/x86/hvm/vmx/vmx.c        |    6 +++++-
 xen/arch/x86/hvm/vmx/vpmu_core2.c |    4 ++++
 3 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c
index ab86c75..6aaa7ab 100644
--- a/xen/arch/x86/acpi/cpu_idle.c
+++ b/xen/arch/x86/acpi/cpu_idle.c
@@ -139,6 +139,9 @@ static void do_get_hw_residencies(void *arg)
     case 0x3F:
     case 0x45:
     case 0x46:
+    /* future */
+    case 0x3D:
+    case 0x4E:
         GET_PC2_RES(hw_res->pc2);
         GET_CC7_RES(hw_res->cc7);
         /* fall through */
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index aec505a..2cd4c59 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -1927,10 +1927,14 @@ static const struct lbr_info *last_branch_msr_get(void)
         case 58: case 62:
         /* Haswell */
         case 60: case 63: case 69: case 70:
+        /* future */
+        case 61: case 78:
             return nh_lbr;
             break;
         /* Atom */
-        case 28:
+        case 28: case 38: case 39: case 53: case 54:
+        /* Silvermont */
+        case 55: case 74: case 77: case 90: case 93:
             return at_lbr;
             break;
         }
diff --git a/xen/arch/x86/hvm/vmx/vpmu_core2.c b/xen/arch/x86/hvm/vmx/vpmu_core2.c
index ee26362..f6e8ec0 100644
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c
@@ -916,6 +916,10 @@ int vmx_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
         case 0x3f:
         case 0x45:
         case 0x46:
+
+        /* future: */
+        case 0x3d:
+        case 0x4e:
             ret = core2_vpmu_initialise(v, vpmu_flags);
             if ( !ret )
                 vpmu->arch_vpmu_ops = &core2_vpmu_ops;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvxY-0003aU-N2; Wed, 25 Jun 2014 22:46:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxW-0003a8-SW
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:31 +0000
Received: from [193.109.254.147:2129] by server-3.bemta-14.messagelabs.com id
	C1/22-22179-6415BA35; Wed, 25 Jun 2014 22:46:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403736388!13717251!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3951 invoked from network); 25 Jun 2014 22:46:29 -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;
	25 Jun 2014 22:46:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxU-0001Kw-F8
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxU-0001dC-BQ
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:28 +0000
Date: Wed, 25 Jun 2014 22:46:28 +0000
Message-Id: <E1WzvxU-0001dC-BQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/nmi: be less verbose when
	testing the NMI watchdog
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31c491171f57e816c59d6cf5f6dc0c467c416c5d
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Jun 24 14:22:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 14:22:54 2014 +0200

    x86/nmi: be less verbose when testing the NMI watchdog
    
    There's no need to print all the CPUs that are ok, only the ones that
    got stuck.
    
    The resulting output is either:
    
      Testing NMI watchdog on all CPUs: 1 4 6 stuck
    
    or
    
      Testing NMI watchdog on all CPUs: ok
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: f64b1901564b6206dbbe946699619fcd22446de8
    master date: 2014-05-15 15:32:36 +0200
---
 xen/arch/x86/nmi.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index c67a9c3..7aaab8a 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -118,11 +118,12 @@ int __init check_nmi_watchdog (void)
 {
     static unsigned int __initdata prev_nmi_count[NR_CPUS];
     int cpu;
-    
+    bool_t ok = 1;
+
     if ( !nmi_watchdog )
         return 0;
 
-    printk("Testing NMI watchdog --- ");
+    printk("Testing NMI watchdog on all CPUs:");
 
     for_each_online_cpu ( cpu )
         prev_nmi_count[cpu] = nmi_count(cpu);
@@ -137,12 +138,13 @@ int __init check_nmi_watchdog (void)
     for_each_online_cpu ( cpu )
     {
         if ( nmi_count(cpu) - prev_nmi_count[cpu] <= 5 )
-            printk("CPU#%d stuck. ", cpu);
-        else
-            printk("CPU#%d okay. ", cpu);
+        {
+            printk(" %d", cpu);
+            ok = 0;
+        }
     }
 
-    printk("\n");
+    printk(" %s\n", ok ? "ok" : "stuck");
 
     /*
      * Now that we know it works we can reduce NMI frequency to
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Wed Jun 25 22:46:32 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 25 Jun 2014 22:46:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1WzvxY-0003aU-N2; Wed, 25 Jun 2014 22:46:32 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxW-0003a8-SW
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:31 +0000
Received: from [193.109.254.147:2129] by server-3.bemta-14.messagelabs.com id
	C1/22-22179-6415BA35; Wed, 25 Jun 2014 22:46:30 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403736388!13717251!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3951 invoked from network); 25 Jun 2014 22:46:29 -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;
	25 Jun 2014 22:46:29 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxU-0001Kw-F8
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1WzvxU-0001dC-BQ
	for xen-changelog@lists.xensource.com; Wed, 25 Jun 2014 22:46:28 +0000
Date: Wed, 25 Jun 2014 22:46:28 +0000
Message-Id: <E1WzvxU-0001dC-BQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] x86/nmi: be less verbose when
	testing the NMI watchdog
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 31c491171f57e816c59d6cf5f6dc0c467c416c5d
Author:     David Vrabel <david.vrabel@citrix.com>
AuthorDate: Tue Jun 24 14:22:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 14:22:54 2014 +0200

    x86/nmi: be less verbose when testing the NMI watchdog
    
    There's no need to print all the CPUs that are ok, only the ones that
    got stuck.
    
    The resulting output is either:
    
      Testing NMI watchdog on all CPUs: 1 4 6 stuck
    
    or
    
      Testing NMI watchdog on all CPUs: ok
    
    Signed-off-by: David Vrabel <david.vrabel@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Tim Deegan <tim@xen.org>
    master commit: f64b1901564b6206dbbe946699619fcd22446de8
    master date: 2014-05-15 15:32:36 +0200
---
 xen/arch/x86/nmi.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/nmi.c b/xen/arch/x86/nmi.c
index c67a9c3..7aaab8a 100644
--- a/xen/arch/x86/nmi.c
+++ b/xen/arch/x86/nmi.c
@@ -118,11 +118,12 @@ int __init check_nmi_watchdog (void)
 {
     static unsigned int __initdata prev_nmi_count[NR_CPUS];
     int cpu;
-    
+    bool_t ok = 1;
+
     if ( !nmi_watchdog )
         return 0;
 
-    printk("Testing NMI watchdog --- ");
+    printk("Testing NMI watchdog on all CPUs:");
 
     for_each_online_cpu ( cpu )
         prev_nmi_count[cpu] = nmi_count(cpu);
@@ -137,12 +138,13 @@ int __init check_nmi_watchdog (void)
     for_each_online_cpu ( cpu )
     {
         if ( nmi_count(cpu) - prev_nmi_count[cpu] <= 5 )
-            printk("CPU#%d stuck. ", cpu);
-        else
-            printk("CPU#%d okay. ", cpu);
+        {
+            printk(" %d", cpu);
+            ok = 0;
+        }
     }
 
-    printk("\n");
+    printk(" %s\n", ok ? "ok" : "stuck");
 
     /*
      * Now that we know it works we can reduce NMI frequency to
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07A3-0000ov-MC; Thu, 26 Jun 2014 10:44:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07A2-0000oj-UK
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:11 +0000
Received: from [193.109.254.147:52812] by server-8.bemta-14.messagelabs.com id
	BD/D1-01877-A79FBA35; Thu, 26 Jun 2014 10:44:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403779445!13843055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23673 invoked from network); 26 Jun 2014 10:44:06 -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;
	26 Jun 2014 10:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X079v-0007RK-CY
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X079v-0006v5-7F
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:03 +0000
Date: Thu, 26 Jun 2014 10:44:03 +0000
Message-Id: <E1X079v-0006v5-7F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mem_access: Add helper API to setup
	ring and enable mem_access
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ae2df93c277b4093b3e54c9606387d1ba6d10fe
Author:     Aravindh Puthiyaparambil <aravindp@cisco.com>
AuthorDate: Tue May 20 16:35:44 2014 -0700
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 11:31:52 2014 +0100

    mem_access: Add helper API to setup ring and enable mem_access
    
    tools/libxc: Add helper function to setup ring for mem events
    This patch adds a helper function that maps the ring, enables mem_event
    and removes the ring from the guest physmap while the domain is paused.
    This can be used by all mem_events but is only enabled for mem_access at
    the moment.
    
    tests/xen-access: Use helper API to setup ring and enable mem_access
    Prior to this patch, xen-access was setting up the ring page in a way
    that would give a malicous guest a window to write in to the shared ring
    page. This patch fixes this by using the helper API that does it safely
    on behalf of xen-access.
    
    This is XSA-99.
    
    Signed-off-by: Aravindh Puthiyaparambil <aravindp@cisco.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_mem_access.c         |   14 +----
 tools/libxc/xc_mem_event.c          |  115 +++++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h               |   14 ++++-
 tools/tests/xen-access/xen-access.c |   48 ++------------
 4 files changed, 137 insertions(+), 54 deletions(-)

diff --git a/tools/libxc/xc_mem_access.c b/tools/libxc/xc_mem_access.c
index f436e69..461f0e9 100644
--- a/tools/libxc/xc_mem_access.c
+++ b/tools/libxc/xc_mem_access.c
@@ -24,19 +24,9 @@
 #include "xc_private.h"
 #include <xen/memory.h>
 
-int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port)
+void *xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port)
 {
-    if ( !port )
-    {
-        errno = EINVAL;
-        return -1;
-    }
-
-    return xc_mem_event_control(xch, domain_id,
-                                XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE,
-                                XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                port);
+    return xc_mem_event_enable(xch, domain_id, HVM_PARAM_ACCESS_RING_PFN, port);
 }
 
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
diff --git a/tools/libxc/xc_mem_event.c b/tools/libxc/xc_mem_event.c
index d43a0af..be7c63d 100644
--- a/tools/libxc/xc_mem_event.c
+++ b/tools/libxc/xc_mem_event.c
@@ -56,3 +56,118 @@ int xc_mem_event_memop(xc_interface *xch, domid_t domain_id,
     return do_memory_op(xch, mode, &meo, sizeof(meo));
 }
 
+void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
+                          uint32_t *port)
+{
+    void *ring_page = NULL;
+    unsigned long ring_pfn, mmap_pfn;
+    unsigned int op, mode;
+    int rc1, rc2, saved_errno;
+
+    if ( !port )
+    {
+        errno = EINVAL;
+        return NULL;
+    }
+
+    /* Pause the domain for ring page setup */
+    rc1 = xc_domain_pause(xch, domain_id);
+    if ( rc1 != 0 )
+    {
+        PERROR("Unable to pause domain\n");
+        return NULL;
+    }
+
+    /* Get the pfn of the ring page */
+    rc1 = xc_get_hvm_param(xch, domain_id, param, &ring_pfn);
+    if ( rc1 != 0 )
+    {
+        PERROR("Failed to get pfn of ring page\n");
+        goto out;
+    }
+
+    mmap_pfn = ring_pfn;
+    ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+                                     &mmap_pfn, 1);
+    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+    {
+        /* Map failed, populate ring page */
+        rc1 = xc_domain_populate_physmap_exact(xch, domain_id, 1, 0, 0,
+                                              &ring_pfn);
+        if ( rc1 != 0 )
+        {
+            PERROR("Failed to populate ring pfn\n");
+            goto out;
+        }
+
+        mmap_pfn = ring_pfn;
+        ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+                                         &mmap_pfn, 1);
+        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        {
+            PERROR("Could not map the ring page\n");
+            goto out;
+        }
+    }
+
+    switch ( param )
+    {
+    case HVM_PARAM_PAGING_RING_PFN:
+        op = XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE;
+        mode = XEN_DOMCTL_MEM_EVENT_OP_PAGING;
+        break;
+
+    case HVM_PARAM_ACCESS_RING_PFN:
+        op = XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE;
+        mode = XEN_DOMCTL_MEM_EVENT_OP_ACCESS;
+        break;
+
+    case HVM_PARAM_SHARING_RING_PFN:
+        op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE;
+        mode = XEN_DOMCTL_MEM_EVENT_OP_SHARING;
+        break;
+
+    /*
+     * This is for the outside chance that the HVM_PARAM is valid but is invalid
+     * as far as mem_event goes.
+     */
+    default:
+        errno = EINVAL;
+        rc1 = -1;
+        goto out;
+    }
+
+    rc1 = xc_mem_event_control(xch, domain_id, op, mode, port);
+    if ( rc1 != 0 )
+    {
+        PERROR("Failed to enable mem_event\n");
+        goto out;
+    }
+
+    /* Remove the ring_pfn from the guest's physmap */
+    rc1 = xc_domain_decrease_reservation_exact(xch, domain_id, 1, 0, &ring_pfn);
+    if ( rc1 != 0 )
+        PERROR("Failed to remove ring page from guest physmap");
+
+ out:
+    saved_errno = errno;
+
+    rc2 = xc_domain_unpause(xch, domain_id);
+    if ( rc1 != 0 || rc2 != 0 )
+    {
+        if ( rc2 != 0 )
+        {
+            if ( rc1 == 0 )
+                saved_errno = errno;
+            PERROR("Unable to unpause domain");
+        }
+
+        if ( ring_page )
+            munmap(ring_page, XC_PAGE_SIZE);
+        ring_page = NULL;
+
+        errno = saved_errno;
+    }
+
+    return ring_page;
+}
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index b55d857..af6f249 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -2190,6 +2190,12 @@ int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
                         unsigned int op, unsigned int mode,
                         uint64_t gfn, void *buffer);
+/*
+ * Enables mem_event and returns the mapped ring page indicated by param.
+ * param can be HVM_PARAM_PAGING/ACCESS/SHARING_RING_PFN
+ */
+void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
+                          uint32_t *port);
 
 /** 
  * Mem paging operations.
@@ -2210,7 +2216,13 @@ int xc_mem_paging_load(xc_interface *xch, domid_t domain_id,
  * Access tracking operations.
  * Supported only on Intel EPT 64 bit processors.
  */
-int xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
+
+/*
+ * Enables mem_access and returns the mapped ring page.
+ * Will return NULL on error.
+ * Caller has to unmap this page when done.
+ */
+void *xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id);
 
diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index 0a84bd5..572ab63 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -223,7 +223,6 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
     xenaccess_t *xenaccess = 0;
     xc_interface *xch;
     int rc;
-    unsigned long ring_pfn, mmap_pfn;
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( !xch )
@@ -245,40 +244,12 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
     /* Initialise lock */
     mem_event_ring_lock_init(&xenaccess->mem_event);
 
-    /* Map the ring page */
-    xc_get_hvm_param(xch, xenaccess->mem_event.domain_id, 
-                        HVM_PARAM_ACCESS_RING_PFN, &ring_pfn);
-    mmap_pfn = ring_pfn;
-    xenaccess->mem_event.ring_page = 
-        xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
-                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
-    {
-        /* Map failed, populate ring page */
-        rc = xc_domain_populate_physmap_exact(xenaccess->xc_handle, 
-                                              xenaccess->mem_event.domain_id,
-                                              1, 0, 0, &ring_pfn);
-        if ( rc != 0 )
-        {
-            PERROR("Failed to populate ring gfn\n");
-            goto err;
-        }
-
-        mmap_pfn = ring_pfn;
-        xenaccess->mem_event.ring_page = 
-            xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
-                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
-        {
-            PERROR("Could not map the ring page\n");
-            goto err;
-        }
-    }
-
-    /* Initialise Xen */
-    rc = xc_mem_access_enable(xenaccess->xc_handle, xenaccess->mem_event.domain_id,
-                             &xenaccess->mem_event.evtchn_port);
-    if ( rc != 0 )
+    /* Enable mem_access */
+    xenaccess->mem_event.ring_page =
+            xc_mem_access_enable(xenaccess->xc_handle,
+                                 xenaccess->mem_event.domain_id,
+                                 &xenaccess->mem_event.evtchn_port);
+    if ( xenaccess->mem_event.ring_page == NULL )
     {
         switch ( errno ) {
             case EBUSY:
@@ -288,7 +259,7 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
                 ERROR("EPT not supported for this guest");
                 break;
             default:
-                perror("Error initialising shared page");
+                perror("Error enabling mem_access");
                 break;
         }
         goto err;
@@ -322,11 +293,6 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
                    (mem_event_sring_t *)xenaccess->mem_event.ring_page,
                    XC_PAGE_SIZE);
 
-    /* Now that the ring is set, remove it from the guest's physmap */
-    if ( xc_domain_decrease_reservation_exact(xch, 
-                    xenaccess->mem_event.domain_id, 1, 0, &ring_pfn) )
-        PERROR("Failed to remove ring from guest physmap");
-
     /* Get domaininfo */
     xenaccess->domain_info = malloc(sizeof(xc_domaininfo_t));
     if ( xenaccess->domain_info == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:14 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:14 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07A3-0000ov-MC; Thu, 26 Jun 2014 10:44:11 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07A2-0000oj-UK
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:11 +0000
Received: from [193.109.254.147:52812] by server-8.bemta-14.messagelabs.com id
	BD/D1-01877-A79FBA35; Thu, 26 Jun 2014 10:44:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-27.messagelabs.com!1403779445!13843055!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23673 invoked from network); 26 Jun 2014 10:44:06 -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;
	26 Jun 2014 10:44:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X079v-0007RK-CY
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X079v-0006v5-7F
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:03 +0000
Date: Thu, 26 Jun 2014 10:44:03 +0000
Message-Id: <E1X079v-0006v5-7F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] mem_access: Add helper API to setup
	ring and enable mem_access
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 6ae2df93c277b4093b3e54c9606387d1ba6d10fe
Author:     Aravindh Puthiyaparambil <aravindp@cisco.com>
AuthorDate: Tue May 20 16:35:44 2014 -0700
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 11:31:52 2014 +0100

    mem_access: Add helper API to setup ring and enable mem_access
    
    tools/libxc: Add helper function to setup ring for mem events
    This patch adds a helper function that maps the ring, enables mem_event
    and removes the ring from the guest physmap while the domain is paused.
    This can be used by all mem_events but is only enabled for mem_access at
    the moment.
    
    tests/xen-access: Use helper API to setup ring and enable mem_access
    Prior to this patch, xen-access was setting up the ring page in a way
    that would give a malicous guest a window to write in to the shared ring
    page. This patch fixes this by using the helper API that does it safely
    on behalf of xen-access.
    
    This is XSA-99.
    
    Signed-off-by: Aravindh Puthiyaparambil <aravindp@cisco.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
 tools/libxc/xc_mem_access.c         |   14 +----
 tools/libxc/xc_mem_event.c          |  115 +++++++++++++++++++++++++++++++++++
 tools/libxc/xenctrl.h               |   14 ++++-
 tools/tests/xen-access/xen-access.c |   48 ++------------
 4 files changed, 137 insertions(+), 54 deletions(-)

diff --git a/tools/libxc/xc_mem_access.c b/tools/libxc/xc_mem_access.c
index f436e69..461f0e9 100644
--- a/tools/libxc/xc_mem_access.c
+++ b/tools/libxc/xc_mem_access.c
@@ -24,19 +24,9 @@
 #include "xc_private.h"
 #include <xen/memory.h>
 
-int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port)
+void *xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port)
 {
-    if ( !port )
-    {
-        errno = EINVAL;
-        return -1;
-    }
-
-    return xc_mem_event_control(xch, domain_id,
-                                XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE,
-                                XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                port);
+    return xc_mem_event_enable(xch, domain_id, HVM_PARAM_ACCESS_RING_PFN, port);
 }
 
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
diff --git a/tools/libxc/xc_mem_event.c b/tools/libxc/xc_mem_event.c
index d43a0af..be7c63d 100644
--- a/tools/libxc/xc_mem_event.c
+++ b/tools/libxc/xc_mem_event.c
@@ -56,3 +56,118 @@ int xc_mem_event_memop(xc_interface *xch, domid_t domain_id,
     return do_memory_op(xch, mode, &meo, sizeof(meo));
 }
 
+void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
+                          uint32_t *port)
+{
+    void *ring_page = NULL;
+    unsigned long ring_pfn, mmap_pfn;
+    unsigned int op, mode;
+    int rc1, rc2, saved_errno;
+
+    if ( !port )
+    {
+        errno = EINVAL;
+        return NULL;
+    }
+
+    /* Pause the domain for ring page setup */
+    rc1 = xc_domain_pause(xch, domain_id);
+    if ( rc1 != 0 )
+    {
+        PERROR("Unable to pause domain\n");
+        return NULL;
+    }
+
+    /* Get the pfn of the ring page */
+    rc1 = xc_get_hvm_param(xch, domain_id, param, &ring_pfn);
+    if ( rc1 != 0 )
+    {
+        PERROR("Failed to get pfn of ring page\n");
+        goto out;
+    }
+
+    mmap_pfn = ring_pfn;
+    ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+                                     &mmap_pfn, 1);
+    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+    {
+        /* Map failed, populate ring page */
+        rc1 = xc_domain_populate_physmap_exact(xch, domain_id, 1, 0, 0,
+                                              &ring_pfn);
+        if ( rc1 != 0 )
+        {
+            PERROR("Failed to populate ring pfn\n");
+            goto out;
+        }
+
+        mmap_pfn = ring_pfn;
+        ring_page = xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
+                                         &mmap_pfn, 1);
+        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        {
+            PERROR("Could not map the ring page\n");
+            goto out;
+        }
+    }
+
+    switch ( param )
+    {
+    case HVM_PARAM_PAGING_RING_PFN:
+        op = XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE;
+        mode = XEN_DOMCTL_MEM_EVENT_OP_PAGING;
+        break;
+
+    case HVM_PARAM_ACCESS_RING_PFN:
+        op = XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE;
+        mode = XEN_DOMCTL_MEM_EVENT_OP_ACCESS;
+        break;
+
+    case HVM_PARAM_SHARING_RING_PFN:
+        op = XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE;
+        mode = XEN_DOMCTL_MEM_EVENT_OP_SHARING;
+        break;
+
+    /*
+     * This is for the outside chance that the HVM_PARAM is valid but is invalid
+     * as far as mem_event goes.
+     */
+    default:
+        errno = EINVAL;
+        rc1 = -1;
+        goto out;
+    }
+
+    rc1 = xc_mem_event_control(xch, domain_id, op, mode, port);
+    if ( rc1 != 0 )
+    {
+        PERROR("Failed to enable mem_event\n");
+        goto out;
+    }
+
+    /* Remove the ring_pfn from the guest's physmap */
+    rc1 = xc_domain_decrease_reservation_exact(xch, domain_id, 1, 0, &ring_pfn);
+    if ( rc1 != 0 )
+        PERROR("Failed to remove ring page from guest physmap");
+
+ out:
+    saved_errno = errno;
+
+    rc2 = xc_domain_unpause(xch, domain_id);
+    if ( rc1 != 0 || rc2 != 0 )
+    {
+        if ( rc2 != 0 )
+        {
+            if ( rc1 == 0 )
+                saved_errno = errno;
+            PERROR("Unable to unpause domain");
+        }
+
+        if ( ring_page )
+            munmap(ring_page, XC_PAGE_SIZE);
+        ring_page = NULL;
+
+        errno = saved_errno;
+    }
+
+    return ring_page;
+}
diff --git a/tools/libxc/xenctrl.h b/tools/libxc/xenctrl.h
index b55d857..af6f249 100644
--- a/tools/libxc/xenctrl.h
+++ b/tools/libxc/xenctrl.h
@@ -2190,6 +2190,12 @@ int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
                         unsigned int op, unsigned int mode,
                         uint64_t gfn, void *buffer);
+/*
+ * Enables mem_event and returns the mapped ring page indicated by param.
+ * param can be HVM_PARAM_PAGING/ACCESS/SHARING_RING_PFN
+ */
+void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
+                          uint32_t *port);
 
 /** 
  * Mem paging operations.
@@ -2210,7 +2216,13 @@ int xc_mem_paging_load(xc_interface *xch, domid_t domain_id,
  * Access tracking operations.
  * Supported only on Intel EPT 64 bit processors.
  */
-int xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
+
+/*
+ * Enables mem_access and returns the mapped ring page.
+ * Will return NULL on error.
+ * Caller has to unmap this page when done.
+ */
+void *xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id);
 
diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
index 0a84bd5..572ab63 100644
--- a/tools/tests/xen-access/xen-access.c
+++ b/tools/tests/xen-access/xen-access.c
@@ -223,7 +223,6 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
     xenaccess_t *xenaccess = 0;
     xc_interface *xch;
     int rc;
-    unsigned long ring_pfn, mmap_pfn;
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( !xch )
@@ -245,40 +244,12 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
     /* Initialise lock */
     mem_event_ring_lock_init(&xenaccess->mem_event);
 
-    /* Map the ring page */
-    xc_get_hvm_param(xch, xenaccess->mem_event.domain_id, 
-                        HVM_PARAM_ACCESS_RING_PFN, &ring_pfn);
-    mmap_pfn = ring_pfn;
-    xenaccess->mem_event.ring_page = 
-        xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
-                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
-    {
-        /* Map failed, populate ring page */
-        rc = xc_domain_populate_physmap_exact(xenaccess->xc_handle, 
-                                              xenaccess->mem_event.domain_id,
-                                              1, 0, 0, &ring_pfn);
-        if ( rc != 0 )
-        {
-            PERROR("Failed to populate ring gfn\n");
-            goto err;
-        }
-
-        mmap_pfn = ring_pfn;
-        xenaccess->mem_event.ring_page = 
-            xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
-                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
-        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
-        {
-            PERROR("Could not map the ring page\n");
-            goto err;
-        }
-    }
-
-    /* Initialise Xen */
-    rc = xc_mem_access_enable(xenaccess->xc_handle, xenaccess->mem_event.domain_id,
-                             &xenaccess->mem_event.evtchn_port);
-    if ( rc != 0 )
+    /* Enable mem_access */
+    xenaccess->mem_event.ring_page =
+            xc_mem_access_enable(xenaccess->xc_handle,
+                                 xenaccess->mem_event.domain_id,
+                                 &xenaccess->mem_event.evtchn_port);
+    if ( xenaccess->mem_event.ring_page == NULL )
     {
         switch ( errno ) {
             case EBUSY:
@@ -288,7 +259,7 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
                 ERROR("EPT not supported for this guest");
                 break;
             default:
-                perror("Error initialising shared page");
+                perror("Error enabling mem_access");
                 break;
         }
         goto err;
@@ -322,11 +293,6 @@ xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
                    (mem_event_sring_t *)xenaccess->mem_event.ring_page,
                    XC_PAGE_SIZE);
 
-    /* Now that the ring is set, remove it from the guest's physmap */
-    if ( xc_domain_decrease_reservation_exact(xch, 
-                    xenaccess->mem_event.domain_id, 1, 0, &ring_pfn) )
-        PERROR("Failed to remove ring from guest physmap");
-
     /* Get domaininfo */
     xenaccess->domain_info = malloc(sizeof(xc_domaininfo_t));
     if ( xenaccess->domain_info == NULL )
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07AB-0000qV-Qc; Thu, 26 Jun 2014 10:44:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AA-0000q7-F7
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:18 +0000
Content-Length: 2545
Received: from [85.158.137.68:40694] by server-6.bemta-3.messagelabs.com id
	E3/F6-15862-189FBA35; Thu, 26 Jun 2014 10:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1403779455!12370489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22469 invoked from network); 26 Jun 2014 10:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07A7-0007RN-Np
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07A7-0006vR-FW
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:15 +0000
Date: Thu, 26 Jun 2014 10:44:15 +0000
Message-Id: <E1X07A7-0006vR-FW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Fix xc_mem_event.c compilation
	for ARM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7903958088366874779=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7903958088366874779==
Content-Length: 2149
Content-Transfer-Encoding: quoted-printable

commit 2db272746c6fe3ee66d63bc3df2721b03046d4ae
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jun 23 14:27:58 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 16:03:40 2014 +0100

    libxc: Fix xc_mem_event.c compilation for ARM
    
    The commit 6ae2df9 "mem_access: Add helper API to setup ring and enable
    mem_access=C2=A8 break libxc compilation for ARM.
    
    This is because xc_map_foreign_map and xc_domain_decrease_reservation_exact
    is taking an xen_pfn_t in parameters. On ARM, xen_pfn_t is always an uin64_t.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Cc: Aravindh Puthiyaparambil <aravindp@cisco.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_mem_event.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_mem_event.c b/tools/libxc/xc_mem_event.c
index be7c63d..0b2eecb 100644
--- a/tools/libxc/xc_mem_event.c
+++ b/tools/libxc/xc_mem_event.c
@@ -60,7 +60,8 @@ void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
                           uint32_t *port)
 {
     void *ring_page =3D NULL;
-    unsigned long ring_pfn, mmap_pfn;
+    unsigned long pfn;
+    xen_pfn_t ring_pfn, mmap_pfn;
     unsigned int op, mode;
     int rc1, rc2, saved_errno;
 
@@ -79,14 +80,15 @@ void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
     }
 
     /* Get the pfn of the ring page */
-    rc1 =3D xc_get_hvm_param(xch, domain_id, param, &ring_pfn);
+    rc1 =3D xc_get_hvm_param(xch, domain_id, param, &pfn);
     if ( rc1 !=3D 0 )
     {
         PERROR("Failed to get pfn of ring page\n");
         goto out;
     }
 
-    mmap_pfn =3D ring_pfn;
+    ring_pfn =3D pfn;
+    mmap_pfn =3D pfn;
     ring_page =3D xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
                                      &mmap_pfn, 1);
     if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:19 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07AB-0000qV-Qc; Thu, 26 Jun 2014 10:44:19 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AA-0000q7-F7
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:18 +0000
Content-Length: 2545
Received: from [85.158.137.68:40694] by server-6.bemta-3.messagelabs.com id
	E3/F6-15862-189FBA35; Thu, 26 Jun 2014 10:44:17 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-31.messagelabs.com!1403779455!12370489!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22469 invoked from network); 26 Jun 2014 10:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07A7-0007RN-Np
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07A7-0006vR-FW
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:15 +0000
Date: Thu, 26 Jun 2014 10:44:15 +0000
Message-Id: <E1X07A7-0006vR-FW@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxc: Fix xc_mem_event.c compilation
	for ARM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7903958088366874779=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7903958088366874779==
Content-Length: 2149
Content-Transfer-Encoding: quoted-printable

commit 2db272746c6fe3ee66d63bc3df2721b03046d4ae
Author:     Julien Grall <julien.grall@linaro.org>
AuthorDate: Mon Jun 23 14:27:58 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 16:03:40 2014 +0100

    libxc: Fix xc_mem_event.c compilation for ARM
    
    The commit 6ae2df9 "mem_access: Add helper API to setup ring and enable
    mem_access=C2=A8 break libxc compilation for ARM.
    
    This is because xc_map_foreign_map and xc_domain_decrease_reservation_exact
    is taking an xen_pfn_t in parameters. On ARM, xen_pfn_t is always an uin64_t.
    
    Signed-off-by: Julien Grall <julien.grall@linaro.org>
    Cc: Aravindh Puthiyaparambil <aravindp@cisco.com>
    Cc: Jan Beulich <jbeulich@suse.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxc/xc_mem_event.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/tools/libxc/xc_mem_event.c b/tools/libxc/xc_mem_event.c
index be7c63d..0b2eecb 100644
--- a/tools/libxc/xc_mem_event.c
+++ b/tools/libxc/xc_mem_event.c
@@ -60,7 +60,8 @@ void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
                           uint32_t *port)
 {
     void *ring_page =3D NULL;
-    unsigned long ring_pfn, mmap_pfn;
+    unsigned long pfn;
+    xen_pfn_t ring_pfn, mmap_pfn;
     unsigned int op, mode;
     int rc1, rc2, saved_errno;
 
@@ -79,14 +80,15 @@ void *xc_mem_event_enable(xc_interface *xch, domid_t domain_id, int param,
     }
 
     /* Get the pfn of the ring page */
-    rc1 =3D xc_get_hvm_param(xch, domain_id, param, &ring_pfn);
+    rc1 =3D xc_get_hvm_param(xch, domain_id, param, &pfn);
     if ( rc1 !=3D 0 )
     {
         PERROR("Failed to get pfn of ring page\n");
         goto out;
     }
 
-    mmap_pfn =3D ring_pfn;
+    ring_pfn =3D pfn;
+    mmap_pfn =3D pfn;
     ring_page =3D xc_map_foreign_batch(xch, domain_id, PROT_READ | PROT_WRITE,
                                      &mmap_pfn, 1);
     if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
--
generated by git-patchbot for /home/xen/git/xen.git#master


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07AL-0000sg-TV; Thu, 26 Jun 2014 10:44:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AK-0000sP-Nt
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:28 +0000
Received: from [85.158.143.35:63162] by server-2.bemta-4.messagelabs.com id
	B3/47-06539-C89FBA35; Thu, 26 Jun 2014 10:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403779466!14029238!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29675 invoked from network); 26 Jun 2014 10:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AI-0007RW-29
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AH-0006wX-Tv
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:25 +0000
Date: Thu, 26 Jun 2014 10:44:25 +0000
Message-Id: <E1X07AH-0006wX-Tv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Rewind toolstack_save_fd in
	libxl_save_helper when using remus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29471171f5b63ce76a011e5f7dce30ecba52f734
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jun 20 14:59:34 2014 +0800
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 17:58:54 2014 +0100

    libxl: Rewind toolstack_save_fd in libxl_save_helper when using remus
    
    Commit b327a3f421bb57d262b7d1fb3c43b710852b103b moved the rewinding of
    toolstack_save_fd to libxl.  This breaks remus, because in remus mode,
    toolstack_save_cb will be called in every checkpoint, and if we don't
    rewind it in libxl_save_helper, it will surely fail.
    
    This fix is just a hack: in fact the whole toolstack save thing should
    be done in libxl.  But for now (until migration v2) this fix should
    solve both remus and Jason Adryuk's use case.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    Tested-by: Jason Andryuk <andryuk@aero.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_save_helper.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index b259bd0..4619fa3 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -159,6 +159,7 @@ int helper_getreply(void *user)
 
 static int toolstack_save_fd;
 static uint32_t toolstack_save_len;
+static struct save_callbacks helper_save_callbacks;
 
 static int toolstack_save_cb(uint32_t domid, uint8_t **buf,
                              uint32_t *len, void *data)
@@ -167,6 +168,12 @@ static int toolstack_save_cb(uint32_t domid, uint8_t **buf,
 
     assert(toolstack_save_fd > 0);
 
+    /* This is a hack for remus */
+    if (helper_save_callbacks.checkpoint) {
+        r = lseek(toolstack_save_fd, 0, SEEK_SET);
+        if (r) fail(errno,"rewind toolstack data tmpfile");
+    }
+
     *buf = xmalloc(toolstack_save_len);
     r = read_exactly(toolstack_save_fd, *buf, toolstack_save_len);
     if (r<0) fail(errno,"read toolstack data");
@@ -191,7 +198,6 @@ static void complete(int retval) {
     exit(0);
 }
 
-static struct save_callbacks helper_save_callbacks;
 static struct restore_callbacks helper_restore_callbacks;
 
 int main(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07AL-0000sg-TV; Thu, 26 Jun 2014 10:44:29 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AK-0000sP-Nt
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:28 +0000
Received: from [85.158.143.35:63162] by server-2.bemta-4.messagelabs.com id
	B3/47-06539-C89FBA35; Thu, 26 Jun 2014 10:44:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-21.messagelabs.com!1403779466!14029238!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29675 invoked from network); 26 Jun 2014 10:44:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AI-0007RW-29
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AH-0006wX-Tv
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:25 +0000
Date: Thu, 26 Jun 2014 10:44:25 +0000
Message-Id: <E1X07AH-0006wX-Tv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] libxl: Rewind toolstack_save_fd in
	libxl_save_helper when using remus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29471171f5b63ce76a011e5f7dce30ecba52f734
Author:     Yang Hongyang <yanghy@cn.fujitsu.com>
AuthorDate: Fri Jun 20 14:59:34 2014 +0800
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 17:58:54 2014 +0100

    libxl: Rewind toolstack_save_fd in libxl_save_helper when using remus
    
    Commit b327a3f421bb57d262b7d1fb3c43b710852b103b moved the rewinding of
    toolstack_save_fd to libxl.  This breaks remus, because in remus mode,
    toolstack_save_cb will be called in every checkpoint, and if we don't
    rewind it in libxl_save_helper, it will surely fail.
    
    This fix is just a hack: in fact the whole toolstack save thing should
    be done in libxl.  But for now (until migration v2) this fix should
    solve both remus and Jason Adryuk's use case.
    
    Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com>
    Tested-by: Jason Andryuk <andryuk@aero.org>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
    Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/libxl/libxl_save_helper.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_save_helper.c b/tools/libxl/libxl_save_helper.c
index b259bd0..4619fa3 100644
--- a/tools/libxl/libxl_save_helper.c
+++ b/tools/libxl/libxl_save_helper.c
@@ -159,6 +159,7 @@ int helper_getreply(void *user)
 
 static int toolstack_save_fd;
 static uint32_t toolstack_save_len;
+static struct save_callbacks helper_save_callbacks;
 
 static int toolstack_save_cb(uint32_t domid, uint8_t **buf,
                              uint32_t *len, void *data)
@@ -167,6 +168,12 @@ static int toolstack_save_cb(uint32_t domid, uint8_t **buf,
 
     assert(toolstack_save_fd > 0);
 
+    /* This is a hack for remus */
+    if (helper_save_callbacks.checkpoint) {
+        r = lseek(toolstack_save_fd, 0, SEEK_SET);
+        if (r) fail(errno,"rewind toolstack data tmpfile");
+    }
+
     *buf = xmalloc(toolstack_save_len);
     r = read_exactly(toolstack_save_fd, *buf, toolstack_save_len);
     if (r<0) fail(errno,"read toolstack data");
@@ -191,7 +198,6 @@ static void complete(int retval) {
     exit(0);
 }
 
-static struct save_callbacks helper_save_callbacks;
 static struct restore_callbacks helper_restore_callbacks;
 
 int main(int argc, char **argv)
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07AW-0000uz-01; Thu, 26 Jun 2014 10:44:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AV-0000uk-43
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:39 +0000
Received: from [193.109.254.147:51533] by server-7.bemta-14.messagelabs.com id
	D1/FB-17726-699FBA35; Thu, 26 Jun 2014 10:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403779476!13857422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11219 invoked from network); 26 Jun 2014 10:44:37 -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;
	26 Jun 2014 10:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AS-0007Rc-7g
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AS-0006wu-5a
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:36 +0000
Date: Thu, 26 Jun 2014 10:44:36 +0000
Message-Id: <E1X07AS-0006wu-5a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blktap2: Fix two 'maybe uninitialized'
	variables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 345e44a85d71a1a910385f33c7f1ba3683026d18
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Jun 20 16:09:00 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 18:06:37 2014 +0100

    blktap2: Fix two 'maybe uninitialized' variables
    
    for which gcc 4.9.0 complains about, like this:
    
    block-qcow.c: In function `get_cluster_offset':
    block-qcow.c:431:3: error: `tmp_ptr' may be used uninitialized in this function
    [-Werror=maybe-uninitialized]
       memcpy(tmp_ptr, l1_ptr, 4096);
       ^
    block-qcow.c:606:7: error: `tmp_ptr2' may be used uninitialized in this
    function [-Werror=maybe-uninitialized]
       if (write(s->fd, tmp_ptr2, 4096) != 4096) {
           ^
    cc1: all warnings being treated as errors
    /home/dario/Sources/xen/xen/xen.git/tools/blktap2/drivers/../../../tools/Rules.mk:89:
     recipe for target 'block-qcow.o' failed
    make[5]: *** [block-qcow.o] Error 1
    
    The proper behavior is to return upon allocation failure.
    About what to return, 0 seems the best option, looking
    at both the function and the call sites.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/blktap2/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap2/drivers/block-qcow.c b/tools/blktap2/drivers/block-qcow.c
index d5053d4..b45bcaa 100644
--- a/tools/blktap2/drivers/block-qcow.c
+++ b/tools/blktap2/drivers/block-qcow.c
@@ -427,6 +427,7 @@ static uint64_t get_cluster_offset(struct tdqcow_state *s,
 
 		if (posix_memalign((void **)&tmp_ptr, 4096, 4096) != 0) {
 			DPRINTF("ERROR allocating memory for L1 table\n");
+                        return 0;
 		}
 		memcpy(tmp_ptr, l1_ptr, 4096);
 
@@ -600,6 +601,7 @@ found:
 		
 		if (posix_memalign((void **)&tmp_ptr2, 4096, 4096) != 0) {
 			DPRINTF("ERROR allocating memory for L1 table\n");
+                        return 0;
 		}
 		memcpy(tmp_ptr2, l2_ptr, 4096);
 		lseek(s->fd, l2_offset + (l2_sector << 12), SEEK_SET);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07AW-0000uz-01; Thu, 26 Jun 2014 10:44:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AV-0000uk-43
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:39 +0000
Received: from [193.109.254.147:51533] by server-7.bemta-14.messagelabs.com id
	D1/FB-17726-699FBA35; Thu, 26 Jun 2014 10:44:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-27.messagelabs.com!1403779476!13857422!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11219 invoked from network); 26 Jun 2014 10:44:37 -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;
	26 Jun 2014 10:44:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AS-0007Rc-7g
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07AS-0006wu-5a
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:36 +0000
Date: Thu, 26 Jun 2014 10:44:36 +0000
Message-Id: <E1X07AS-0006wu-5a@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] blktap2: Fix two 'maybe uninitialized'
	variables
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 345e44a85d71a1a910385f33c7f1ba3683026d18
Author:     Dario Faggioli <dario.faggioli@citrix.com>
AuthorDate: Fri Jun 20 16:09:00 2014 +0200
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 18:06:37 2014 +0100

    blktap2: Fix two 'maybe uninitialized' variables
    
    for which gcc 4.9.0 complains about, like this:
    
    block-qcow.c: In function `get_cluster_offset':
    block-qcow.c:431:3: error: `tmp_ptr' may be used uninitialized in this function
    [-Werror=maybe-uninitialized]
       memcpy(tmp_ptr, l1_ptr, 4096);
       ^
    block-qcow.c:606:7: error: `tmp_ptr2' may be used uninitialized in this
    function [-Werror=maybe-uninitialized]
       if (write(s->fd, tmp_ptr2, 4096) != 4096) {
           ^
    cc1: all warnings being treated as errors
    /home/dario/Sources/xen/xen/xen.git/tools/blktap2/drivers/../../../tools/Rules.mk:89:
     recipe for target 'block-qcow.o' failed
    make[5]: *** [block-qcow.o] Error 1
    
    The proper behavior is to return upon allocation failure.
    About what to return, 0 seems the best option, looking
    at both the function and the call sites.
    
    Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
    Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/blktap2/drivers/block-qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/blktap2/drivers/block-qcow.c b/tools/blktap2/drivers/block-qcow.c
index d5053d4..b45bcaa 100644
--- a/tools/blktap2/drivers/block-qcow.c
+++ b/tools/blktap2/drivers/block-qcow.c
@@ -427,6 +427,7 @@ static uint64_t get_cluster_offset(struct tdqcow_state *s,
 
 		if (posix_memalign((void **)&tmp_ptr, 4096, 4096) != 0) {
 			DPRINTF("ERROR allocating memory for L1 table\n");
+                        return 0;
 		}
 		memcpy(tmp_ptr, l1_ptr, 4096);
 
@@ -600,6 +601,7 @@ found:
 		
 		if (posix_memalign((void **)&tmp_ptr2, 4096, 4096) != 0) {
 			DPRINTF("ERROR allocating memory for L1 table\n");
+                        return 0;
 		}
 		memcpy(tmp_ptr2, l2_ptr, 4096);
 		lseek(s->fd, l2_offset + (l2_sector << 12), SEEK_SET);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07Ag-0000xY-2u; Thu, 26 Jun 2014 10:44:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Af-0000xK-5F
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:49 +0000
Received: from [85.158.137.68:60059] by server-9.bemta-3.messagelabs.com id
	8E/0C-09496-0A9FBA35; Thu, 26 Jun 2014 10:44:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403779486!12415503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24354 invoked from network); 26 Jun 2014 10:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Ac-0007Ri-D5
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Ac-0006xG-BF
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:46 +0000
Date: Thu, 26 Jun 2014 10:44:46 +0000
Message-Id: <E1X07Ac-0006xG-BF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Fix missing break in
	xc_domain_bind_pt_irq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c615f8dadb4389048d574abd1515861d3f8403f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 18:44:44 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 18:10:32 2014 +0100

    tools/libxc: Fix missing break in xc_domain_bind_pt_irq()
    
    c/s 568da4f8 "pt-irq fixes and improvements" accidentally forgot a break when
    refactoring xc_domain_bind_pt_irq() which results in bind->u.pci.bus being
    clobbered by isa_irq for PCI and MSI_TRANSLATE interrupts.
    
    Coverity-ID: 1223210
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxc/xc_domain.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index ef470a5..d5d6d12 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1711,6 +1711,7 @@ int xc_domain_bind_pt_irq(
         bind->u.pci.bus = bus;
         bind->u.pci.device = device;
         bind->u.pci.intx = intx;
+        break;
     case PT_IRQ_TYPE_ISA:
         bind->u.isa.isa_irq = isa_irq;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:44:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:44:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07Ag-0000xY-2u; Thu, 26 Jun 2014 10:44:50 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Af-0000xK-5F
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:49 +0000
Received: from [85.158.137.68:60059] by server-9.bemta-3.messagelabs.com id
	8E/0C-09496-0A9FBA35; Thu, 26 Jun 2014 10:44:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-7.tower-31.messagelabs.com!1403779486!12415503!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24354 invoked from network); 26 Jun 2014 10:44:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Ac-0007Ri-D5
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Ac-0006xG-BF
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:46 +0000
Date: Thu, 26 Jun 2014 10:44:46 +0000
Message-Id: <E1X07Ac-0006xG-BF@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxc: Fix missing break in
	xc_domain_bind_pt_irq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0c615f8dadb4389048d574abd1515861d3f8403f
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 18:44:44 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 18:10:32 2014 +0100

    tools/libxc: Fix missing break in xc_domain_bind_pt_irq()
    
    c/s 568da4f8 "pt-irq fixes and improvements" accidentally forgot a break when
    refactoring xc_domain_bind_pt_irq() which results in bind->u.pci.bus being
    clobbered by isa_irq for PCI and MSI_TRANSLATE interrupts.
    
    Coverity-ID: 1223210
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Jan Beulich <JBeulich@suse.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxc/xc_domain.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index ef470a5..d5d6d12 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1711,6 +1711,7 @@ int xc_domain_bind_pt_irq(
         bind->u.pci.bus = bus;
         bind->u.pci.device = device;
         bind->u.pci.intx = intx;
+        break;
     case PT_IRQ_TYPE_ISA:
         bind->u.isa.isa_irq = isa_irq;
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:45:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07Aq-0000zr-61; Thu, 26 Jun 2014 10:45:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Ap-0000zc-90
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:59 +0000
Received: from [85.158.137.68:10949] by server-16.bemta-3.messagelabs.com id
	2F/A2-28986-AA9FBA35; Thu, 26 Jun 2014 10:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1403779496!12445748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32390 invoked from network); 26 Jun 2014 10:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Am-0007Ro-IS
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Am-0006xc-Gn
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:56 +0000
Date: Thu, 26 Jun 2014 10:44:56 +0000
Message-Id: <E1X07Am-0006xc-Gn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix free() of wild
	pointer in libxl__initiate_device_remove()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddb4aa5dfa13781e8f31ba20923c14c1a083ce83
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 19:04:14 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 18:10:58 2014 +0100

    tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove()
    
    libxl__initiate_device_remove() had a preexisting error path issue where
    libxl_dominfo_dispose() could be called on a libxl_dominfo object before it
    had been initialised with libxl_dominfo_init().
    
    This was safe until c/s ab44401 added the pointer ssid_label, which point
    libxl_dominfo_dispose() free()s.
    
    Unconditionally initialise info in libxl__initiate_device_remove() before
    taking an error path which will free it.
    
    Coverity-ID: 1223212
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 90ae564..788895b 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -772,6 +772,8 @@ void libxl__initiate_device_remove(libxl__egc *egc,
     uint32_t my_domid, domid = aodev->dev->domid;
     int rc = 0;
 
+    libxl_dominfo_init(&info);
+
     rc = libxl__get_domid(gc, &my_domid);
     if (rc) {
         LOG(ERROR, "unable to get my domid");
@@ -779,7 +781,6 @@ void libxl__initiate_device_remove(libxl__egc *egc,
     }
 
     if (my_domid == LIBXL_TOOLSTACK_DOMID) {
-        libxl_dominfo_init(&info);
         rc = libxl_domain_info(CTX, &info, domid);
         if (rc) {
             LOG(ERROR, "unable to get info for domain %d", domid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 10:45:00 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 10:45:00 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X07Aq-0000zr-61; Thu, 26 Jun 2014 10:45:00 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Ap-0000zc-90
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:59 +0000
Received: from [85.158.137.68:10949] by server-16.bemta-3.messagelabs.com id
	2F/A2-28986-AA9FBA35; Thu, 26 Jun 2014 10:44:58 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-11.tower-31.messagelabs.com!1403779496!12445748!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32390 invoked from network); 26 Jun 2014 10:44:57 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 10:44:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Am-0007Ro-IS
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X07Am-0006xc-Gn
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 10:44:56 +0000
Date: Thu, 26 Jun 2014 10:44:56 +0000
Message-Id: <E1X07Am-0006xc-Gn@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen master] tools/libxl: Fix free() of wild
	pointer in libxl__initiate_device_remove()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddb4aa5dfa13781e8f31ba20923c14c1a083ce83
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Wed Jun 18 19:04:14 2014 +0100
Commit:     Ian Jackson <Ian.Jackson@eu.citrix.com>
CommitDate: Mon Jun 23 18:10:58 2014 +0100

    tools/libxl: Fix free() of wild pointer in libxl__initiate_device_remove()
    
    libxl__initiate_device_remove() had a preexisting error path issue where
    libxl_dominfo_dispose() could be called on a libxl_dominfo object before it
    had been initialised with libxl_dominfo_init().
    
    This was safe until c/s ab44401 added the pointer ssid_label, which point
    libxl_dominfo_dispose() free()s.
    
    Unconditionally initialise info in libxl__initiate_device_remove() before
    taking an error path which will free it.
    
    Coverity-ID: 1223212
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    CC: Wei Liu <wei.liu2@citrix.com>
    CC: Ian Campbell <Ian.Campbell@citrix.com>
    CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 tools/libxl/libxl_device.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
index 90ae564..788895b 100644
--- a/tools/libxl/libxl_device.c
+++ b/tools/libxl/libxl_device.c
@@ -772,6 +772,8 @@ void libxl__initiate_device_remove(libxl__egc *egc,
     uint32_t my_domid, domid = aodev->dev->domid;
     int rc = 0;
 
+    libxl_dominfo_init(&info);
+
     rc = libxl__get_domid(gc, &my_domid);
     if (rc) {
         LOG(ERROR, "unable to get my domid");
@@ -779,7 +781,6 @@ void libxl__initiate_device_remove(libxl__egc *egc,
     }
 
     if (my_domid == LIBXL_TOOLSTACK_DOMID) {
-        libxl_dominfo_init(&info);
         rc = libxl_domain_info(CTX, &info, domid);
         if (rc) {
             LOG(ERROR, "unable to get info for domain %d", domid);
--
generated by git-patchbot for /home/xen/git/xen.git#master

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I3U-0008AS-5Q; Thu, 26 Jun 2014 22:22:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3S-0008AK-Fm
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:06 +0000
Received: from [85.158.143.35:2966] by server-1.bemta-4.messagelabs.com id
	96/07-09496-D0D9CA35; Thu, 26 Jun 2014 22:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1403821324!14178581!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25867 invoked from network); 26 Jun 2014 22:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3Q-0006Jz-1b
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3P-0002dN-RK
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:03 +0000
Date: Thu, 26 Jun 2014 22:22:03 +0000
Message-Id: <E1X0I3P-0002dN-RK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86-64: fix incorrect assembly
	instruction operand combination
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90e645f9c430070884c98f0353ac5b829bbc7b63
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:00:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:00:08 2014 +0200

    x86-64: fix incorrect assembly instruction operand combination
    
    Using %r11 with "cmpw" is invalid (which gas 2.25 is going to complain
    about). Rather than rolling a branch specific fix, re-use the
    respective hunk from master commit 4d246723 ("x86: use MOV instead of
    PUSH/POP when saving/restoring register state").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/entry.S |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index c606599..85e9a17 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -48,12 +48,10 @@ restore_all_guest:
         cmpl  $1,%ecx
         ja    .Lforce_iret
 
-        addq  $8,%rsp
-        popq  %rcx                    # RIP
-        popq  %r11                    # CS
-        cmpw  $FLAT_USER_CS32,%r11
-        popq  %r11                    # RFLAGS
-        popq  %rsp                    # RSP
+        cmpw  $FLAT_USER_CS32,16(%rsp)# CS
+        movq  8(%rsp),%rcx            # RIP
+        movq  24(%rsp),%r11           # RFLAGS
+        movq  32(%rsp),%rsp           # RSP
         je    1f
         sysretq
 1:      sysretl
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:11 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I3U-0008AS-5Q; Thu, 26 Jun 2014 22:22:08 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3S-0008AK-Fm
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:06 +0000
Received: from [85.158.143.35:2966] by server-1.bemta-4.messagelabs.com id
	96/07-09496-D0D9CA35; Thu, 26 Jun 2014 22:22:05 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1403821324!14178581!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25867 invoked from network); 26 Jun 2014 22:22:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3Q-0006Jz-1b
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3P-0002dN-RK
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:03 +0000
Date: Thu, 26 Jun 2014 22:22:03 +0000
Message-Id: <E1X0I3P-0002dN-RK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86-64: fix incorrect assembly
	instruction operand combination
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 90e645f9c430070884c98f0353ac5b829bbc7b63
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:00:08 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:00:08 2014 +0200

    x86-64: fix incorrect assembly instruction operand combination
    
    Using %r11 with "cmpw" is invalid (which gas 2.25 is going to complain
    about). Rather than rolling a branch specific fix, re-use the
    respective hunk from master commit 4d246723 ("x86: use MOV instead of
    PUSH/POP when saving/restoring register state").
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/x86_64/entry.S |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S
index c606599..85e9a17 100644
--- a/xen/arch/x86/x86_64/entry.S
+++ b/xen/arch/x86/x86_64/entry.S
@@ -48,12 +48,10 @@ restore_all_guest:
         cmpl  $1,%ecx
         ja    .Lforce_iret
 
-        addq  $8,%rsp
-        popq  %rcx                    # RIP
-        popq  %r11                    # CS
-        cmpw  $FLAT_USER_CS32,%r11
-        popq  %r11                    # RFLAGS
-        popq  %rsp                    # RSP
+        cmpw  $FLAT_USER_CS32,16(%rsp)# CS
+        movq  8(%rsp),%rcx            # RIP
+        movq  24(%rsp),%r11           # RFLAGS
+        movq  32(%rsp),%rsp           # RSP
         je    1f
         sysretq
 1:      sysretl
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I3e-0008Bd-92; Thu, 26 Jun 2014 22:22:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3d-0008BN-7w
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:17 +0000
Received: from [85.158.137.68:15804] by server-9.bemta-3.messagelabs.com id
	16/38-09496-81D9CA35; Thu, 26 Jun 2014 22:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1403821334!12503379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25523 invoked from network); 26 Jun 2014 22:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3a-0006K5-Ex
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3a-0002eK-6F
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:14 +0000
Date: Thu, 26 Jun 2014 22:22:14 +0000
Message-Id: <E1X0I3a-0002eK-6F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d77d676d775d30e92a66fe4490d7dddc23af9d6d
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 24 10:00:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:00:49 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    master commit: 071a4c70a634f7d4f74cde4086ff3202968538c9
    master date: 2014-06-02 10:19:27 +0200
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index ef6f134..f5642ad 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -169,7 +169,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "0x%x to 0x%x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I3e-0008Bd-92; Thu, 26 Jun 2014 22:22:18 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3d-0008BN-7w
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:17 +0000
Received: from [85.158.137.68:15804] by server-9.bemta-3.messagelabs.com id
	16/38-09496-81D9CA35; Thu, 26 Jun 2014 22:22:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-31.messagelabs.com!1403821334!12503379!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25523 invoked from network); 26 Jun 2014 22:22:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3a-0006K5-Ex
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3a-0002eK-6F
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:14 +0000
Date: Thu, 26 Jun 2014 22:22:14 +0000
Message-Id: <E1X0I3a-0002eK-6F@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit d77d676d775d30e92a66fe4490d7dddc23af9d6d
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 24 10:00:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:00:49 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    master commit: 071a4c70a634f7d4f74cde4086ff3202968538c9
    master date: 2014-06-02 10:19:27 +0200
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index ef6f134..f5642ad 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -169,7 +169,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "0x%x to 0x%x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I3o-0008Dc-Bm; Thu, 26 Jun 2014 22:22:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3n-0008DL-9p
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:27 +0000
Received: from [85.158.143.35:18542] by server-3.bemta-4.messagelabs.com id
	FB/DA-16194-22D9CA35; Thu, 26 Jun 2014 22:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1403821344!14148775!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25870 invoked from network); 26 Jun 2014 22:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3k-0006KB-PI
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3k-0002eh-JK
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:24 +0000
Date: Thu, 26 Jun 2014 22:22:24 +0000
Message-Id: <E1X0I3k-0002eh-JK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI: Prevent acpi_table_entries
	from falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 590a83af39dff98e10928a4188c452729996cc22
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 10:01:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:01:38 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
    master date: 2014-06-04 11:26:15 +0200
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index e1c421e..7c31480 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -235,6 +235,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:28 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I3o-0008Dc-Bm; Thu, 26 Jun 2014 22:22:28 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3n-0008DL-9p
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:27 +0000
Received: from [85.158.143.35:18542] by server-3.bemta-4.messagelabs.com id
	FB/DA-16194-22D9CA35; Thu, 26 Jun 2014 22:22:26 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-21.messagelabs.com!1403821344!14148775!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25870 invoked from network); 26 Jun 2014 22:22:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:25 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3k-0006KB-PI
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3k-0002eh-JK
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:24 +0000
Date: Thu, 26 Jun 2014 22:22:24 +0000
Message-Id: <E1X0I3k-0002eh-JK@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] ACPI: Prevent acpi_table_entries
	from falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 590a83af39dff98e10928a4188c452729996cc22
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 10:01:38 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:01:38 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
    master date: 2014-06-04 11:26:15 +0200
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index e1c421e..7c31480 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -235,6 +235,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I40-0008G7-Ei; Thu, 26 Jun 2014 22:22:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3y-0008Fa-Ff
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:38 +0000
Received: from [85.158.139.211:20704] by server-15.bemta-5.messagelabs.com id
	04/AF-19516-D2D9CA35; Thu, 26 Jun 2014 22:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1403821355!4685261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17480 invoked from network); 26 Jun 2014 22:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3u-0006KH-Ul
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3u-0002f6-Te
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:34 +0000
Date: Thu, 26 Jun 2014 22:22:34 +0000
Message-Id: <E1X0I3u-0002f6-Te@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: honor APEI firmware-first
	mode in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f217ac9a0a23aad33b360f19bf18e0de27ce552
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:10:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:10:13 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
    master date: 2014-06-05 17:49:14 +0200
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    5 +
 xen/include/xen/lib.h                |    3 +
 xen/include/xen/pci.h                |    2 +
 10 files changed, 345 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 02b983f..eebe00f 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -846,5 +846,7 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	return 0;
 }
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..9216ef4 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-$(x86_64) += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 64f32b6..861aaf4 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -849,6 +849,106 @@ void __init setup_dom0_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#if defined(CONFIG_X86_64) && defined(CONFIG_ACPI)
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 91b7612..11efca2 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -400,7 +400,9 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     {
 #ifdef CONFIG_X86_64
         int pos;
-        u32 val;
+        bool_t ff;
+        u32 val, val2;
+        const char *action;
 
     /*
      * Mask reporting Intel VT-d faults to IOH core logic:
@@ -444,7 +446,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -453,18 +458,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 #endif
 
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index 162f616..087bbef 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 size_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 2b4ef72..4d2d843 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,11 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+#ifndef CONFIG_X86_32
+void acpi_hest_init(void);
+#else
+static inline void acpi_hest_init(void) {}
+#endif
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 1919ed7..f7074cf 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -58,6 +58,9 @@ do {                                                            \
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
 
+#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
+#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
+
 #define reserve_bootmem(_p,_l) ((void)0)
 
 struct domain;
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 0258958..e151e70 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -137,6 +137,8 @@ int pci_find_next_cap(u16 seg, u8 bus, unsigned int devfn, u8 pos, int cap);
 int pci_find_ext_capability(int seg, int bus, int devfn, int cap);
 int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I40-0008G7-Ei; Thu, 26 Jun 2014 22:22:40 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3y-0008Fa-Ff
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:38 +0000
Received: from [85.158.139.211:20704] by server-15.bemta-5.messagelabs.com id
	04/AF-19516-D2D9CA35; Thu, 26 Jun 2014 22:22:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-206.messagelabs.com!1403821355!4685261!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17480 invoked from network); 26 Jun 2014 22:22:36 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3u-0006KH-Ul
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I3u-0002f6-Te
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:34 +0000
Date: Thu, 26 Jun 2014 22:22:34 +0000
Message-Id: <E1X0I3u-0002f6-Te@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d: honor APEI firmware-first
	mode in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 4f217ac9a0a23aad33b360f19bf18e0de27ce552
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:10:13 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:10:13 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
    master date: 2014-06-05 17:49:14 +0200
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    5 +
 xen/include/xen/lib.h                |    3 +
 xen/include/xen/pci.h                |    2 +
 10 files changed, 345 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index 02b983f..eebe00f 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -846,5 +846,7 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	return 0;
 }
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..9216ef4 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-$(x86_64) += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 64f32b6..861aaf4 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -849,6 +849,106 @@ void __init setup_dom0_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#if defined(CONFIG_X86_64) && defined(CONFIG_ACPI)
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 91b7612..11efca2 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -400,7 +400,9 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     {
 #ifdef CONFIG_X86_64
         int pos;
-        u32 val;
+        bool_t ff;
+        u32 val, val2;
+        const char *action;
 
     /*
      * Mask reporting Intel VT-d faults to IOH core logic:
@@ -444,7 +446,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -453,18 +458,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 #endif
 
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index 162f616..087bbef 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 size_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index 2b4ef72..4d2d843 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,11 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+#ifndef CONFIG_X86_32
+void acpi_hest_init(void);
+#else
+static inline void acpi_hest_init(void) {}
+#endif
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h
index 1919ed7..f7074cf 100644
--- a/xen/include/xen/lib.h
+++ b/xen/include/xen/lib.h
@@ -58,6 +58,9 @@ do {                                                            \
 
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]) + __must_be_array(x))
 
+#define MASK_EXTR(v, m) (((v) & (m)) / ((m) & -(m)))
+#define MASK_INSR(v, m) (((v) * ((m) & -(m))) & (m))
+
 #define reserve_bootmem(_p,_l) ((void)0)
 
 struct domain;
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 0258958..e151e70 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -137,6 +137,8 @@ int pci_find_next_cap(u16 seg, u8 bus, unsigned int devfn, u8 pos, int cap);
 int pci_find_ext_capability(int seg, int bus, int devfn, int cap);
 int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I49-0008IM-Jb; Thu, 26 Jun 2014 22:22:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I48-0008Hu-0m
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:48 +0000
Received: from [85.158.139.211:21083] by server-8.bemta-5.messagelabs.com id
	B2/BB-01846-73D9CA35; Thu, 26 Jun 2014 22:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403821365!8921977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22105 invoked from network); 26 Jun 2014 22:22:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I45-0006KN-8C
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I45-0002fS-2c
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:45 +0000
Date: Thu, 26 Jun 2014 22:22:45 +0000
Message-Id: <E1X0I45-0002fS-2c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/domctl: two functional fixes
	to XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5bf9449364dfbc845ddb4b8f20ae9df56aaaa692
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 24 10:11:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:11:54 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 090ca8c155b7321404ea7713a28aaedb7ac4fffd
    master date: 2014-06-05 17:52:57 +0200
    master commit: 895661ae98f0249f50280b4acfb9dda70b76d7e9
    master date: 2014-06-10 12:03:16 +0200
---
 xen/arch/x86/domctl.c |   55 +++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 099fb4b..bb80b23 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1413,45 +1413,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1500,12 +1503,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
@@ -1513,8 +1518,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:22:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:22:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I49-0008IM-Jb; Thu, 26 Jun 2014 22:22:49 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I48-0008Hu-0m
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:48 +0000
Received: from [85.158.139.211:21083] by server-8.bemta-5.messagelabs.com id
	B2/BB-01846-73D9CA35; Thu, 26 Jun 2014 22:22:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-206.messagelabs.com!1403821365!8921977!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22105 invoked from network); 26 Jun 2014 22:22:46 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I45-0006KN-8C
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I45-0002fS-2c
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:45 +0000
Date: Thu, 26 Jun 2014 22:22:45 +0000
Message-Id: <E1X0I45-0002fS-2c@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/domctl: two functional fixes
	to XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5bf9449364dfbc845ddb4b8f20ae9df56aaaa692
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 24 10:11:54 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:11:54 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 090ca8c155b7321404ea7713a28aaedb7ac4fffd
    master date: 2014-06-05 17:52:57 +0200
    master commit: 895661ae98f0249f50280b4acfb9dda70b76d7e9
    master date: 2014-06-10 12:03:16 +0200
---
 xen/arch/x86/domctl.c |   55 +++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 099fb4b..bb80b23 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1413,45 +1413,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1500,12 +1503,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
@@ -1513,8 +1518,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         rcu_unlock_domain(d);
         if ( (domctl->cmd == XEN_DOMCTL_getvcpuextstate) &&
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:02 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4L-0008KG-W4; Thu, 26 Jun 2014 22:23:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4J-0008Jv-Ot
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:59 +0000
Content-Length: 5749
Received: from [85.158.139.211:21399] by server-15.bemta-5.messagelabs.com id
	87/CF-19516-34D9CA35; Thu, 26 Jun 2014 22:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1403821375!6869547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8882 invoked from network); 26 Jun 2014 22:22:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4F-0006KT-Hj
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4F-0002fo-D2
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:55 +0000
Date: Thu, 26 Jun 2014 22:22:55 +0000
Message-Id: <E1X0I4F-0002fo-D2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix reboot/shutdown with
	running HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7425289096188782985=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7425289096188782985==
Content-Length: 5425
Content-Transfer-Encoding: quoted-printable

commit aeb9d2c7cc13bddd416c4aae7e2c10710b51fc7f
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Jun 24 10:15:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:15:29 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=3Dy  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 39ede234d1fd683430ffb1784d6d35b096f16457
    master date: 2014-06-05 17:53:35 +0200
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index cbdc58a..0d999b8 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -865,6 +865,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu =3D smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) =3D=3D 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b09e8d7..0217328 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -71,7 +71,7 @@ bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index ec85b8d..946dee3 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -659,6 +659,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ad11057..067982a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -398,6 +398,8 @@ int vmx_add_guest_msr(u32 msr);
 int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:02 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4L-0008KG-W4; Thu, 26 Jun 2014 22:23:01 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4J-0008Jv-Ot
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:59 +0000
Content-Length: 5749
Received: from [85.158.139.211:21399] by server-15.bemta-5.messagelabs.com id
	87/CF-19516-34D9CA35; Thu, 26 Jun 2014 22:22:59 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-206.messagelabs.com!1403821375!6869547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8882 invoked from network); 26 Jun 2014 22:22:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:22:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4F-0006KT-Hj
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4F-0002fo-D2
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:22:55 +0000
Date: Thu, 26 Jun 2014 22:22:55 +0000
Message-Id: <E1X0I4F-0002fo-D2@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86: fix reboot/shutdown with
	running HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7425289096188782985=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============7425289096188782985==
Content-Length: 5425
Content-Transfer-Encoding: quoted-printable

commit aeb9d2c7cc13bddd416c4aae7e2c10710b51fc7f
Author:     Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
AuthorDate: Tue Jun 24 10:15:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:15:29 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=3Dy  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monn=C3=A9 <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 39ede234d1fd683430ffb1784d6d35b096f16457
    master date: 2014-06-05 17:53:35 +0200
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index cbdc58a..0d999b8 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -865,6 +865,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu =3D smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) =3D=3D 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index b09e8d7..0217328 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -71,7 +71,7 @@ bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index ec85b8d..946dee3 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -659,6 +659,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index ad11057..067982a 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -398,6 +398,8 @@ int vmx_add_guest_msr(u32 msr);
 int vmx_add_host_load_msr(u32 msr);
 void vmx_vmcs_switch(struct vmcs_struct *from, struct vmcs_struct *to);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2


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

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4T-0008Le-3k; Thu, 26 Jun 2014 22:23:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4S-0008LT-K4
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:08 +0000
Received: from [85.158.137.68:20987] by server-12.bemta-3.messagelabs.com id
	8B/3C-12714-B4D9CA35; Thu, 26 Jun 2014 22:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403821386!8121490!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1970 invoked from network); 26 Jun 2014 22:23:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4P-0006L2-Mv
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4P-0002gP-Kx
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:05 +0000
Date: Thu, 26 Jun 2014 22:23:05 +0000
Message-Id: <E1X0I4P-0002gP-Kx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] avoid crash on HVM domain destroy
	with PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0cdf388cd59fa55148cf7665894de253ffd7ac1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 24 10:16:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:16:12 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    master commit: b9ae60907e6dbc686403e52a7e61a6f856401a1b
    master date: 2014-06-10 12:04:08 +0200
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e2c6ce7..c85e0b2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -295,7 +295,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4T-0008Le-3k; Thu, 26 Jun 2014 22:23:09 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4S-0008LT-K4
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:08 +0000
Received: from [85.158.137.68:20987] by server-12.bemta-3.messagelabs.com id
	8B/3C-12714-B4D9CA35; Thu, 26 Jun 2014 22:23:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-31.messagelabs.com!1403821386!8121490!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1970 invoked from network); 26 Jun 2014 22:23:07 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4P-0006L2-Mv
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4P-0002gP-Kx
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:05 +0000
Date: Thu, 26 Jun 2014 22:23:05 +0000
Message-Id: <E1X0I4P-0002gP-Kx@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] avoid crash on HVM domain destroy
	with PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 0cdf388cd59fa55148cf7665894de253ffd7ac1b
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 24 10:16:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:16:12 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    master commit: b9ae60907e6dbc686403e52a7e61a6f856401a1b
    master date: 2014-06-10 12:04:08 +0200
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index e2c6ce7..c85e0b2 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -295,7 +295,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4e-0008NX-6T; Thu, 26 Jun 2014 22:23:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4c-0008NK-QN
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:19 +0000
Received: from [85.158.137.68:24263] by server-5.bemta-3.messagelabs.com id
	23/58-27487-65D9CA35; Thu, 26 Jun 2014 22:23:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403821396!12585980!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22904 invoked from network); 26 Jun 2014 22:23:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4Z-0006L8-Sh
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4Z-0002hX-R0
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:15 +0000
Date: Thu, 26 Jun 2014 22:23:15 +0000
Message-Id: <E1X0I4Z-0002hX-R0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/HVM: refine SMEP test in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26d074fdbf3da16e38bd7898d29ac8480e71e5d7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:17:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:17:45 2014 +0200

    x86/HVM: refine SMEP test in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    master commit: 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
    master date: 2014-06-10 13:12:05 +0200
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 68531ab..7d4b0b3 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -751,7 +751,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -1842,7 +1842,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 902f224..d6bb844 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -365,18 +365,24 @@ static inline bool_t hvm_vcpu_has_smep(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:20 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4e-0008NX-6T; Thu, 26 Jun 2014 22:23:20 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4c-0008NK-QN
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:19 +0000
Received: from [85.158.137.68:24263] by server-5.bemta-3.messagelabs.com id
	23/58-27487-65D9CA35; Thu, 26 Jun 2014 22:23:18 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-31.messagelabs.com!1403821396!12585980!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22904 invoked from network); 26 Jun 2014 22:23:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:17 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4Z-0006L8-Sh
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4Z-0002hX-R0
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:15 +0000
Date: Thu, 26 Jun 2014 22:23:15 +0000
Message-Id: <E1X0I4Z-0002hX-R0@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/HVM: refine SMEP test in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 26d074fdbf3da16e38bd7898d29ac8480e71e5d7
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:17:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:17:45 2014 +0200

    x86/HVM: refine SMEP test in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    master commit: 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
    master date: 2014-06-10 13:12:05 +0200
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 68531ab..7d4b0b3 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -751,7 +751,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -1842,7 +1842,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 902f224..d6bb844 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -365,18 +365,24 @@ static inline bool_t hvm_vcpu_has_smep(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4o-0008Pn-90; Thu, 26 Jun 2014 22:23:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4m-0008PX-Qw
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:29 +0000
Received: from [85.158.143.35:22398] by server-1.bemta-4.messagelabs.com id
	F7/77-09496-06D9CA35; Thu, 26 Jun 2014 22:23:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1403821406!13846286!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28300 invoked from network); 26 Jun 2014 22:23:27 -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;
	26 Jun 2014 22:23:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4k-0006LE-3L
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4k-0002hz-1l
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:26 +0000
Date: Thu, 26 Jun 2014 22:23:26 +0000
Message-Id: <E1X0I4k-0002hz-1l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/mce: don't spam the console
	with "CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3211e8e941396a937442b7a6d8ec9b030cf8953d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jun 24 10:18:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:18:29 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: 323338f86fb6cd6f6dba4f59a84eed71b3552d21
    master date: 2014-06-16 11:59:32 +0200
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 02e2db5..be14593 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -47,11 +47,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -60,13 +64,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -1329,6 +1337,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
     per_cpu(mce_clear_banks, cpu) = mb1;
     per_cpu(no_cmci_banks, cpu) = mb2;
     per_cpu(mce_banks_owned, cpu) = mb3;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:30 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4o-0008Pn-90; Thu, 26 Jun 2014 22:23:30 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4m-0008PX-Qw
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:29 +0000
Received: from [85.158.143.35:22398] by server-1.bemta-4.messagelabs.com id
	F7/77-09496-06D9CA35; Thu, 26 Jun 2014 22:23:28 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1403821406!13846286!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28300 invoked from network); 26 Jun 2014 22:23:27 -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;
	26 Jun 2014 22:23:27 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4k-0006LE-3L
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4k-0002hz-1l
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:26 +0000
Date: Thu, 26 Jun 2014 22:23:26 +0000
Message-Id: <E1X0I4k-0002hz-1l@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/mce: don't spam the console
	with "CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 3211e8e941396a937442b7a6d8ec9b030cf8953d
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jun 24 10:18:29 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:18:29 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: 323338f86fb6cd6f6dba4f59a84eed71b3552d21
    master date: 2014-06-16 11:59:32 +0200
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index 02e2db5..be14593 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -47,11 +47,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -60,13 +64,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -1329,6 +1337,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
     per_cpu(mce_clear_banks, cpu) = mb1;
     per_cpu(no_cmci_banks, cpu) = mb2;
     per_cpu(mce_banks_owned, cpu) = mb3;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4y-0008Ry-DN; Thu, 26 Jun 2014 22:23:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4x-0008Rf-IM
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:39 +0000
Received: from [193.109.254.147:24834] by server-7.bemta-14.messagelabs.com id
	0D/60-17726-A6D9CA35; Thu, 26 Jun 2014 22:23:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1403821416!14003709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20252 invoked from network); 26 Jun 2014 22:23:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4u-0006LK-Au
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4u-0002iP-91
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:36 +0000
Date: Thu, 26 Jun 2014 22:23:36 +0000
Message-Id: <E1X0I4u-0002iP-91@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e58d4039d408f8b9342fa5a20a515b9a1909a313
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 10:23:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:23:12 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 84c340ba4c3eb99278b6ba885616bb183b88ad67
    master date: 2014-06-18 15:50:02 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    5 +++--
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index c3cbf88..75b323b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -137,7 +137,7 @@ static void amd_iommu_setup_domain_device(
     {
         struct pci_dev *pdev;
 
-        enable_ats_device(iommu->seg, bus, devfn);
+        enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         ASSERT(spin_is_locked(&pcidevs_lock));
         pdev = pci_get_pdev(iommu->seg, bus, devfn);
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index c34fa2c..cf082af 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #ifdef CONFIG_X86_64
@@ -36,7 +37,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
@@ -64,7 +65,7 @@ static inline int pci_ats_device(int seg, int bus, int devfn)
 #else
 
 #define ats_enabled 0
-static inline int enable_ats_device(int seg, int bus, int devfn)
+static inline int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     BUG();
     return -ENOSYS;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index bb7c444..51c3f98 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1475,7 +1475,7 @@ static int domain_context_mapping(
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn);
         if ( !ret && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1961,7 +1961,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:40 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I4y-0008Ry-DN; Thu, 26 Jun 2014 22:23:40 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4x-0008Rf-IM
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:39 +0000
Received: from [193.109.254.147:24834] by server-7.bemta-14.messagelabs.com id
	0D/60-17726-A6D9CA35; Thu, 26 Jun 2014 22:23:38 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1403821416!14003709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20252 invoked from network); 26 Jun 2014 22:23:37 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4u-0006LK-Au
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I4u-0002iP-91
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:36 +0000
Date: Thu, 26 Jun 2014 22:23:36 +0000
Message-Id: <E1X0I4u-0002iP-91@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit e58d4039d408f8b9342fa5a20a515b9a1909a313
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 10:23:12 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:23:12 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 84c340ba4c3eb99278b6ba885616bb183b88ad67
    master date: 2014-06-18 15:50:02 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    5 +++--
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index c3cbf88..75b323b 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -137,7 +137,7 @@ static void amd_iommu_setup_domain_device(
     {
         struct pci_dev *pdev;
 
-        enable_ats_device(iommu->seg, bus, devfn);
+        enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         ASSERT(spin_is_locked(&pcidevs_lock));
         pdev = pci_get_pdev(iommu->seg, bus, devfn);
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index c34fa2c..cf082af 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #ifdef CONFIG_X86_64
@@ -36,7 +37,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
@@ -64,7 +65,7 @@ static inline int pci_ats_device(int seg, int bus, int devfn)
 #else
 
 #define ats_enabled 0
-static inline int enable_ats_device(int seg, int bus, int devfn)
+static inline int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     BUG();
     return -ENOSYS;
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index bb7c444..51c3f98 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1475,7 +1475,7 @@ static int domain_context_mapping(
                     PCI_SLOT(devfn), PCI_FUNC(devfn));
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn);
         if ( !ret && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1961,7 +1961,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I58-0008Td-GF; Thu, 26 Jun 2014 22:23:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I57-0008TG-18
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:49 +0000
Received: from [85.158.139.211:65454] by server-17.bemta-5.messagelabs.com id
	A1/B1-08711-47D9CA35; Thu, 26 Jun 2014 22:23:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403821426!12293429!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21732 invoked from network); 26 Jun 2014 22:23:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I54-0006LQ-G9
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I54-0002io-F7
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:46 +0000
Date: Thu, 26 Jun 2014 22:23:46 +0000
Message-Id: <E1X0I54-0002io-F7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/EFI: allow FPU/XMM use in
	runtime service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da777ed3296ef58f23805cfeefde6427a7d2365a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:24:20 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:24:20 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: e0fe297dabc96d8161d568f19a99722c4739b9f9
    master date: 2014-06-18 15:53:27 +0200
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index b8847dd..fb48430 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -39,8 +41,14 @@ l4_pgentry_t *__read_mostly efi_l4_pgtable;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -76,6 +84,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 0a001fd..946a83c 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -276,10 +276,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -294,9 +294,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 1f5fe50..fd268a9 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:23:50 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:23:50 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I58-0008Td-GF; Thu, 26 Jun 2014 22:23:50 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I57-0008TG-18
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:49 +0000
Received: from [85.158.139.211:65454] by server-17.bemta-5.messagelabs.com id
	A1/B1-08711-47D9CA35; Thu, 26 Jun 2014 22:23:48 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1403821426!12293429!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21732 invoked from network); 26 Jun 2014 22:23:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Jun 2014 22:23:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I54-0006LQ-G9
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:46 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I54-0002io-F7
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:46 +0000
Date: Thu, 26 Jun 2014 22:23:46 +0000
Message-Id: <E1X0I54-0002io-F7@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] x86/EFI: allow FPU/XMM use in
	runtime service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit da777ed3296ef58f23805cfeefde6427a7d2365a
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:24:20 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:24:20 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: e0fe297dabc96d8161d568f19a99722c4739b9f9
    master date: 2014-06-18 15:53:27 +0200
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index b8847dd..fb48430 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -39,8 +41,14 @@ l4_pgentry_t *__read_mostly efi_l4_pgtable;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -76,6 +84,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 0a001fd..946a83c 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -276,10 +276,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -294,9 +294,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 1f5fe50..fd268a9 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:24:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:24:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I5K-0008Vq-J4; Thu, 26 Jun 2014 22:24:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I5I-0008Va-SB
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:24:00 +0000
Received: from [193.109.254.147:25398] by server-12.bemta-14.messagelabs.com
	id EF/28-32179-08D9CA35; Thu, 26 Jun 2014 22:24:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1403821436!13965646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27340 invoked from network); 26 Jun 2014 22:23:57 -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;
	26 Jun 2014 22:23:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I5E-0006LW-Ln
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I5E-0002jD-Jf
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:56 +0000
Date: Thu, 26 Jun 2014 22:23:56 +0000
Message-Id: <E1X0I5E-0002jD-Jf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d/qinval: make local variable
	used for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 524f82e65b8bff8c016b4036bc2f2708ad80e11d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:24:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:24:52 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
    master date: 2014-06-20 10:25:33 +0200
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 6a410d8..d2b5fa9 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Thu Jun 26 22:24:03 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 26 Jun 2014 22:24:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0I5K-0008Vq-J4; Thu, 26 Jun 2014 22:24:02 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I5I-0008Va-SB
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:24:00 +0000
Received: from [193.109.254.147:25398] by server-12.bemta-14.messagelabs.com
	id EF/28-32179-08D9CA35; Thu, 26 Jun 2014 22:24:00 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1403821436!13965646!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27340 invoked from network); 26 Jun 2014 22:23:57 -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;
	26 Jun 2014 22:23:57 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I5E-0006LW-Ln
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:56 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0I5E-0002jD-Jf
	for xen-changelog@lists.xensource.com; Thu, 26 Jun 2014 22:23:56 +0000
Date: Thu, 26 Jun 2014 22:23:56 +0000
Message-Id: <E1X0I5E-0002jD-Jf@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.2] VT-d/qinval: make local variable
	used for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 524f82e65b8bff8c016b4036bc2f2708ad80e11d
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 10:24:52 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 10:24:52 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
    master date: 2014-06-20 10:25:33 +0200
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 6a410d8..d2b5fa9 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.2

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

From xen-changelog-bounces@lists.xen.org Fri Jun 27 21:33:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jun 2014 21:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0dlb-00006I-2A; Fri, 27 Jun 2014 21:33:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0dlZ-00006D-Bj
	for xen-changelog@lists.xensource.com; Fri, 27 Jun 2014 21:33:05 +0000
Received: from [85.158.143.35:43864] by server-1.bemta-4.messagelabs.com id
	2D/D4-09496-013EDA35; Fri, 27 Jun 2014 21:33:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403904782!14454576!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 893 invoked from network); 27 Jun 2014 21:33:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jun 2014 21:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0dlW-00038X-MT
	for xen-changelog@lists.xensource.com; Fri, 27 Jun 2014 21:33:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0dlW-0006Y5-FP
	for xen-changelog@lists.xensource.com; Fri, 27 Jun 2014 21:33:02 +0000
Date: Fri, 27 Jun 2014 21:33:02 +0000
Message-Id: <E1X0dlW-0006Y5-FP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: initialise the
	grant_table_gpfn array on allocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7aedb244ed6ca3180849fe4a04136a2b10151327
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 25 13:58:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 25 13:59:33 2014 +0100

    xen: arm: initialise the grant_table_gpfn array on allocation
    
    Avoids leaking uninitialised memory via the grant table setup hypercall.
    
    This is XSA-101.
    
    Reported-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c0c5af3..67de12a 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -394,7 +394,7 @@ struct domain *alloc_domain_struct(void)
         return NULL;
 
     clear_page(d);
-    d->arch.grant_table_gpfn = xmalloc_array(xen_pfn_t, max_nr_grant_frames);
+    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_nr_grant_frames);
     return d;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Fri Jun 27 21:33:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 27 Jun 2014 21:33:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X0dlb-00006I-2A; Fri, 27 Jun 2014 21:33:07 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0dlZ-00006D-Bj
	for xen-changelog@lists.xensource.com; Fri, 27 Jun 2014 21:33:05 +0000
Received: from [85.158.143.35:43864] by server-1.bemta-4.messagelabs.com id
	2D/D4-09496-013EDA35; Fri, 27 Jun 2014 21:33:04 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-21.messagelabs.com!1403904782!14454576!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 893 invoked from network); 27 Jun 2014 21:33:03 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	27 Jun 2014 21:33:03 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0dlW-00038X-MT
	for xen-changelog@lists.xensource.com; Fri, 27 Jun 2014 21:33:02 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X0dlW-0006Y5-FP
	for xen-changelog@lists.xensource.com; Fri, 27 Jun 2014 21:33:02 +0000
Date: Fri, 27 Jun 2014 21:33:02 +0000
Message-Id: <E1X0dlW-0006Y5-FP@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.4] xen: arm: initialise the
	grant_table_gpfn array on allocation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 7aedb244ed6ca3180849fe4a04136a2b10151327
Author:     Ian Campbell <ian.campbell@citrix.com>
AuthorDate: Wed Jun 25 13:58:59 2014 +0100
Commit:     Ian Campbell <ian.campbell@citrix.com>
CommitDate: Wed Jun 25 13:59:33 2014 +0100

    xen: arm: initialise the grant_table_gpfn array on allocation
    
    Avoids leaking uninitialised memory via the grant table setup hypercall.
    
    This is XSA-101.
    
    Reported-by: Julien Grall <julien.grall@linaro.org>
    Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 xen/arch/arm/domain.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index c0c5af3..67de12a 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -394,7 +394,7 @@ struct domain *alloc_domain_struct(void)
         return NULL;
 
     clear_page(d);
-    d->arch.grant_table_gpfn = xmalloc_array(xen_pfn_t, max_nr_grant_frames);
+    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_nr_grant_frames);
     return d;
 }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cad-0000WY-JM; Sun, 29 Jun 2014 10:44:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cad-0000WT-6g
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:07 +0000
Received: from [85.158.137.68:13764] by server-3.bemta-3.messagelabs.com id
	09/9A-12895-6FDEFA35; Sun, 29 Jun 2014 10:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1404038644!12888179!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7803 invoked from network); 29 Jun 2014 10:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Caa-0005sP-16
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CaZ-0005Dm-He
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:03 +0000
Date: Sun, 29 Jun 2014 10:44:03 +0000
Message-Id: <E1X1CaZ-0005Dm-He@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c2165399c22c0e8385b13536c722d321348e47c
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 24 09:46:58 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:46:58 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    master commit: 071a4c70a634f7d4f74cde4086ff3202968538c9
    master date: 2014-06-02 10:19:27 +0200
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 3014245..32d7fa1 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -164,7 +164,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:12 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cad-0000WY-JM; Sun, 29 Jun 2014 10:44:07 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cad-0000WT-6g
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:07 +0000
Received: from [85.158.137.68:13764] by server-3.bemta-3.messagelabs.com id
	09/9A-12895-6FDEFA35; Sun, 29 Jun 2014 10:44:06 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-31.messagelabs.com!1404038644!12888179!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7803 invoked from network); 29 Jun 2014 10:44:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Caa-0005sP-16
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CaZ-0005Dm-He
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:03 +0000
Date: Sun, 29 Jun 2014 10:44:03 +0000
Message-Id: <E1X1CaZ-0005Dm-He@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86,
	amd_ucode: flip revision numbers in printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2c2165399c22c0e8385b13536c722d321348e47c
Author:     Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
AuthorDate: Tue Jun 24 09:46:58 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:46:58 2014 +0200

    x86, amd_ucode: flip revision numbers in printk
    
    A failure would result in log message like so-
    (XEN) microcode: CPU0 update from revision 0x6000637 to 0x6000626 failed
                                               ^^^^^^^^^^^^^^^^^^^^^^
    The above message has the revision numbers inverted. Fix this.
    
    Signed-off-by: Aravind Gopalakrishnan <aravind.gopalakrishnan@amd.com>
    master commit: 071a4c70a634f7d4f74cde4086ff3202968538c9
    master date: 2014-06-02 10:19:27 +0200
---
 xen/arch/x86/microcode_amd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/microcode_amd.c b/xen/arch/x86/microcode_amd.c
index 3014245..32d7fa1 100644
--- a/xen/arch/x86/microcode_amd.c
+++ b/xen/arch/x86/microcode_amd.c
@@ -164,7 +164,7 @@ static int apply_microcode(int cpu)
     if ( rev != hdr->patch_id )
     {
         printk(KERN_ERR "microcode: CPU%d update from revision "
-               "%#x to %#x failed\n", cpu, hdr->patch_id, rev);
+               "%#x to %#x failed\n", cpu, rev, hdr->patch_id);
         return -EIO;
     }
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cao-0000XG-NQ; Sun, 29 Jun 2014 10:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Can-0000X6-At
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:17 +0000
Received: from [85.158.139.211:29616] by server-9.bemta-5.messagelabs.com id
	E7/51-01655-00EEFA35; Sun, 29 Jun 2014 10:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1404038654!12560133!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16620 invoked from network); 29 Jun 2014 10:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cak-0005sS-Ht
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cak-0005EB-4U
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:14 +0000
Date: Sun, 29 Jun 2014 10:44:14 +0000
Message-Id: <E1X1Cak-0005EB-4U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] ACPI: Prevent acpi_table_entries
	from falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5074152a3b234696dce1e888ad7c08427f2f0775
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:47:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:47:49 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
    master date: 2014-06-04 11:26:15 +0200
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 08e8f3b..1beca79 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -233,6 +233,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:18 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:18 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cao-0000XG-NQ; Sun, 29 Jun 2014 10:44:18 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Can-0000X6-At
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:17 +0000
Received: from [85.158.139.211:29616] by server-9.bemta-5.messagelabs.com id
	E7/51-01655-00EEFA35; Sun, 29 Jun 2014 10:44:16 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-206.messagelabs.com!1404038654!12560133!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16620 invoked from network); 29 Jun 2014 10:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cak-0005sS-Ht
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cak-0005EB-4U
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:14 +0000
Date: Sun, 29 Jun 2014 10:44:14 +0000
Message-Id: <E1X1Cak-0005EB-4U@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] ACPI: Prevent acpi_table_entries
	from falling into a infinite loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5074152a3b234696dce1e888ad7c08427f2f0775
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:47:49 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:47:49 2014 +0200

    ACPI: Prevent acpi_table_entries from falling into a infinite loop
    
    If a buggy BIOS programs an ACPI table with to small an entry length
    then acpi_table_entries gets stuck in an infinite loop.
    
    To aid debugging, report the error and exit the loop.
    
    Based on Linux kernel commit 369d913b242cae2205471b11b6e33ac368ed33ec
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    
    Use < instead of <= (which I wrongly suggested), return -ENODATA
    instead of -EINVAL, and make description match code.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: 9c1e8cae657bc13e8b1ddeede17603d77f3ad341
    master date: 2014-06-04 11:26:15 +0200
---
 xen/drivers/acpi/tables.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/xen/drivers/acpi/tables.c b/xen/drivers/acpi/tables.c
index 08e8f3b..1beca79 100644
--- a/xen/drivers/acpi/tables.c
+++ b/xen/drivers/acpi/tables.c
@@ -233,6 +233,12 @@ acpi_table_parse_entries(char *id,
 
 	while (((unsigned long)entry) + sizeof(struct acpi_subtable_header) <
 	       table_end) {
+		if (entry->length < sizeof(*entry)) {
+			printk(KERN_ERR PREFIX "[%4.4s:%#x] Invalid length\n",
+			       id, entry_id);
+			return -ENODATA;
+		}
+
 		if (entry->type == entry_id
 		    && (!max_entries || count++ < max_entries))
 			if (handler(entry, table_end))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Caz-0000Yd-Q9; Sun, 29 Jun 2014 10:44:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cay-0000YS-LG
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:28 +0000
Received: from [85.158.137.68:40962] by server-8.bemta-3.messagelabs.com id
	97/33-05923-B0EEFA35; Sun, 29 Jun 2014 10:44:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1404038665!10470252!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16999 invoked from network); 29 Jun 2014 10:44:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cau-0005sb-Qz
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cau-0005EX-M6
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:24 +0000
Date: Sun, 29 Jun 2014 10:44:24 +0000
Message-Id: <E1X1Cau-0005EX-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: honor APEI firmware-first
	mode in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29cdbd115d07983363a1dc21ea5ecba87ae77b74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:49:02 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:49:02 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
    master date: 2014-06-05 17:49:14 +0200
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    1 +
 xen/include/xen/pci.h                |    2 +
 9 files changed, 338 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index df26423..5ce6bde 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -732,6 +732,8 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
 
 	return 0;
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..6ad7c64 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-y += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 4d22d49..76c3127 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1058,6 +1058,106 @@ void __init setup_dom0_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 33f3942..647723d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -386,9 +386,11 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     int dev = PCI_SLOT(pdev->devfn);
     int func = PCI_FUNC(pdev->devfn);
     int pos;
-    u32 val;
+    bool_t ff;
+    u32 val, val2;
     u64 bar;
     paddr_t pa;
+    const char *action;
 
     if ( pci_conf_read16(seg, bus, dev, func, PCI_VENDOR_ID) !=
          PCI_VENDOR_ID_INTEL )
@@ -438,7 +440,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -447,18 +452,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 
     case 0x100: case 0x104: case 0x108: /* Sandybridge */
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index 162f616..087bbef 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 size_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index aedec65..3aeba4a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,7 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3b6b1b2..98d5c46 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -151,6 +151,8 @@ int pci_find_next_cap(u16 seg, u8 bus, unsigned int devfn, u8 pos, int cap);
 int pci_find_ext_capability(int seg, int bus, int devfn, int cap);
 int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:29 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Caz-0000Yd-Q9; Sun, 29 Jun 2014 10:44:29 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cay-0000YS-LG
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:28 +0000
Received: from [85.158.137.68:40962] by server-8.bemta-3.messagelabs.com id
	97/33-05923-B0EEFA35; Sun, 29 Jun 2014 10:44:27 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-14.tower-31.messagelabs.com!1404038665!10470252!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16999 invoked from network); 29 Jun 2014 10:44:26 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:26 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cau-0005sb-Qz
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cau-0005EX-M6
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:24 +0000
Date: Sun, 29 Jun 2014 10:44:24 +0000
Message-Id: <E1X1Cau-0005EX-M6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d: honor APEI firmware-first
	mode in XSA-59 workaround code
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 29cdbd115d07983363a1dc21ea5ecba87ae77b74
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:49:02 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:49:02 2014 +0200

    VT-d: honor APEI firmware-first mode in XSA-59 workaround code
    
    When firmware-first mode is being indicated by firmware, we shouldn't
    be modifying AER registers - these are considered to be owned by
    firmware in that case. Violating this is being reported to result in
    SMI storms. While circumventing the workaround means re-exposing
    affected hosts to the XSA-59 issues, this in any event seems better
    than not booting at all. Respective messages are being issued to the
    log, so the situation can be diagnosed.
    
    The basic building blocks were taken from Linux 3.15-rc. Note that
    this includes a block of code enclosed in #ifdef CONFIG_X86_MCE - we
    don't define that symbol, and that code also wouldn't build without
    suitable machine check side code added; that should happen eventually,
    but isn't subject of this change.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reported-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: 1cc37ba8dbd89fb86dad3f6c78c3fba06019fe21
    master date: 2014-06-05 17:49:14 +0200
---
 xen/arch/x86/acpi/boot.c             |    2 +
 xen/drivers/acpi/apei/Makefile       |    1 +
 xen/drivers/acpi/apei/hest.c         |  200 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/pci.c        |  100 +++++++++++++++++
 xen/drivers/passthrough/vtd/quirks.c |   29 ++++--
 xen/include/acpi/actbl1.h            |    8 ++
 xen/include/acpi/apei.h              |    3 +
 xen/include/xen/acpi.h               |    1 +
 xen/include/xen/pci.h                |    2 +
 9 files changed, 338 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c
index df26423..5ce6bde 100644
--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -732,6 +732,8 @@ int __init acpi_boot_init(void)
 
 	erst_init();
 
+	acpi_hest_init();
+
 	acpi_table_parse(ACPI_SIG_BGRT, acpi_invalidate_bgrt);
 
 	return 0;
diff --git a/xen/drivers/acpi/apei/Makefile b/xen/drivers/acpi/apei/Makefile
index af6ecb0..6ad7c64 100644
--- a/xen/drivers/acpi/apei/Makefile
+++ b/xen/drivers/acpi/apei/Makefile
@@ -1,3 +1,4 @@
 obj-y += erst.o
+obj-y += hest.o
 obj-y += apei-base.o
 obj-y += apei-io.o
diff --git a/xen/drivers/acpi/apei/hest.c b/xen/drivers/acpi/apei/hest.c
new file mode 100644
index 0000000..b8790a6
--- /dev/null
+++ b/xen/drivers/acpi/apei/hest.c
@@ -0,0 +1,200 @@
+/*
+ * APEI Hardware Error Souce Table support
+ *
+ * HEST describes error sources in detail; communicates operational
+ * parameters (i.e. severity levels, masking bits, and threshold
+ * values) to Linux as necessary. It also allows the BIOS to report
+ * non-standard error sources to Linux (for example, chipset-specific
+ * error registers).
+ *
+ * For more information about HEST, please refer to ACPI Specification
+ * version 4.0, section 17.3.2.
+ *
+ * Copyright 2009 Intel Corp.
+ *   Author: Huang Ying <ying.huang@intel.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License version
+ * 2 as published by the Free Software Foundation;
+ *
+ * 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/errno.h>
+#include <xen/init.h>
+#include <xen/kernel.h>
+#include <xen/mm.h>
+#include <xen/pfn.h>
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+#include "apei-internal.h"
+
+#define HEST_PFX "HEST: "
+
+static bool_t hest_disable;
+boolean_param("hest_disable", hest_disable);
+
+/* HEST table parsing */
+
+static struct acpi_table_hest *__read_mostly hest_tab;
+
+static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
+	[ACPI_HEST_TYPE_IA32_CHECK] = -1,	/* need further calculation */
+	[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
+	[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
+	[ACPI_HEST_TYPE_AER_ROOT_PORT] = sizeof(struct acpi_hest_aer_root),
+	[ACPI_HEST_TYPE_AER_ENDPOINT] = sizeof(struct acpi_hest_aer),
+	[ACPI_HEST_TYPE_AER_BRIDGE] = sizeof(struct acpi_hest_aer_bridge),
+	[ACPI_HEST_TYPE_GENERIC_ERROR] = sizeof(struct acpi_hest_generic),
+};
+
+static int hest_esrc_len(const struct acpi_hest_header *hest_hdr)
+{
+	u16 hest_type = hest_hdr->type;
+	int len;
+
+	if (hest_type >= ACPI_HEST_TYPE_RESERVED)
+		return 0;
+
+	len = hest_esrc_len_tab[hest_type];
+
+	if (hest_type == ACPI_HEST_TYPE_IA32_CORRECTED_CHECK) {
+		const struct acpi_hest_ia_corrected *cmc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_corrected,
+				     header);
+
+		len = sizeof(*cmc) + cmc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	} else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) {
+		const struct acpi_hest_ia_machine_check *mc =
+			container_of(hest_hdr,
+				     const struct acpi_hest_ia_machine_check,
+				     header);
+
+		len = sizeof(*mc) + mc->num_hardware_banks *
+		      sizeof(struct acpi_hest_ia_error_bank);
+	}
+	BUG_ON(len == -1);
+
+	return len;
+};
+
+int apei_hest_parse(apei_hest_func_t func, void *data)
+{
+	struct acpi_hest_header *hest_hdr;
+	int i, rc, len;
+
+	if (hest_disable || !hest_tab)
+		return -EINVAL;
+
+	hest_hdr = (struct acpi_hest_header *)(hest_tab + 1);
+	for (i = 0; i < hest_tab->error_source_count; i++) {
+		len = hest_esrc_len(hest_hdr);
+		if (!len) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Unknown or unused hardware error source "
+			       "type: %d for hardware error source: %d\n",
+			       hest_hdr->type, hest_hdr->source_id);
+			return -EINVAL;
+		}
+		if ((void *)hest_hdr + len >
+		    (void *)hest_tab + hest_tab->header.length) {
+			printk(XENLOG_WARNING HEST_PFX
+			       "Table contents overflow for hardware error source: %d\n",
+			       hest_hdr->source_id);
+			return -EINVAL;
+		}
+
+		rc = func(hest_hdr, data);
+		if (rc)
+			return rc;
+
+		hest_hdr = (void *)hest_hdr + len;
+	}
+
+	return 0;
+}
+
+/*
+ * Check if firmware advertises firmware first mode. We need FF bit to be set
+ * along with a set of MC banks which work in FF mode.
+ */
+static int __init hest_parse_cmc(const struct acpi_hest_header *hest_hdr,
+				 void *data)
+{
+#ifdef CONFIG_X86_MCE
+	unsigned int i;
+	const struct acpi_hest_ia_corrected *cmc;
+	const struct acpi_hest_ia_error_bank *mc_bank;
+
+	if (hest_hdr->type != ACPI_HEST_TYPE_IA32_CORRECTED_CHECK)
+		return 0;
+
+	cmc = container_of(hest_hdr, const struct acpi_hest_ia_corrected, header);
+	if (!cmc->enabled)
+		return 0;
+
+	/*
+	 * We expect HEST to provide a list of MC banks that report errors
+	 * in firmware first mode. Otherwise, return non-zero value to
+	 * indicate that we are done parsing HEST.
+	 */
+	if (!(cmc->flags & ACPI_HEST_FIRMWARE_FIRST) || !cmc->num_hardware_banks)
+		return 1;
+
+	printk(XENLOG_INFO HEST_PFX "Enabling Firmware First mode for corrected errors.\n");
+
+	mc_bank = (const struct acpi_hest_ia_error_bank *)(cmc + 1);
+	for (i = 0; i < cmc->num_hardware_banks; i++, mc_bank++)
+		mce_disable_bank(mc_bank->bank_number);
+#else
+# define acpi_disable_cmcff 1
+#endif
+
+	return 1;
+}
+
+void __init acpi_hest_init(void)
+{
+	acpi_status status;
+	acpi_physical_address hest_addr;
+	acpi_native_uint hest_len;
+
+	if (acpi_disabled)
+		return;
+
+	if (hest_disable) {
+		printk(XENLOG_INFO HEST_PFX "Table parsing disabled.\n");
+		return;
+	}
+
+	status = acpi_get_table_phys(ACPI_SIG_HEST, 0, &hest_addr, &hest_len);
+	if (status == AE_NOT_FOUND)
+		goto err;
+	if (ACPI_FAILURE(status)) {
+		printk(XENLOG_ERR HEST_PFX "Failed to get table, %s\n",
+		       acpi_format_exception(status));
+		goto err;
+	}
+	map_pages_to_xen((unsigned long)__va(hest_addr), PFN_DOWN(hest_addr),
+			 PFN_UP(hest_addr + hest_len) - PFN_DOWN(hest_addr),
+			 PAGE_HYPERVISOR);
+	hest_tab = __va(hest_addr);
+
+	if (!acpi_disable_cmcff)
+		apei_hest_parse(hest_parse_cmc, NULL);
+
+	printk(XENLOG_INFO HEST_PFX "Table parsing has been initialized\n");
+	return;
+err:
+	hest_disable = 1;
+}
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 4d22d49..76c3127 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1058,6 +1058,106 @@ void __init setup_dom0_pci_devices(
     spin_unlock(&pcidevs_lock);
 }
 
+#ifdef CONFIG_ACPI
+#include <acpi/acpi.h>
+#include <acpi/apei.h>
+
+static int hest_match_pci(const struct acpi_hest_aer_common *p,
+                          const struct pci_dev *pdev)
+{
+    return ACPI_HEST_SEGMENT(p->bus) == pdev->seg &&
+           ACPI_HEST_BUS(p->bus)     == pdev->bus &&
+           p->device                 == PCI_SLOT(pdev->devfn) &&
+           p->function               == PCI_FUNC(pdev->devfn);
+}
+
+static bool_t hest_match_type(const struct acpi_hest_header *hest_hdr,
+                              const struct pci_dev *pdev)
+{
+    unsigned int pos = pci_find_cap_offset(pdev->seg, pdev->bus,
+                                           PCI_SLOT(pdev->devfn),
+                                           PCI_FUNC(pdev->devfn),
+                                           PCI_CAP_ID_EXP);
+    u8 pcie = MASK_EXTR(pci_conf_read16(pdev->seg, pdev->bus,
+                                        PCI_SLOT(pdev->devfn),
+                                        PCI_FUNC(pdev->devfn),
+                                        pos + PCI_EXP_FLAGS),
+                        PCI_EXP_FLAGS_TYPE);
+
+    switch ( hest_hdr->type )
+    {
+    case ACPI_HEST_TYPE_AER_ROOT_PORT:
+        return pcie == PCI_EXP_TYPE_ROOT_PORT;
+    case ACPI_HEST_TYPE_AER_ENDPOINT:
+        return pcie == PCI_EXP_TYPE_ENDPOINT;
+    case ACPI_HEST_TYPE_AER_BRIDGE:
+        return pci_conf_read16(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CLASS_DEVICE) ==
+               PCI_CLASS_BRIDGE_PCI;
+    }
+
+    return 0;
+}
+
+struct aer_hest_parse_info {
+    const struct pci_dev *pdev;
+    bool_t firmware_first;
+};
+
+static bool_t hest_source_is_pcie_aer(const struct acpi_hest_header *hest_hdr)
+{
+    if ( hest_hdr->type == ACPI_HEST_TYPE_AER_ROOT_PORT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_ENDPOINT ||
+         hest_hdr->type == ACPI_HEST_TYPE_AER_BRIDGE )
+        return 1;
+    return 0;
+}
+
+static int aer_hest_parse(const struct acpi_hest_header *hest_hdr, void *data)
+{
+    struct aer_hest_parse_info *info = data;
+    const struct acpi_hest_aer_common *p;
+    bool_t ff;
+
+    if ( !hest_source_is_pcie_aer(hest_hdr) )
+        return 0;
+
+    p = (const struct acpi_hest_aer_common *)(hest_hdr + 1);
+    ff = !!(p->flags & ACPI_HEST_FIRMWARE_FIRST);
+
+    /*
+     * If no specific device is supplied, determine whether
+     * FIRMWARE_FIRST is set for *any* PCIe device.
+     */
+    if ( !info->pdev )
+    {
+        info->firmware_first |= ff;
+        return 0;
+    }
+
+    /* Otherwise, check the specific device */
+    if ( p->flags & ACPI_HEST_GLOBAL ?
+         hest_match_type(hest_hdr, info->pdev) :
+         hest_match_pci(p, info->pdev) )
+    {
+        info->firmware_first = ff;
+        return 1;
+    }
+
+    return 0;
+}
+
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *pdev)
+{
+    struct aer_hest_parse_info info = { .pdev = pdev };
+
+    return pci_find_cap_offset(pdev->seg, pdev->bus, PCI_SLOT(pdev->devfn),
+                               PCI_FUNC(pdev->devfn), PCI_CAP_ID_EXP) &&
+           apei_hest_parse(aer_hest_parse, &info) >= 0 &&
+           info.firmware_first;
+}
+#endif
+
 static int _dump_pci_devices(struct pci_seg *pseg, void *arg)
 {
     struct pci_dev *pdev;
diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c
index 33f3942..647723d 100644
--- a/xen/drivers/passthrough/vtd/quirks.c
+++ b/xen/drivers/passthrough/vtd/quirks.c
@@ -386,9 +386,11 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
     int dev = PCI_SLOT(pdev->devfn);
     int func = PCI_FUNC(pdev->devfn);
     int pos;
-    u32 val;
+    bool_t ff;
+    u32 val, val2;
     u64 bar;
     paddr_t pa;
+    const char *action;
 
     if ( pci_conf_read16(seg, bus, dev, func, PCI_VENDOR_ID) !=
          PCI_VENDOR_ID_INTEL )
@@ -438,7 +440,10 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
                 pos = pci_find_next_ext_capability(seg, bus, pdev->devfn, pos,
                                                    PCI_EXT_CAP_ID_VNDR);
             }
+            ff = 0;
         }
+        else
+            ff = pcie_aer_get_firmware_first(pdev);
         if ( !pos )
         {
             printk(XENLOG_WARNING "%04x:%02x:%02x.%u without AER capability?\n",
@@ -447,18 +452,26 @@ void pci_vtd_quirk(const struct pci_dev *pdev)
         }
 
         val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
-                         val | PCI_ERR_UNC_UNSUP);
-        val = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
-        pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
-                         val | PCI_ERR_COR_ADV_NFAT);
+        val2 = pci_conf_read32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK);
+        if ( (val & PCI_ERR_UNC_UNSUP) && (val2 & PCI_ERR_COR_ADV_NFAT) )
+            action = "Found masked";
+        else if ( !ff )
+        {
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_UNCOR_MASK,
+                             val | PCI_ERR_UNC_UNSUP);
+            pci_conf_write32(seg, bus, dev, func, pos + PCI_ERR_COR_MASK,
+                             val2 | PCI_ERR_COR_ADV_NFAT);
+            action = "Masked";
+        }
+        else
+            action = "Must not mask";
 
         /* XPUNCERRMSK Send Completion with Unsupported Request */
         val = pci_conf_read32(seg, bus, dev, func, 0x20c);
         pci_conf_write32(seg, bus, dev, func, 0x20c, val | (1 << 4));
 
-        printk(XENLOG_INFO "Masked UR signaling on %04x:%02x:%02x.%u\n",
-               seg, bus, dev, func);
+        printk(XENLOG_INFO "%s UR signaling on %04x:%02x:%02x.%u\n",
+               action, seg, bus, dev, func);
         break;
 
     case 0x100: case 0x104: case 0x108: /* Sandybridge */
diff --git a/xen/include/acpi/actbl1.h b/xen/include/acpi/actbl1.h
index 492be4e..9311e3a 100644
--- a/xen/include/acpi/actbl1.h
+++ b/xen/include/acpi/actbl1.h
@@ -445,6 +445,14 @@ struct acpi_hest_aer_common {
 #define ACPI_HEST_FIRMWARE_FIRST        (1)
 #define ACPI_HEST_GLOBAL                (1<<1)
 
+/*
+ * Macros to access the bus/segment numbers in Bus field above:
+ *  Bus number is encoded in bits 7:0
+ *  Segment number is encoded in bits 23:8
+ */
+#define ACPI_HEST_BUS(bus)              ((bus) & 0xFF)
+#define ACPI_HEST_SEGMENT(bus)          (((bus) >> 8) & 0xFFFF)
+
 /* Hardware Error Notification */
 
 struct acpi_hest_notify {
diff --git a/xen/include/acpi/apei.h b/xen/include/acpi/apei.h
index 162f616..087bbef 100644
--- a/xen/include/acpi/apei.h
+++ b/xen/include/acpi/apei.h
@@ -12,6 +12,9 @@
 
 #define FIX_APEI_RANGE_MAX 64
 
+typedef int (*apei_hest_func_t)(const struct acpi_hest_header *, void *);
+int apei_hest_parse(apei_hest_func_t, void *);
+
 int erst_write(const struct cper_record_header *record);
 size_t erst_get_record_count(void);
 int erst_get_next_record_id(u64 *record_id);
diff --git a/xen/include/xen/acpi.h b/xen/include/xen/acpi.h
index aedec65..3aeba4a 100644
--- a/xen/include/xen/acpi.h
+++ b/xen/include/xen/acpi.h
@@ -61,6 +61,7 @@ int acpi_boot_init (void);
 int acpi_boot_table_init (void);
 int acpi_numa_init (void);
 int erst_init(void);
+void acpi_hest_init(void);
 
 int acpi_table_init (void);
 int acpi_table_parse(char *id, acpi_table_handler handler);
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 3b6b1b2..98d5c46 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -151,6 +151,8 @@ int pci_find_next_cap(u16 seg, u8 bus, unsigned int devfn, u8 pos, int cap);
 int pci_find_ext_capability(int seg, int bus, int devfn, int cap);
 int pci_find_next_ext_capability(int seg, int bus, int devfn, int pos, int cap);
 
+bool_t pcie_aer_get_firmware_first(const struct pci_dev *);
+
 struct pirq;
 int msixtbl_pt_register(struct domain *, struct pirq *, uint64_t gtable);
 void msixtbl_pt_unregister(struct domain *, struct pirq *);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cb8-0000a1-Ss; Sun, 29 Jun 2014 10:44:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cb8-0000Zm-0a
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:38 +0000
Received: from [85.158.143.35:21493] by server-3.bemta-4.messagelabs.com id
	61/D8-16194-51EEFA35; Sun, 29 Jun 2014 10:44:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1404038675!14258826!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16523 invoked from network); 29 Jun 2014 10:44:36 -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;
	29 Jun 2014 10:44:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cb5-0005sh-2R
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cb4-0005Eu-Uv
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:35 +0000
Date: Sun, 29 Jun 2014 10:44:34 +0000
Message-Id: <E1X1Cb4-0005Eu-Uv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/domctl: two functional fixes
	to XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5cd10bbcf2a2795b3d7457e3efb36efc2bb2ae7e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 24 09:51:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:51:19 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 090ca8c155b7321404ea7713a28aaedb7ac4fffd
    master date: 2014-06-05 17:52:57 +0200
    master commit: 895661ae98f0249f50280b4acfb9dda70b76d7e9
    master date: 2014-06-10 12:03:16 +0200
---
 xen/arch/x86/domctl.c |   55 +++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2ed651d..e8f5363 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1075,45 +1075,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1162,12 +1165,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
@@ -1175,8 +1180,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:38 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cb8-0000a1-Ss; Sun, 29 Jun 2014 10:44:38 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cb8-0000Zm-0a
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:38 +0000
Received: from [85.158.143.35:21493] by server-3.bemta-4.messagelabs.com id
	61/D8-16194-51EEFA35; Sun, 29 Jun 2014 10:44:37 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-21.messagelabs.com!1404038675!14258826!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16523 invoked from network); 29 Jun 2014 10:44:36 -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;
	29 Jun 2014 10:44:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cb5-0005sh-2R
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cb4-0005Eu-Uv
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:35 +0000
Date: Sun, 29 Jun 2014 10:44:34 +0000
Message-Id: <E1X1Cb4-0005Eu-Uv@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/domctl: two functional fixes
	to XEN_DOMCTL_[gs]etvcpuextstate
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 5cd10bbcf2a2795b3d7457e3efb36efc2bb2ae7e
Author:     Andrew Cooper <andrew.cooper3@citrix.com>
AuthorDate: Tue Jun 24 09:51:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:51:19 2014 +0200

    x86/domctl: two functional fixes to XEN_DOMCTL_[gs]etvcpuextstate
    
    Interacting with the vcpu itself should be protected by vcpu_pause().
    Buggy/naive toolstacks might encounter adverse interaction with a vcpu context
    switch, or increase of xcr0_accum.  There are no much problems with current
    in-tree code.
    
    Explicitly permit a NULL guest handle as being a request for size.  It is the
    prevailing Xen style, and without it, valgrind's ioctl handler is unable to
    determine whether evc->buffer actually got written to.
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    
    x86/domctl: further fix to XEN_DOMCTL_[gs]etvcpuextstate
    
    Do not clobber errors from certain codepaths.  Clobbering of -EINVAL from
    failing "evc->size <= PV_XSAVE_SIZE(_xcr0_accum)" was a pre-existing bug.
    
    However, clobbering -EINVAL/-EFAULT from the get codepath was a bug
    unintentionally introduced by 090ca8c1 "x86/domctl: two functional fixes to
    XEN_DOMCTL_[gs]etvcpuextstate".
    
    Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 090ca8c155b7321404ea7713a28aaedb7ac4fffd
    master date: 2014-06-05 17:52:57 +0200
    master commit: 895661ae98f0249f50280b4acfb9dda70b76d7e9
    master date: 2014-06-10 12:03:16 +0200
---
 xen/arch/x86/domctl.c |   55 +++++++++++++++++++++++++-----------------------
 1 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 2ed651d..e8f5363 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -1075,45 +1075,48 @@ long arch_do_domctl(
              ((v = d->vcpu[evc->vcpu]) == NULL) )
             goto vcpuextstate_out;
 
+        ret = -EINVAL;
+        if ( v == current ) /* no vcpu_pause() */
+            goto vcpuextstate_out;
+
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
         {
-            unsigned int size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            unsigned int size;
 
-            if ( !evc->size && !evc->xfeature_mask )
+            ret = 0;
+            vcpu_pause(v);
+
+            size = PV_XSAVE_SIZE(v->arch.xcr0_accum);
+            if ( (!evc->size && !evc->xfeature_mask) ||
+                 guest_handle_is_null(evc->buffer) )
             {
                 evc->xfeature_mask = xfeature_mask;
                 evc->size = size;
-                ret = 0;
+                vcpu_unpause(v);
                 goto vcpuextstate_out;
             }
+
             if ( evc->size != size || evc->xfeature_mask != xfeature_mask )
-            {
                 ret = -EINVAL;
-                goto vcpuextstate_out;
-            }
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0,
-                                      sizeof(v->arch.xcr0)) )
-            {
+
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0,
+                                              sizeof(v->arch.xcr0)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)&v->arch.xcr0_accum,
-                                      sizeof(v->arch.xcr0_accum)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)&v->arch.xcr0_accum,
+                                              sizeof(v->arch.xcr0_accum)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
             offset += sizeof(v->arch.xcr0_accum);
-            if ( copy_to_guest_offset(domctl->u.vcpuextstate.buffer,
-                                      offset, (void *)v->arch.xsave_area,
-                                      size - 2 * sizeof(uint64_t)) )
-            {
+            if ( !ret && copy_to_guest_offset(evc->buffer, offset,
+                                              (void *)v->arch.xsave_area,
+                                              size - 2 * sizeof(uint64_t)) )
                 ret = -EFAULT;
-                goto vcpuextstate_out;
-            }
+
+            vcpu_unpause(v);
         }
         else
         {
@@ -1162,12 +1165,14 @@ long arch_do_domctl(
 
             if ( evc->size <= PV_XSAVE_SIZE(_xcr0_accum) )
             {
+                vcpu_pause(v);
                 v->arch.xcr0 = _xcr0;
                 v->arch.xcr0_accum = _xcr0_accum;
                 if ( _xcr0_accum & XSTATE_NONLAZY )
                     v->arch.nonlazy_xstate_used = 1;
                 memcpy(v->arch.xsave_area, _xsave_area,
                        evc->size - 2 * sizeof(uint64_t));
+                vcpu_unpause(v);
             }
             else
                 ret = -EINVAL;
@@ -1175,8 +1180,6 @@ long arch_do_domctl(
             xfree(receive_buf);
         }
 
-        ret = 0;
-
     vcpuextstate_out:
         if ( domctl->cmd == XEN_DOMCTL_getvcpuextstate )
             copyback = 1;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CbJ-0000bm-1P; Sun, 29 Jun 2014 10:44:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbI-0000bW-0Q
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:48 +0000
Received: from [85.158.143.35:35368] by server-2.bemta-4.messagelabs.com id
	78/43-06539-F1EEFA35; Sun, 29 Jun 2014 10:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1404038685!14551921!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4336 invoked from network); 29 Jun 2014 10:44:46 -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;
	29 Jun 2014 10:44:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbF-0005sn-7x
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbF-0005Fm-68
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:45 +0000
Date: Sun, 29 Jun 2014 10:44:45 +0000
Message-Id: <E1X1CbF-0005Fm-68@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: fix reboot/shutdown with
	running HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6856737512630037263=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 5736a8049b6429c677b927d3955ac67ae20d4a74
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jun 24 09:52:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:52:07 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 39ede234d1fd683430ffb1784d6d35b096f16457
    master date: 2014-06-05 17:53:35 +0200
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index c7ff72b..0e7fb0c 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -861,6 +861,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu = smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) == 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c51fa68..3737869 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -75,7 +75,7 @@ bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index cfd67de..c60fb22 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -615,6 +615,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 4d55573..4ab7cb6 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -483,6 +483,8 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:49 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CbJ-0000bm-1P; Sun, 29 Jun 2014 10:44:49 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbI-0000bW-0Q
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:48 +0000
Received: from [85.158.143.35:35368] by server-2.bemta-4.messagelabs.com id
	78/43-06539-F1EEFA35; Sun, 29 Jun 2014 10:44:47 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-4.tower-21.messagelabs.com!1404038685!14551921!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4336 invoked from network); 29 Jun 2014 10:44:46 -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;
	29 Jun 2014 10:44:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbF-0005sn-7x
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:45 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbF-0005Fm-68
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:45 +0000
Date: Sun, 29 Jun 2014 10:44:45 +0000
Message-Id: <E1X1CbF-0005Fm-68@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86: fix reboot/shutdown with
	running HVM guests
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============6856737512630037263=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

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

commit 5736a8049b6429c677b927d3955ac67ae20d4a74
Author:     Roger Pau Monné <roger.pau@citrix.com>
AuthorDate: Tue Jun 24 09:52:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:52:07 2014 +0200

    x86: fix reboot/shutdown with running HVM guests
    
    If there's a guest using VMX/SVM when the hypervisor shuts down, it
    can lead to the following crash due to VMX/SVM functions being called
    after hvm_cpu_down has been called. In order to prevent that, check in
    {svm/vmx}_ctxt_switch_from that the cpu virtualization extensions are
    still enabled.
    
    (XEN) Domain 0 shutdown: rebooting machine.
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ----[ Xen-4.5-unstable  x86_64  debug=y  Tainted:    C ]----
    (XEN) CPU:    0
    (XEN) RIP:    e008:[<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    ...
    (XEN) Xen call trace:
    (XEN)    [<ffff82d0801d90ce>] vmx_ctxt_switch_from+0x1e/0x14c
    (XEN)    [<ffff82d08015d129>] __context_switch+0x127/0x462
    (XEN)    [<ffff82d080160acf>] __sync_local_execstate+0x6a/0x8b
    (XEN)    [<ffff82d080160af9>] sync_local_execstate+0x9/0xb
    (XEN)    [<ffff82d080161728>] map_domain_page+0x88/0x4de
    (XEN)    [<ffff82d08014e721>] map_vtd_domain_page+0xd/0xf
    (XEN)    [<ffff82d08014cda2>] io_apic_read_remap_rte+0x158/0x29f
    (XEN)    [<ffff82d0801448a8>] iommu_read_apic_from_ire+0x27/0x29
    (XEN)    [<ffff82d080165625>] io_apic_read+0x17/0x65
    (XEN)    [<ffff82d080166143>] __ioapic_read_entry+0x38/0x61
    (XEN)    [<ffff82d080166aa8>] clear_IO_APIC_pin+0x1a/0xf3
    (XEN)    [<ffff82d080166bae>] clear_IO_APIC+0x2d/0x60
    (XEN)    [<ffff82d080166f63>] disable_IO_APIC+0xd/0x81
    (XEN)    [<ffff82d08018228b>] smp_send_stop+0x58/0x68
    (XEN)    [<ffff82d080181aa7>] machine_restart+0x80/0x20a
    (XEN)    [<ffff82d080181c3c>] __machine_restart+0xb/0xf
    (XEN)    [<ffff82d080128fb9>] smp_call_function_interrupt+0x99/0xc0
    (XEN)    [<ffff82d080182330>] call_function_interrupt+0x33/0x43
    (XEN)    [<ffff82d08016bd89>] do_IRQ+0x9e/0x63a
    (XEN)    [<ffff82d08016406f>] common_interrupt+0x5f/0x70
    (XEN)    [<ffff82d0801a8600>] mwait_idle+0x29c/0x2f7
    (XEN)    [<ffff82d08015cf67>] idle_loop+0x58/0x76
    (XEN)
    (XEN)
    (XEN) ****************************************
    (XEN) Panic on CPU 0:
    (XEN) Assertion 'read_cr0() & X86_CR0_TS' failed at vmx.c:644
    (XEN) ****************************************
    
    Suggested-by: Jan Beulich <jbeulich@suse.com>
    Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
    master commit: 39ede234d1fd683430ffb1784d6d35b096f16457
    master date: 2014-06-05 17:53:35 +0200
---
 xen/arch/x86/hvm/svm/svm.c         |    8 ++++++++
 xen/arch/x86/hvm/vmx/vmcs.c        |    2 +-
 xen/arch/x86/hvm/vmx/vmx.c         |    8 ++++++++
 xen/include/asm-x86/hvm/vmx/vmcs.h |    2 ++
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index c7ff72b..0e7fb0c 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -861,6 +861,14 @@ static void svm_ctxt_switch_from(struct vcpu *v)
 {
     int cpu = smp_processor_id();
 
+    /*
+     * Return early if trying to do a context switch without SVM enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely((read_efer() & EFER_SVME) == 0) )
+        return;
+
     svm_fpu_leave(v);
 
     svm_save_dr(v);
diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
index c51fa68..3737869 100644
--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -75,7 +75,7 @@ bool_t cpu_has_vmx_ins_outs_instr_info __read_mostly;
 static DEFINE_PER_CPU_READ_MOSTLY(struct vmcs_struct *, vmxon_region);
 static DEFINE_PER_CPU(struct vmcs_struct *, current_vmcs);
 static DEFINE_PER_CPU(struct list_head, active_vmcs_list);
-static DEFINE_PER_CPU(bool_t, vmxon);
+DEFINE_PER_CPU(bool_t, vmxon);
 
 static u32 vmcs_revision_id __read_mostly;
 u64 __read_mostly vmx_basic_msr;
diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c
index cfd67de..c60fb22 100644
--- a/xen/arch/x86/hvm/vmx/vmx.c
+++ b/xen/arch/x86/hvm/vmx/vmx.c
@@ -615,6 +615,14 @@ static void vmx_fpu_leave(struct vcpu *v)
 
 static void vmx_ctxt_switch_from(struct vcpu *v)
 {
+    /*
+     * Return early if trying to do a context switch without VMX enabled,
+     * this can happen when the hypervisor shuts down with HVM guests
+     * still running.
+     */
+    if ( unlikely(!this_cpu(vmxon)) )
+        return;
+
     vmx_fpu_leave(v);
     vmx_save_guest_msrs(v);
     vmx_restore_host_msrs();
diff --git a/xen/include/asm-x86/hvm/vmx/vmcs.h b/xen/include/asm-x86/hvm/vmx/vmcs.h
index 4d55573..4ab7cb6 100644
--- a/xen/include/asm-x86/hvm/vmx/vmcs.h
+++ b/xen/include/asm-x86/hvm/vmx/vmcs.h
@@ -483,6 +483,8 @@ void virtual_vmcs_exit(void *vvmcs);
 u64 virtual_vmcs_vmread(void *vvmcs, u32 vmcs_encoding);
 void virtual_vmcs_vmwrite(void *vvmcs, u32 vmcs_encoding, u64 val);
 
+DECLARE_PER_CPU(bool_t, vmxon);
+
 #endif /* ASM_X86_HVM_VMX_VMCS_H__ */
 
 /*
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3


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

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CbT-0000do-4r; Sun, 29 Jun 2014 10:44:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbR-0000dT-Ot
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:57 +0000
Received: from [85.158.139.211:11333] by server-10.bemta-5.messagelabs.com id
	94/6D-01434-92EEFA35; Sun, 29 Jun 2014 10:44:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1404038695!12598961!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17095 invoked from network); 29 Jun 2014 10:44:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbP-0005st-C8
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbP-0005G8-B6
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:55 +0000
Date: Sun, 29 Jun 2014 10:44:55 +0000
Message-Id: <E1X1CbP-0005G8-B6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] avoid crash on HVM domain destroy
	with PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddfad447042627522ce90289c1920922a6118f25
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 24 09:53:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:53:03 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    master commit: b9ae60907e6dbc686403e52a7e61a6f856401a1b
    master date: 2014-06-10 12:04:08 +0200
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index def568b..332a21f 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -296,7 +296,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:44:59 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:44:59 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CbT-0000do-4r; Sun, 29 Jun 2014 10:44:59 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbR-0000dT-Ot
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:57 +0000
Received: from [85.158.139.211:11333] by server-10.bemta-5.messagelabs.com id
	94/6D-01434-92EEFA35; Sun, 29 Jun 2014 10:44:57 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-13.tower-206.messagelabs.com!1404038695!12598961!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17095 invoked from network); 29 Jun 2014 10:44:56 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:44:56 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbP-0005st-C8
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:55 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbP-0005G8-B6
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:44:55 +0000
Date: Sun, 29 Jun 2014 10:44:55 +0000
Message-Id: <E1X1CbP-0005G8-B6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] avoid crash on HVM domain destroy
	with PCI passthrough
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit ddfad447042627522ce90289c1920922a6118f25
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Tue Jun 24 09:53:03 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:53:03 2014 +0200

    avoid crash on HVM domain destroy with PCI passthrough
    
    c/s bac6334b5 "move domain to cpupool0 before destroying it" introduced a
    problem when destroying a HVM domain with PCI passthrough enabled. The
    moving of the domain to cpupool0 includes moving the pirqs to the cpupool0
    cpus, but the event channel infrastructure already is unusable for the
    domain. So just avoid moving pirqs for dying domains.
    
    Signed-off-by: Juergen Gross <jgross@suse.com>
    master commit: b9ae60907e6dbc686403e52a7e61a6f856401a1b
    master date: 2014-06-10 12:04:08 +0200
---
 xen/common/schedule.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/xen/common/schedule.c b/xen/common/schedule.c
index def568b..332a21f 100644
--- a/xen/common/schedule.c
+++ b/xen/common/schedule.c
@@ -296,7 +296,8 @@ int sched_move_domain(struct domain *d, struct cpupool *c)
         spin_unlock_irq(lock);
 
         v->sched_priv = vcpu_priv[v->vcpu_id];
-        evtchn_move_pirqs(v);
+        if ( !d->is_dying )
+            evtchn_move_pirqs(v);
 
         new_p = cpumask_cycle(new_p, c->cpu_valid);
 
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cbj-0000fk-80; Sun, 29 Jun 2014 10:45:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbh-0000fb-UT
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:14 +0000
Received: from [193.109.254.147:15676] by server-16.bemta-14.messagelabs.com
	id 12/6A-16986-93EEFA35; Sun, 29 Jun 2014 10:45:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1404038711!14376706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16775 invoked from network); 29 Jun 2014 10:45:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbe-0005tu-UY
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbZ-0005Gn-H6
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:05 +0000
Date: Sun, 29 Jun 2014 10:45:05 +0000
Message-Id: <E1X1CbZ-0005Gn-H6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: refine SMEP test in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 803e702aa3fe21e405d36ca3fb17497b357cbbc3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:53:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:53:45 2014 +0200

    x86/HVM: refine SMEP test in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    master commit: 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
    master date: 2014-06-10 13:12:05 +0200
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 1d53ee4..b6a8ce6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -812,7 +812,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -1902,7 +1902,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 2cd2f8c..8f1f3ab 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -369,18 +369,24 @@ static inline bool_t hvm_vcpu_has_smep(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:15 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cbj-0000fk-80; Sun, 29 Jun 2014 10:45:15 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbh-0000fb-UT
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:14 +0000
Received: from [193.109.254.147:15676] by server-16.bemta-14.messagelabs.com
	id 12/6A-16986-93EEFA35; Sun, 29 Jun 2014 10:45:13 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-27.messagelabs.com!1404038711!14376706!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16775 invoked from network); 29 Jun 2014 10:45:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbe-0005tu-UY
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CbZ-0005Gn-H6
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:05 +0000
Date: Sun, 29 Jun 2014 10:45:05 +0000
Message-Id: <E1X1CbZ-0005Gn-H6@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/HVM: refine SMEP test in
	HVM_CR4_GUEST_RESERVED_BITS()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 803e702aa3fe21e405d36ca3fb17497b357cbbc3
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:53:45 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:53:45 2014 +0200

    x86/HVM: refine SMEP test in HVM_CR4_GUEST_RESERVED_BITS()
    
    Andrew validly points out that the use of the macro on the restore path
    can't rely on the CPUID bits for the guest already being in place (as
    their setting by the tool stack in turn requires the other restore
    operations already having taken place). And even worse, using
    hvm_cpuid() is invalid here because that function assumes to be used in
    the context of the vCPU in question.
    
    Reverting to the behavior prior to the change from checking
    cpu_has_sm?p to hvm_vcpu_has_sm?p() would break the other (non-restore)
    use of the macro. So let's revert to the prior behavior only for the
    restore path, by adding a respective second parameter to the macro.
    
    Obviously the two cpu_has_* uses in the macro should really also be
    converted to hvm_cpuid() based checks at least for the non-restore
    path.
    
    Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Tested-by: David Vrabel <david.vrabel@citrix.com>
    master commit: 584287380baf81e5acdd9dc7dfc7ffccd1e9a856
    master date: 2014-06-10 13:12:05 +0200
---
 xen/arch/x86/hvm/hvm.c        |    4 ++--
 xen/include/asm-x86/hvm/hvm.h |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index 1d53ee4..b6a8ce6 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -812,7 +812,7 @@ static int hvm_load_cpu_ctxt(struct domain *d, hvm_domain_context_t *h)
         return -EINVAL;
     }
 
-    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( ctxt.cr4 & HVM_CR4_GUEST_RESERVED_BITS(v, 1) )
     {
         printk(XENLOG_G_ERR "HVM%d restore: bad CR4 %#" PRIx64 "\n",
                d->domain_id, ctxt.cr4);
@@ -1902,7 +1902,7 @@ int hvm_set_cr4(unsigned long value)
     struct vcpu *v = current;
     unsigned long old_cr;
 
-    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v) )
+    if ( value & HVM_CR4_GUEST_RESERVED_BITS(v, 0) )
     {
         HVM_DBG_LOG(DBG_LEVEL_1,
                     "Guest attempts to set reserved bit in CR4: %lx",
diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h
index 2cd2f8c..8f1f3ab 100644
--- a/xen/include/asm-x86/hvm/hvm.h
+++ b/xen/include/asm-x86/hvm/hvm.h
@@ -369,18 +369,24 @@ static inline bool_t hvm_vcpu_has_smep(void)
     (X86_CR4_VMXE | X86_CR4_PAE | X86_CR4_MCE))
 
 /* These bits in CR4 cannot be set by the guest. */
-#define HVM_CR4_GUEST_RESERVED_BITS(_v)                 \
+#define HVM_CR4_GUEST_RESERVED_BITS(v, restore) ({      \
+    const struct vcpu *_v = (v);                        \
+    bool_t _restore = !!(restore);                      \
+    ASSERT((_restore) || _v == current);                \
     (~((unsigned long)                                  \
        (X86_CR4_VME | X86_CR4_PVI | X86_CR4_TSD |       \
         X86_CR4_DE  | X86_CR4_PSE | X86_CR4_PAE |       \
         X86_CR4_MCE | X86_CR4_PGE | X86_CR4_PCE |       \
         X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT |           \
-        (hvm_vcpu_has_smep() ? X86_CR4_SMEP : 0) |      \
+        (((_restore) ? cpu_has_smep :                   \
+                       hvm_vcpu_has_smep()) ?           \
+         X86_CR4_SMEP : 0) |                            \
         (cpu_has_fsgsbase ? X86_CR4_FSGSBASE : 0) |     \
-        ((nestedhvm_enabled((_v)->domain) && cpu_has_vmx)\
-                      ? X86_CR4_VMXE : 0)  |             \
-        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |             \
-        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))))
+        ((nestedhvm_enabled(_v->domain) && cpu_has_vmx) \
+                      ? X86_CR4_VMXE : 0)  |            \
+        (cpu_has_pcid ? X86_CR4_PCIDE : 0) |            \
+        (cpu_has_xsave ? X86_CR4_OSXSAVE : 0))));       \
+})
 
 /* These exceptions must always be intercepted. */
 #define HVM_TRAP_MASK ((1U << TRAP_machine_check) | (1U << TRAP_invalid_op))
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cbt-0000hK-JN; Sun, 29 Jun 2014 10:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbr-0000h4-UL
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:24 +0000
Received: from [85.158.139.211:25802] by server-15.bemta-5.messagelabs.com id
	2E/BB-19516-34EEFA35; Sun, 29 Jun 2014 10:45:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1404038721!12574231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17323 invoked from network); 29 Jun 2014 10:45:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbp-0005u0-4f
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbp-0005HC-2Y
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:21 +0000
Date: Sun, 29 Jun 2014 10:45:21 +0000
Message-Id: <E1X1Cbp-0005HC-2Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mce: don't spam the console
	with "CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd2e744bd272347d00f92afa7ed575a60f8c5bcc
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jun 24 09:54:44 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:54:44 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: 323338f86fb6cd6f6dba4f59a84eed71b3552d21
    master date: 2014-06-16 11:59:32 +0200
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b32fdb2..5b93870 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -49,11 +49,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -62,13 +66,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -802,6 +810,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
 
     per_cpu(no_cmci_banks, cpu) = cmci;
     per_cpu(mce_banks_owned, cpu) = owned;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:25 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cbt-0000hK-JN; Sun, 29 Jun 2014 10:45:25 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbr-0000h4-UL
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:24 +0000
Received: from [85.158.139.211:25802] by server-15.bemta-5.messagelabs.com id
	2E/BB-19516-34EEFA35; Sun, 29 Jun 2014 10:45:23 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-12.tower-206.messagelabs.com!1404038721!12574231!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17323 invoked from network); 29 Jun 2014 10:45:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-206.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:22 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbp-0005u0-4f
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbp-0005HC-2Y
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:21 +0000
Date: Sun, 29 Jun 2014 10:45:21 +0000
Message-Id: <E1X1Cbp-0005HC-2Y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mce: don't spam the console
	with "CPUx: Temperature z"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit cd2e744bd272347d00f92afa7ed575a60f8c5bcc
Author:     Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
AuthorDate: Tue Jun 24 09:54:44 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:54:44 2014 +0200

    x86/mce: don't spam the console with "CPUx: Temperature z"
    
    If the machine has been quite busy it ends up with these messages
    printed on the hypervisor console:
    
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU0: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU0: Temperature above threshold
    (XEN) CPU0: Running in modulated clock mode
    (XEN) CPU1: Temperature/speed normal
    (XEN) CPU2: Temperature/speed normal
    (XEN) CPU3: Temperature/speed normal
    
    While the state changes are important, the non-altered state
    information is not needed. As such add a latch mechanism to only print
    the information if it has changed since the last update (and the
    hardware doesn't properly suppress redundant notifications).
    
    This was observed on Intel DQ67SW,
    BIOS SWQ6710H.86A.0066.2012.1105.1504 11/05/2012
    
    Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Christoph Egger <chegger@amazon.de>
    master commit: 323338f86fb6cd6f6dba4f59a84eed71b3552d21
    master date: 2014-06-16 11:59:32 +0200
---
 xen/arch/x86/cpu/mcheck/mce_intel.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce_intel.c b/xen/arch/x86/cpu/mcheck/mce_intel.c
index b32fdb2..5b93870 100644
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c
@@ -49,11 +49,15 @@ static int __read_mostly nr_intel_ext_msrs;
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
 #ifdef CONFIG_X86_MCE_THERMAL
+#define MCE_RING                0x1
+static DEFINE_PER_CPU(int, last_state);
+
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
+    int *this_last_state;
 
     ack_APIC_irq();
 
@@ -62,13 +66,17 @@ static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 
     per_cpu(next, cpu) = NOW() + MILLISECS(5000);
     rdmsrl(MSR_IA32_THERM_STATUS, msr_content);
-    if (msr_content & 0x1) {
-        printk(KERN_EMERG "CPU%d: Temperature above threshold\n", cpu);
-        printk(KERN_EMERG "CPU%d: Running in modulated clock mode\n",
-                cpu);
+    this_last_state = &per_cpu(last_state, cpu);
+    if ( *this_last_state == (msr_content & MCE_RING) )
+        return;
+    *this_last_state = msr_content & MCE_RING;
+    if ( msr_content & MCE_RING )
+    {
+        printk(KERN_EMERG "CPU%u: Temperature above threshold\n", cpu);
+        printk(KERN_EMERG "CPU%u: Running in modulated clock mode\n", cpu);
         add_taint(TAINT_MACHINE_CHECK);
     } else {
-        printk(KERN_INFO "CPU%d: Temperature/speed normal\n", cpu);
+        printk(KERN_INFO "CPU%u: Temperature/speed normal\n", cpu);
     }
 }
 
@@ -802,6 +810,7 @@ static int cpu_mcabank_alloc(unsigned int cpu)
 
     per_cpu(no_cmci_banks, cpu) = cmci;
     per_cpu(mce_banks_owned, cpu) = owned;
+    per_cpu(last_state, cpu) = -1;
 
     return 0;
 out:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cc2-0000iv-Lw; Sun, 29 Jun 2014 10:45:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cc2-0000il-3w
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:34 +0000
Received: from [85.158.143.35:27308] by server-1.bemta-4.messagelabs.com id
	DE/53-09496-D4EEFA35; Sun, 29 Jun 2014 10:45:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1404038731!14518848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27438 invoked from network); 29 Jun 2014 10:45:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbz-0005u6-93
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbz-0005HZ-7y
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:31 +0000
Date: Sun, 29 Jun 2014 10:45:31 +0000
Message-Id: <E1X1Cbz-0005HZ-7y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c219c76d74994ea7f1cbdc99a761fc1e6d203c3a
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:55:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:55:27 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 84c340ba4c3eb99278b6ba885616bb183b88ad67
    master date: 2014-06-18 15:50:02 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    3 ++-
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 5ea1a1d..d0cb15c 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -162,7 +162,7 @@ static void amd_iommu_setup_domain_device(
          !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
         if ( devfn == pdev->devfn )
-            enable_ats_device(iommu->seg, bus, devfn);
+            enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index cf649d4..000e76d 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #define ATS_REG_CAP    4
@@ -34,7 +35,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 61740d2..04c2639 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1434,7 +1434,7 @@ static int domain_context_mapping(
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1913,7 +1913,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:34 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Cc2-0000iv-Lw; Sun, 29 Jun 2014 10:45:34 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cc2-0000il-3w
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:34 +0000
Received: from [85.158.143.35:27308] by server-1.bemta-4.messagelabs.com id
	DE/53-09496-D4EEFA35; Sun, 29 Jun 2014 10:45:33 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-6.tower-21.messagelabs.com!1404038731!14518848!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27438 invoked from network); 29 Jun 2014 10:45:32 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbz-0005u6-93
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cbz-0005HZ-7y
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:31 +0000
Date: Sun, 29 Jun 2014 10:45:31 +0000
Message-Id: <E1X1Cbz-0005HZ-7y@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] IOMMU: prevent VT-d device IOTLB
	operations on wrong IOMMU
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c219c76d74994ea7f1cbdc99a761fc1e6d203c3a
Author:     Malcolm Crossley <malcolm.crossley@citrix.com>
AuthorDate: Tue Jun 24 09:55:27 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:55:27 2014 +0200

    IOMMU: prevent VT-d device IOTLB operations on wrong IOMMU
    
    PCIe ATS allows for devices to contain IOTLBs, the VT-d code was iterating
    around all ATS capable devices and issuing IOTLB operations for all IOMMUs,
    even though each ATS device is only accessible via one particular IOMMU.
    
    Issuing an IOMMU operation to a device not accessible via that IOMMU results
    in an IOMMU timeout because the device does not reply. VT-d IOMMU timeouts
    result in a Xen panic.
    
    Therefore this bug prevents any Intel system with 2 or more ATS enabled IOMMUs,
    each with an ATS device connected to them, from booting Xen.
    
    The patch adds a IOMMU pointer to the ATS device struct so the VT-d code can
    ensure it does not issue IOMMU ATS operations on the wrong IOMMU. A void
    pointer has to be used because AMD and Intel IOMMU implementations do not have
    a common IOMMU structure or indexing mechanism.
    
    Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Kevin Tian <kevin.tian@intel.com>
    Reviewed-by: Jan Beulich <jbeulich@suse.com>
    master commit: 84c340ba4c3eb99278b6ba885616bb183b88ad67
    master date: 2014-06-18 15:50:02 +0200
---
 xen/drivers/passthrough/amd/pci_amd_iommu.c |    2 +-
 xen/drivers/passthrough/ats.h               |    3 ++-
 xen/drivers/passthrough/vtd/iommu.c         |    4 ++--
 xen/drivers/passthrough/vtd/x86/ats.c       |    4 ++++
 xen/drivers/passthrough/x86/ats.c           |    3 ++-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c
index 5ea1a1d..d0cb15c 100644
--- a/xen/drivers/passthrough/amd/pci_amd_iommu.c
+++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c
@@ -162,7 +162,7 @@ static void amd_iommu_setup_domain_device(
          !pci_ats_enabled(iommu->seg, bus, pdev->devfn) )
     {
         if ( devfn == pdev->devfn )
-            enable_ats_device(iommu->seg, bus, devfn);
+            enable_ats_device(iommu->seg, bus, devfn, iommu);
 
         amd_iommu_flush_iotlb(devfn, pdev, INV_IOMMU_ALL_PAGES_ADDRESS, 0);
     }
diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h
index cf649d4..000e76d 100644
--- a/xen/drivers/passthrough/ats.h
+++ b/xen/drivers/passthrough/ats.h
@@ -24,6 +24,7 @@ struct pci_ats_dev {
     u8 bus;
     u8 devfn;
     u16 ats_queue_depth;    /* ATS device invalidation queue depth */
+    const void *iommu;      /* No common IOMMU struct so use void pointer */
 };
 
 #define ATS_REG_CAP    4
@@ -34,7 +35,7 @@ struct pci_ats_dev {
 extern struct list_head ats_devices;
 extern bool_t ats_enabled;
 
-int enable_ats_device(int seg, int bus, int devfn);
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu);
 void disable_ats_device(int seg, int bus, int devfn);
 struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn);
 
diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c
index 61740d2..04c2639 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1434,7 +1434,7 @@ static int domain_context_mapping(
         ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn,
                                          pdev);
         if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 )
-            enable_ats_device(seg, bus, devfn);
+            enable_ats_device(seg, bus, devfn, drhd->iommu);
 
         break;
 
@@ -1913,7 +1913,7 @@ static int intel_iommu_enable_device(struct pci_dev *pdev)
     if ( ret <= 0 )
         return ret;
 
-    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn);
+    ret = enable_ats_device(pdev->seg, pdev->bus, pdev->devfn, drhd->iommu);
 
     return ret >= 0 ? 0 : ret;
 }
diff --git a/xen/drivers/passthrough/vtd/x86/ats.c b/xen/drivers/passthrough/vtd/x86/ats.c
index f3b8c2d..ea57d7d 100644
--- a/xen/drivers/passthrough/vtd/x86/ats.c
+++ b/xen/drivers/passthrough/vtd/x86/ats.c
@@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *iommu, u16 did,
     {
         sid = (pdev->bus << 8) | pdev->devfn;
 
+        /* Only invalidate devices that belong to this IOMMU */
+        if ( pdev->iommu != iommu )
+            continue;
+
         switch ( type ) {
         case DMA_TLB_DSI_FLUSH:
             if ( !device_in_domain(iommu, pdev, did) )
diff --git a/xen/drivers/passthrough/x86/ats.c b/xen/drivers/passthrough/x86/ats.c
index bb7ee9a..1e3e03a 100644
--- a/xen/drivers/passthrough/x86/ats.c
+++ b/xen/drivers/passthrough/x86/ats.c
@@ -23,7 +23,7 @@ LIST_HEAD(ats_devices);
 bool_t __read_mostly ats_enabled = 1;
 boolean_param("ats", ats_enabled);
 
-int enable_ats_device(int seg, int bus, int devfn)
+int enable_ats_device(int seg, int bus, int devfn, const void *iommu)
 {
     struct pci_ats_dev *pdev = NULL;
     u32 value;
@@ -66,6 +66,7 @@ int enable_ats_device(int seg, int bus, int devfn)
         pdev->seg = seg;
         pdev->bus = bus;
         pdev->devfn = devfn;
+        pdev->iommu = iommu;
         value = pci_conf_read16(seg, bus, PCI_SLOT(devfn),
                                 PCI_FUNC(devfn), pos + ATS_REG_CAP);
         pdev->ats_queue_depth = value & ATS_QUEUE_DEPTH_MASK ?:
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CcC-0000lC-QZ; Sun, 29 Jun 2014 10:45:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcC-0000ky-2x
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:44 +0000
Received: from [85.158.143.35:37450] by server-1.bemta-4.messagelabs.com id
	20/73-09496-75EEFA35; Sun, 29 Jun 2014 10:45:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1404038741!14589855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8735 invoked from network); 29 Jun 2014 10:45:42 -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;
	29 Jun 2014 10:45:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cc9-0005uC-Dt
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cc9-0005Hy-Bh
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:41 +0000
Date: Sun, 29 Jun 2014 10:45:41 +0000
Message-Id: <E1X1Cc9-0005Hy-Bh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/EFI: allow FPU/XMM use in
	runtime service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22f8c606ae35defc9feb0fc49aa90c7754bbd178
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:56:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:56:07 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: e0fe297dabc96d8161d568f19a99722c4739b9f9
    master date: 2014-06-18 15:53:27 +0200
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index 37bb535..e67052b 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -45,8 +47,14 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -82,6 +90,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 82b9c72..e977453 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -272,10 +272,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -290,9 +290,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 1f5fe50..fd268a9 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:44 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CcC-0000lC-QZ; Sun, 29 Jun 2014 10:45:44 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcC-0000ky-2x
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:44 +0000
Received: from [85.158.143.35:37450] by server-1.bemta-4.messagelabs.com id
	20/73-09496-75EEFA35; Sun, 29 Jun 2014 10:45:43 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-10.tower-21.messagelabs.com!1404038741!14589855!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8735 invoked from network); 29 Jun 2014 10:45:42 -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;
	29 Jun 2014 10:45:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cc9-0005uC-Dt
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:41 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1Cc9-0005Hy-Bh
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:41 +0000
Date: Sun, 29 Jun 2014 10:45:41 +0000
Message-Id: <E1X1Cc9-0005Hy-Bh@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/EFI: allow FPU/XMM use in
	runtime service functions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 22f8c606ae35defc9feb0fc49aa90c7754bbd178
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:56:07 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:56:07 2014 +0200

    x86/EFI: allow FPU/XMM use in runtime service functions
    
    UEFI spec update 2.4B developed a requirement to enter runtime service
    functions with CR0.TS (and CR0.EM) clear, thus making feasible the
    already previously stated permission for these functions to use some of
    the XMM registers. Enforce this requirement (along with the connected
    ones on FPU control word and MXCSR) by going through a full FPU save
    cycle (if the FPU was dirty) in efi_rs_enter() (along with loading  the
    specified values into the other two registers).
    
    Note that the UEFI spec mandates that extension registers other than
    XMM ones (for our purposes all that get restored eagerly) are preserved
    across runtime function calls, hence there's nothing we need to restore
    in efi_rs_leave() (they do get saved, but just for simplicity's sake).
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    master commit: e0fe297dabc96d8161d568f19a99722c4739b9f9
    master date: 2014-06-18 15:53:27 +0200
---
 xen/arch/x86/efi/runtime.c |    9 +++++++++
 xen/arch/x86/i387.c        |   17 +++++++++++++++--
 xen/include/asm-x86/i387.h |    1 +
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/efi/runtime.c b/xen/arch/x86/efi/runtime.c
index 37bb535..e67052b 100644
--- a/xen/arch/x86/efi/runtime.c
+++ b/xen/arch/x86/efi/runtime.c
@@ -10,6 +10,8 @@ DEFINE_XEN_GUEST_HANDLE(CHAR16);
 
 #ifndef COMPAT
 
+# include <asm/i387.h>
+# include <asm/xstate.h>
 # include <public/platform.h>
 
 const bool_t efi_enabled = 1;
@@ -45,8 +47,14 @@ const struct efi_pci_rom *__read_mostly efi_pci_roms;
 
 unsigned long efi_rs_enter(void)
 {
+    static const u16 fcw = FCW_DEFAULT;
+    static const u32 mxcsr = MXCSR_DEFAULT;
     unsigned long cr3 = read_cr3();
 
+    save_fpu_enable();
+    asm volatile ( "fldcw %0" :: "m" (fcw) );
+    asm volatile ( "ldmxcsr %0" :: "m" (mxcsr) );
+
     spin_lock(&efi_rs_lock);
 
     /* prevent fixup_page_fault() from doing anything */
@@ -82,6 +90,7 @@ void efi_rs_leave(unsigned long cr3)
     }
     irq_exit();
     spin_unlock(&efi_rs_lock);
+    stts();
 }
 
 unsigned long efi_get_time(void)
diff --git a/xen/arch/x86/i387.c b/xen/arch/x86/i387.c
index 82b9c72..e977453 100644
--- a/xen/arch/x86/i387.c
+++ b/xen/arch/x86/i387.c
@@ -272,10 +272,10 @@ void vcpu_restore_fpu_lazy(struct vcpu *v)
  * On each context switch, save the necessary FPU info of VCPU being switch 
  * out. It dispatches saving operation based on CPU's capability.
  */
-void vcpu_save_fpu(struct vcpu *v)
+static bool_t _vcpu_save_fpu(struct vcpu *v)
 {
     if ( !v->fpu_dirtied && !v->arch.nonlazy_xstate_used )
-        return;
+        return 0;
 
     ASSERT(!is_idle_vcpu(v));
 
@@ -290,9 +290,22 @@ void vcpu_save_fpu(struct vcpu *v)
         fpu_fsave(v);
 
     v->fpu_dirtied = 0;
+
+    return 1;
+}
+
+void vcpu_save_fpu(struct vcpu *v)
+{
+    _vcpu_save_fpu(v);
     stts();
 }
 
+void save_fpu_enable(void)
+{
+    if ( !_vcpu_save_fpu(current) )
+        clts();
+}
+
 /* Initialize FPU's context save area */
 int vcpu_init_fpu(struct vcpu *v)
 {
diff --git a/xen/include/asm-x86/i387.h b/xen/include/asm-x86/i387.h
index 1f5fe50..fd268a9 100644
--- a/xen/include/asm-x86/i387.h
+++ b/xen/include/asm-x86/i387.h
@@ -38,6 +38,7 @@ struct ix87_state {
 void vcpu_restore_fpu_eager(struct vcpu *v);
 void vcpu_restore_fpu_lazy(struct vcpu *v);
 void vcpu_save_fpu(struct vcpu *v);
+void save_fpu_enable(void);
 
 int vcpu_init_fpu(struct vcpu *v);
 void vcpu_destroy_fpu(struct vcpu *v);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CcM-0000mY-TV; Sun, 29 Jun 2014 10:45:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcM-0000mJ-2o
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:54 +0000
Received: from [85.158.137.68:47162] by server-6.bemta-3.messagelabs.com id
	66/7B-15862-16EEFA35; Sun, 29 Jun 2014 10:45:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1404038751!12800731!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13591 invoked from network); 29 Jun 2014 10:45:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcJ-0005uI-JH
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcJ-0005J3-GU
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:51 +0000
Date: Sun, 29 Jun 2014 10:45:51 +0000
Message-Id: <E1X1CcJ-0005J3-GU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d/qinval: make local variable
	used for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c982faf534650d0cd5c4ab2c5b4f1293fc62dd20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:56:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:56:40 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
    master date: 2014-06-20 10:25:33 +0200
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 6a410d8..d2b5fa9 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:45:54 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:45:54 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1CcM-0000mY-TV; Sun, 29 Jun 2014 10:45:54 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcM-0000mJ-2o
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:54 +0000
Received: from [85.158.137.68:47162] by server-6.bemta-3.messagelabs.com id
	66/7B-15862-16EEFA35; Sun, 29 Jun 2014 10:45:53 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-15.tower-31.messagelabs.com!1404038751!12800731!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13591 invoked from network); 29 Jun 2014 10:45:52 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-31.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:45:52 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcJ-0005uI-JH
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:51 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcJ-0005J3-GU
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:45:51 +0000
Date: Sun, 29 Jun 2014 10:45:51 +0000
Message-Id: <E1X1CcJ-0005J3-GU@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] VT-d/qinval: make local variable
	used for communication with IOMMU "volatile"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit c982faf534650d0cd5c4ab2c5b4f1293fc62dd20
Author:     Jan Beulich <jbeulich@suse.com>
AuthorDate: Tue Jun 24 09:56:40 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:56:40 2014 +0200

    VT-d/qinval: make local variable used for communication with IOMMU "volatile"
    
    Without that there is - afaict - nothing preventing the compiler from
    putting the variable into a register for the duration of the wait loop.
    
    Signed-off-by: Jan Beulich <jbeulich@suse.com>
    Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
    Acked-by: Yang Zhang <yang.z.zhang@intel.com>
    master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
    master date: 2014-06-20 10:25:33 +0200
---
 xen/drivers/passthrough/vtd/qinval.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c
index 6a410d8..d2b5fa9 100644
--- a/xen/drivers/passthrough/vtd/qinval.c
+++ b/xen/drivers/passthrough/vtd/qinval.c
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:46:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:46:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Ccb-0000oh-00; Sun, 29 Jun 2014 10:46:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcZ-0000oY-S4
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:46:08 +0000
Received: from [193.109.254.147:48359] by server-7.bemta-14.messagelabs.com id
	C7/22-17726-F6EEFA35; Sun, 29 Jun 2014 10:46:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1404038765!14280525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 753 invoked from network); 29 Jun 2014 10:46:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:46:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcT-0005ur-Q9
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:46:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcT-0005JZ-OT
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:46:01 +0000
Date: Sun, 29 Jun 2014 10:46:01 +0000
Message-Id: <E1X1CcT-0005JZ-OT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mwait_idle: fix trace output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ce2638a2121e61e823e270d8c07fe6d4a70f2b1
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 24 09:57:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:57:19 2014 +0200

    x86/mwait_idle: fix trace output
    
    Use the C-state's type when tracing, not its index since the index is
    not set by the mwait_idle driver.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: d17ac1d5433ba2c25d7fab11baba59173e339896
    master date: 2014-06-20 10:37:21 +0200
---
 xen/arch/x86/cpu/mwait-idle.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index e0c9707..f504dfd 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -317,7 +317,7 @@ static void mwait_idle(void)
 		lapic_timer_off();
 
 	before = cpuidle_get_tick();
-	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
 
 	if (cpu_is_haltable(cpu))
 		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
@@ -326,7 +326,7 @@ static void mwait_idle(void)
 
 	cstate_restore_tsc();
 	trace_exit_reason(irq_traced);
-	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
 		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
 	update_idle_stats(power, cx, before, after);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

From xen-changelog-bounces@lists.xen.org Sun Jun 29 10:46:09 2014
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sun, 29 Jun 2014 10:46:09 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1X1Ccb-0000oh-00; Sun, 29 Jun 2014 10:46:09 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcZ-0000oY-S4
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:46:08 +0000
Received: from [193.109.254.147:48359] by server-7.bemta-14.messagelabs.com id
	C7/22-17726-F6EEFA35; Sun, 29 Jun 2014 10:46:07 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-3.tower-27.messagelabs.com!1404038765!14280525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 753 invoked from network); 29 Jun 2014 10:46:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-3.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Jun 2014 10:46:06 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcT-0005ur-Q9
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:46:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1X1CcT-0005JZ-OT
	for xen-changelog@lists.xensource.com; Sun, 29 Jun 2014 10:46:01 +0000
Date: Sun, 29 Jun 2014 10:46:01 +0000
Message-Id: <E1X1CcT-0005JZ-OT@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen stable-4.3] x86/mwait_idle: fix trace output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: "Change log for Mercurial \(receive only\)"
	<xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 8ce2638a2121e61e823e270d8c07fe6d4a70f2b1
Author:     Ross Lagerwall <ross.lagerwall@citrix.com>
AuthorDate: Tue Jun 24 09:57:19 2014 +0200
Commit:     Jan Beulich <jbeulich@suse.com>
CommitDate: Tue Jun 24 09:57:19 2014 +0200

    x86/mwait_idle: fix trace output
    
    Use the C-state's type when tracing, not its index since the index is
    not set by the mwait_idle driver.
    
    Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
    master commit: d17ac1d5433ba2c25d7fab11baba59173e339896
    master date: 2014-06-20 10:37:21 +0200
---
 xen/arch/x86/cpu/mwait-idle.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/cpu/mwait-idle.c b/xen/arch/x86/cpu/mwait-idle.c
index e0c9707..f504dfd 100644
--- a/xen/arch/x86/cpu/mwait-idle.c
+++ b/xen/arch/x86/cpu/mwait-idle.c
@@ -317,7 +317,7 @@ static void mwait_idle(void)
 		lapic_timer_off();
 
 	before = cpuidle_get_tick();
-	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->idx, before, exp, pred);
+	TRACE_4D(TRC_PM_IDLE_ENTRY, cx->type, before, exp, pred);
 
 	if (cpu_is_haltable(cpu))
 		mwait_idle_with_hints(eax, MWAIT_ECX_INTERRUPT_BREAK);
@@ -326,7 +326,7 @@ static void mwait_idle(void)
 
 	cstate_restore_tsc();
 	trace_exit_reason(irq_traced);
-	TRACE_6D(TRC_PM_IDLE_EXIT, cx->idx, after,
+	TRACE_6D(TRC_PM_IDLE_EXIT, cx->type, after,
 		irq_traced[0], irq_traced[1], irq_traced[2], irq_traced[3]);
 
 	update_idle_stats(power, cx, before, after);
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.3

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

